나는 나무의 이런 종류의 큰 XML 파일 (6 기가 바이트)가 있습니다. 문서에서 한 번 스트리밍 제한을 원하지 않습니다. 그래서 copy-of()
을 사용하려고했습니다. XSLT 3.0 부분 스트리밍 (작센)
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
<xsl:mode streamable="yes" />
<xsl:template match="/">
GLOBAL HEADER
<xsl:for-each select="/Report/Document/copy-of()" >
DOC HEADER
documentType: <xsl:value-of select="documentType"/>
person/firstname: <xsl:value-of select="person/firstname"/>
<xsl:call-template name="fnc1"/>
DOC FOOTER
</xsl:for-each>
GLOBAL FOOTER
</xsl:template>
<xsl:template name="fnc1">
documentType again: <xsl:value-of select="documentType"/>
</xsl:template>
</xsl:stylesheet>
가 작동하는 의미에서 : 여기
http://saxonica.com/documentation/html/sourcedocs/streaming/burst-mode-streaming.html 내 XSLT 스타일 시트입니다 : 나는 내가하고 싶은 것은, 여기에 설명되어있는 "버스트 모드"에 매우 근접하다는 것을 생각 copy-of()
과 함께 여러 개의 xsl:value-of
을 for-each (like in this question)에서 직접 사용할 수 있기 때문입니다.
(그렇지 않으면이 오류 * There are at least two consuming operands: {xsl:value-of} on line 8, and {xsl:value-of} on line 9
이)하지만 <xsl:call-template name="fnc1"/>
이 오류를 생성하기 때문에 나는 아직도 스트리밍 제약을가 :
Error at xsl:template on line 4 column 25 of stylesheet.xsl:
XTSE3430: Template rule is declared streamable but it does not satisfy the streamability rules.
* xsl:call-template is not streamable in this Saxon release
Stylesheet compilation failed: 1 error reported
: 부분 스트리밍을 수행하는 방법 (문서는 하나를 제외하고 완전히 하나로드) call-template
(및 기타 apply-templates
)을 문서에 사용할 수 있으려면?
도움 주셔서 감사합니다.
당신은' '대신에'< xsl : template>'을 선택하면 명명 된 템플릿 및/또는 일치하는 템플릿을 사용하여'Document' 요소 노드를 처리 할 수 있어야합니다. 및 그 자손들 DOC FOOTER> xsl : template match = "Document" xsl : template>'? –
스트림을 사용해 보았지만 같은 오류가있었습니다. 이제'copy-of()'에'apply-templates'를 사용하여 트릭을 만들었습니다.'변환 중 치명적인 오류가 발생했습니다 : java.lang.RuntimeException : 4 행의 템플릿을 내부 오류로 평가 중' – steco