on 08-23-2012 10:49 AM
Hi all
I try to use xpath document() in PI 7.11 xslt Mapping.
example:
<xsl:variable name="bla" select="document('')/*"></xsl:variable>
(only to test if the pi can find the file)
Error in PI
javax.xml.transform.TransformerException: com.sun.org.apache.xalan.internal.xsltc.TransletException: com.sun.org.apache.xalan.internal.xsltc.TransletException: java.io.FileNotFoundException:
why is it not possible to use xpath function document() with xalan xslt processor
regards
yes I know thanks using document() will produce a call to the self document.
if we have in the archive other xslt files and use
document('second.xml') we get the same error??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Ralf,
I am not sure what you are trying to do... Can you elaborate please.
You have other XSLT files in the archive and try to call them with document('second.xml') - you mean document('second.xsl') - right?
Why do you not call other XSLT files in your archive by <xsl:include/> in your main XSLT?
Best regards,
Peter
HI Ralf,
with function document() you can bind a document into your target message. The xsl parser will search for the given XPath and - if the document is not available - throw that error. You can put there a relative path like ../folder/file.xml or a absolut path like C://folder/file.xml or even an url like http://server/folder/file.xml.
Your expression
<xsl:variable name="bla" select="document('')/*"></xsl:variable>
is completely wrong, you dont need quotes inside document, the path shouldnt be empty, outside document nothing is allowed and you cant use jokers.
Regards,
Udo
Hi Udo,
I am importing xslt provided by third party for their xml validations. The xslt zip package consists of 1 .xsl which uses following kind of syntax to load 2 xsd and 2 xml files.
<xsl:variable name="codeList" select="document('StdCodeLists2012-1.xsd')"/>
The 2 xsd and xml files are also included in the same zip. When I extract the zip and execute at command line using msxsl kind of tool, it works fine. But when I import this xsl zip package in PI, I get a run-time exception that it cannot find the xsd file in path.
javax.xml.transform.TransformerException: com.sun.org.apache.xalan.internal.xsltc.TransletException: com.sun.org.apache.xalan.internal.xsltc.TransletException: java.io.FileNotFoundException: StdCodeLists2012-1.xsd |
I tried modifying the xsl giving various paths like './StdCodeLists2012-1.xsd', 'archivename/StdCodeLists2012-1.xsd' etc. But the error remains same.
In PI imported archive, it does show a column 'Path'. But there is no way to edit the path.
Anyone faced similar problem? Any solution?
Regards,
Rohit.
Hi Ralf,
the syntax should look like:
<xsl:variable name="bla" select="document(XPath to document)" />
Regards,
Udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Ralf,
I am not sure if document('') works. According to this page http://www.w3schools.com/xsl/func_document.asp you have to specify an object (filename) or node-set.
Maybe it works if you get the name from "DynamicConfiguration" by calling the java function from XSLT mapping. That value you pass to document().
Best regards,
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.