XSLT transformation works only if namespace data is removed
Posted: Fri Jun 22, 2007 7:58 am
Hi--I have a problem that I hope someone can give me some help with. I'm sure that I must be missing something very simple, but despite weeks of research and debugging, I can't figure out what it is.
I've built a standalone Java application that takes input from a window, then uses that data to create a schema-based XML file. In addition, the program can read such an XML file, apply an XSLT transformation, and write the resulting output to another file.
Here's the behavior that I observe:
* When I transform an appropriate XML document with my XSLT file (which, remember, is namespace-aware) using the oXygen development environment, I get the output text that I want.
* When I transform the same document using the same XSLT file from within my Java application (using methods from the appropriate javax.xml.transform... packages), I get an empty output.
* I then copy my XSLT file and take all of the namespace information out of the copy. When I transform the same document using this namespace-blind but otherwise equivalent XSLT file, I again get the output text that I want.
To summarize, my question is this: Why does the namespace-aware XSLT file work when applied on its own (using Xalan or Saxon) but not when the same XSLT file is used to process the same source XML file within my standalone Java application?
I can post program details if needed. Thank you for your help.
I've built a standalone Java application that takes input from a window, then uses that data to create a schema-based XML file. In addition, the program can read such an XML file, apply an XSLT transformation, and write the resulting output to another file.
Here's the behavior that I observe:
* When I transform an appropriate XML document with my XSLT file (which, remember, is namespace-aware) using the oXygen development environment, I get the output text that I want.
* When I transform the same document using the same XSLT file from within my Java application (using methods from the appropriate javax.xml.transform... packages), I get an empty output.
* I then copy my XSLT file and take all of the namespace information out of the copy. When I transform the same document using this namespace-blind but otherwise equivalent XSLT file, I again get the output text that I want.
To summarize, my question is this: Why does the namespace-aware XSLT file work when applied on its own (using Xalan or Saxon) but not when the same XSLT file is used to process the same source XML file within my standalone Java application?
I can post program details if needed. Thank you for your help.