View Single Post
  #3 (permalink)  
Old March 12th, 2007, 06:24 AM
mhkay's Avatar
mhkay mhkay is offline
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

When you write

<xsl:template match="d2LogicalModel">

you are matching nodes whose name is (local-part="d2LogicalModel, namespace=null). But the node in your source document has (local-part="d2LogicalModel", namespace="http://datex2.eu/schema/1_0/1_0"). To match this node you need to write

<xsl:template match="s:d2LogicalModel">

and add xmlns:s="http://datex2.eu/schema/1_0/1_0" to your xsl:stylesheet. Similarly all the other unqualified element names in match and select attributes need to be prefixed in the same way.

Alternatively since you are using XSLT 2.0 you can add

xpath-default-namespace="http://datex2.eu/schema/1_0/1_0"

to the xsl:stylesheet element.

I'm not sure why the link you reference didn't help you since it describes exactly this problem, and its solution.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote