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

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:
<xsl:stylesheet version="1.0" xmlns:xsl="" xmlns:df="urn:OECD:StandardAuditFile-Tax:PT_1.04_01">
<xsl:template match="df:Lines">
    <xsl:apply-templates select="df:CreditLine"/>
    <xsl:apply-templates select="df:DebitLine"/>
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
<xsl:stylesheet version="1.0" xmlns:xsl="" 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