Matthew J. Graham wrote:
So it looks as though at the point where <xsl:copy-of select="/form/document/*/> is called in the pipeline, all unused namespaces have their content missing. Is this a bug in the SAX parser?

Hi Matthew,

As I understand this, it is not a Saxon bug. Imagine that the XSLT stylesheet input is a XUpdate statement, for instance:

<xu:value-of select="/ns:a/ns:b"
   xmlns:xu="http://www.xmldb.org/xupdate"/>

This statement is not valid, as the "ns" prefix is not declared in this document. Now you write a stylesheet that embeds this statement in an XUpdate program that happens to declare the "ns" namespace:

<xu:modifications xmlns:ns="..."
        xmlns:xu="http://www.xmldb.org/xupdate xsl:version="2.0">
    <xsl:copy-of select="/*"/>
</xu:modifications>

In this case, the Saxon will undeclared the "ns" namespace on the <xu:value-of> element as that namespace was not declared in the included element. So the generated program would not be valid, as expected. If the XSLT engine had not undeclared the "ns" namespace, the resulting XUpdate program would have been valid from the perspective of the XUpdate engine, but might have led to unexpected results.

Now, undeclaring namespaces is not supported in XML 1.0 (only XML 1.1) and it looks like a number of engines (including XML parsers and XML databases) only support XML 1.0. We have talked about this issue with Erik this morning, and to solve this problem Erik will modify the serializers and database processors to remove those namespace undeclarations. Also see:

http://sourceforge.net/tracker/index.php?func=detail&aid=1049559&group_id=116683&atid=675663

Alex


------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ orbeon-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/orbeon-user

Reply via email to