1
PDF 생성을 위해 Apache FOP를 사용하고 있습니다. XSL 파일에서 non-xml 문서를 읽으려면 unparsed-text() 함수를 사용하고 싶습니다.javax.xml.transform.TransformerException : 함수를 찾을 수 없습니다 : unparsed-text
해당 기능을 작성한 후에이 오류가 발생했습니다. 이것은 내 XSL 파일입니다.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:f="Functions">
<xsl:variable name="properties" select="unparsed-text('file.properties')" as="xs:string"/>
<xsl:function name="f:getProperty" as="xs:string?">
<xsl:param name="key" as="xs:string"/>
<xsl:variable name="lines" as="xs:string*" select="
for $x in
for $i in tokenize($properties, '\n')[matches(., '^[^!#]')] return
tokenize($i, '=')
return translate(normalize-space($x), '\', '')"/>
<xsl:sequence select="$lines[index-of($lines, $key)+1]"/>
</xsl:function>
<xsl:template match=" EmployeeData">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="simple"
page-height="20cm" page-width="10.5cm" margin-left="0.2cm"
margin-right="0.2cm">
<fo:region-body margin-top="0.5cm" />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="simple">
<xsl:variable name="lang" select="language" />
<fo:flow flow-name="xsl-region-body">
From Properties File <xsl:value-of select="f:getProperty('language')"/>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>
어떻게이 오류를 제거 할 수 있습니까? 또는 가능한 경우 그 대안을 제공하십시오. 감사합니다.
생성 된 HTML 형식이 올바르지 않습니다. 결과를 PDF 생성기로 정확히 전달하는 곳에서 디버깅하면됩니다. –