View Single Post
  #2 (permalink)  
Old May 24th, 2018, 05:17 AM
mhkay's Avatar
mhkay mhkay is offline
Wrox Author
Points: 18,481, Level: 59
Points: 18,481, Level: 59 Points: 18,481, Level: 59 Points: 18,481, Level: 59
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,960
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Firstly, your source element is in a namespace, but you are matching elements in no namespace. Instead of match="DocumentDestinationPartner" you need match="p:DocumentDestinationPartner" where the prefix p is bound to the relevant namespace URI.

Secondly, within the template you should refer to the element currently being processed as ".", not as "//DocumentDestinationPartner". Using "//DocumentDestinationPartner" will search the whole document for elements of that name (in no namespace).

Finally, you need to create the new element in the right namespace. You can do that by writing <DocumentDestinationPartner xmlns="..."> in place of <DocumentDestinationPartner>, or simply by using xsl:copy.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
Reply With Quote
The Following User Says Thank You to mhkay For This Useful Post:
Neal (May 24th, 2018)