This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: The notion of inheritance - An implementation


>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@melvaig.co.uk

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]