Subject: Re: The notion of inheritance - An implementation
From: tcn@xxxxxxxxxxxxx (Trevor Nash)
Date: Sat, 29 Sep 2001 18:54:14 GMT
|
>The solution works well. The only problem I can't solve is how to get rid of
>the namespace declaration
>xmlns:ooxml="http://www.barcoview.com/ooxml/inheritance" in the out.xml
>result
>file. I think there is no solution. Has anyone any suggestions?
>
You are using xsl:copy - the problem with this is that it copies all
the namespace nodes as well as the element node, so these end up in
the output regardless of exclude-result-prefixes. If you use
xsl:element instead, then you will only get the namespace declarations
that are really needed. I think this trick is explained in Mike Kay's
book somewhere, but I could not put my finger on it when I looked. Do
make sure you understand the bit about namespaces at the end of the
'usage' section of name() (top of page 521 in the 2nd edition).
Writing
<xsl:element name="{name()}">
will get you into trouble if the prefixes are not consistent between
input document and stylesheet.
Regards,
Trevor Nash
--
Traditional training & distance learning,
Consultancy by email
Melvaig Software Engineering Limited
voice: +44 (0) 1445 771 271
email: tcn@xxxxxxxxxxxxx
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|