Error in output when xmlns attribute is present

View: New views
2 Messages — Rating Filter:   Alert me  

Error in output when xmlns attribute is present

by Gustavo de Sá Carvalho Honorato :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

I'm having some problems using Xalan to make XSLT using JAXP Java API. When xmlns attribute is not present in root element of the input xml, the output is fine. When xmlns is present, Xalan is generating an empty output. Is there any issue regarding this? I've been searching all over the documentation and I could not find anything.

Thanks in advance,
Gustavo Honorato

Re: Error in output when xmlns attribute is present

by keshlam :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The xmlns attribute sets the default namespace. XSLT is namespace-sensitive; to match namespace-qualified elements and attributes you must match the namespaces as well (which means using prefixes in your XSLT even though you used the default in the instance document, since XSLT 1.0 has no ability to specify a default namespace for its match/select patterns).


______________________________________
"... Three things see no end: A loop with exit code done wrong,
A semaphore untested, And the change that comes along. ..."
 -- "Threes" Rev 1.1 - Duane Elms / Leslie Fish (
http://www.ovff.org/pegasus/songs/threes-rev-11.html)