Oxygen XML Editor
 
[XML-DEV Mailing List Archive Home] [By Thread] [By Date]

RE: [xml-dev] How to get XPath in a XSLT shylesheet


  • From: "Michael Kay" <mike@...>
  • To: "'David Carlisle'" <davidc@...>
  • Date: Tue, 9 Jan 2007 11:44:46 -0000

> although actually along a sibling axis you have quite hard to 
> "accidentally" get multiple prefixes.

Not really. You just have to do something like this:

<xsl:template match="vc:changes"
xmlns:vc="http://acme.com/ns/version-control">
  <vc:changes>
    <xsl:copy-of select="*"/>
    <vc:change date="{current-date()}">Changed by stylesheet XYZ</vc:change>
  </vc:changes>
</xsl:template>

Existing elements will retain the prefix in the original document, the new
element will have the prefix used by the stylesheet author. Once you get two
sub-communities who prefer different prefixes (as with "xs" and "xsd")
you're going to end up with documents that mix the two.

Michael Kay
http://www.saxonica.com/




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
 
© 2002-2008 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy
This website was created & generated with <oXygen/> XML Editor