View Single Post
  #6 (permalink)  
Old February 11th, 2019, 05:44 PM
Martin Honnen Martin Honnen is offline
Friend of Wrox
Points: 6,676, Level: 34
Points: 6,676, Level: 34 Points: 6,676, Level: 34 Points: 6,676, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2007
Location: Germany
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

If you use an XSLT 1 processor then, as the input elements are in a namespace, in the XSLT you need to declare that and use it to qualify element names:
Code:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:df="urn:OECD:StandardAuditFile-Tax:PT_1.04_01">
...
<xsl:template match="df:Lines">
  <xsl:copy>
    <xsl:apply-templates select="df:CreditLine"/>
    <xsl:apply-templates select="df:DebitLine"/>
  </xsl:copy>
</xsl:template>
If you can use an XSLT 2 or 3 processor like Saxon 9 you can leave the template but simply need to add the attribute
Code:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xpath-default-namespace="urn:OECD:StandardAuditFile-Tax:PT_1.04_01">
Working with XML documents using namespaces is probably the FAQ of XSLT/XPath so make sure you get your hands on a book or tutorial, Mike in his book for sure covers it.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
Reply With Quote