2

I am using Apache FOP for PDF generation.I want to use unparsed-text() function to read non-xml document in XSL file.

After writing that function i got this error. This is my XSL file.

<?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>

How can i remove this error? Or give me any alternative for that if possible. Thank you.

1
  • The generated html not in proper format. You just debug that where exactly you are passing your result to the PDF generator. Commented Oct 15, 2013 at 6:55

1 Answer 1

3

The error suggests you are using an XSLT 1.0 processor to run the XSLT. unparsed-text is only supported by XSLT 2.0 processors like Saxon 9.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.