This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Copy namespace definition to the result tree using xslt
- To: xsl-list at lists dot mulberrytech dot com
- Subject: RE: [xsl] Copy namespace definition to the result tree using xslt
- From: Kishorerc at Synapta dot com
- Date: Tue, 13 Mar 2001 02:46:38 -0800
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Mike,
Is there no way I can output the element as
<xsd:schema xmlns:xsd="http://www.w3.org/1999/XMLSchema">
instead of just <xsd:schema>.
I understand that it is redundant and hence it does not output the xmlns
attribute. But it is required for the application I am working on. I also
tried adding the xmlns attribute using <xsl:attribute> element but even the
the transformer does not output the xmlns attribute. It seems that xmlns is
a reserved attribute or QName and hence the transformer ignores it. Any
ideas???
Thanks
Kishore
-----Original Message-----
From: Michael Kay [mailto:mhkay@iclway.co.uk]
Sent: Tuesday, March 13, 2001 2:00 AM
To: xsl-list@lists.mulberrytech.com
Subject: RE: [xsl] Copy namespace definition to the result tree using
xslt
> I am not able to output the namespace definition to the result tree.
>
> The EXPECTED OUTPUT file from the XSLT file should look like this:
> <?xml version="1.0" encoding="UTF-8"?>
> <transactions xmlns:xsd="http://www.w3.org/1999/XMLSchema">
> <mytesting>
> <xsd:schema
> xmlns:xsd="http://www.w3.org/1999/XMLSchema">
> <-- problem line
I don't see anything in your XSLT that outputs the <transactions> element,
but never mind. The xmlns:xsd declaration on your <xsd:schema> element is
completely redundant according to the XPath data model (you get the same
XPath tree whether it is there or not) and therefore an XSLT processor will
not normally generate it.
Mike Kay
Software AG
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list