Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XSLT document() function not working properly

843834Jun 22 2006 — edited Jun 22 2006
I have this XSLT:

<xsl:copy-of select="document($file1)/employee/address/*"/>

I have this java which is setting the parameter for $file1
 transformer.setParameter("file1",file.getAbsolutePath());
I printed out the value of $file1 in the XSLT style sheet using:

<xsl:message><xsl:value-of select="$file1"/></xsl:message>

The Path it prints out is the correct path, let say its c:\myfile\file1.xml

When it reaches the doument($file1) function, it seems that the path is getting changed.

To give you an example, if $file1 = "c:\myfile\file1.xml" and my XSLT file is located at c:\xsl\myXSl.xsl then the path that document() gets is:


c:\C:\xsl\myfile\file1.xml

This causes the following error to occur:

(The filename, directory name, or volume label syntax is incorrect)


Why is document() inserting the path where the XSL file which it is in into the path of the file I'm trying to open? I am using the Xalan API to transform this XML.

Have anyone seen anything like this before?

Thanks

Al
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 20 2006
Added on Jun 22 2006
1 comment
210 views