retatu
retatu

Reputation: 453

Code xslt error: File not found

I'm trying to use a external XML for compare with another XML, but have error when I compile.

I'm using the apache camel to compile.

Error:

DefaultErrorHandler            ERROR Failed delivery for (MessageId: ID-DESKTOP-L78T6HF-57465-1476187649613-0-7 on ExchangeId: ID-DESKTOP-L78T6HF-57465-1476187649613-0-8). Exhausted after delivery attempt: 1 caught: javax.xml.transform.TransformerException: com.sun.org.apache.xalan.internal.xsltc.TransletException: com.sun.org.apache.xalan.internal.xsltc.TransletException: java.io.FileNotFoundException: E:/TestesCamel/to/qualis/estrato/qualis.xml

The error shows that file not found, but the file is in this directory.

This is the part that have the error:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>
<xsl:template match="/">
    <xsl:variable name="qualis" select="document('E:/TestesCamel/to/qualis/estrato/qualis.xml')"/>
    <xsl:for-each select="$qualis/DATA">
        . 
        .
    </xsl:for-each>
</xsl:template>

Can anyone help me? Thanks

Upvotes: 4

Views: 989

Answers (1)

uL1
uL1

Reputation: 2167

Prefix your URI with protocol file:///.

<xsl:variable name="qualis" select="document('file:///E:/TestesCamel/to/qualis/estrato/qualis.xml')"/>

Further information: Xalan [via Java] can be configured with a specific directory as basepath - absolute file paths might get handled as relative.

Upvotes: 2

Related Questions