Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 9th, 2007, 07:47 AM
Authorized User
 
Join Date: Jul 2006
Location: Valencia, Valencia, Spain.
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default template m,atch doesnt match

Hello,

I have a problem with a template that doesnt match the desired node, in fact it doesn`t match any node.

This is my xml file:

<?xml version="1.0" encoding="UTF-8"?>
<d2LogicalModel xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:d2lm="D2LogicalModel" xmlns="http://datex2.eu/schema/1_0/1_0" modelBaseVersion="1.0" xsi:schemaLocation="http://datex2.eu/schema/1_0/1_0 C:\DOCUME~1\totres\Escritorio\d1d2transf\DATEXI~1\ DATEXIISchema_1_0_1_0\DATEXIISchema_1_0_1_0.xsd">
    <exchange>
        <supplierIdentification>
            <country>es</country>
            <nationalIdentifier>es001</nationalIdentifier>
        </supplierIdentification>
    </exchange>
</d2LogicalModel>


And this is my xsl file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                                                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                              xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xsl:param name="filtro"/>
    <!--
    Template Principal
    -->
    <xsl:template match="/">
        <xsl:apply-templates select="d2LogicalModel"/>

    </xsl:template>
    <!--
    Template
    -->
    <xsl:template match="d2LogicalModel">

             foo
    </xsl:template>
</xsl:stylesheet>

The template "d2LogicalModel" is never executed, I think there is a problem with the xsl file headers but I can not figure out what I'm doing wrong.

Any ideas?

Thanks very much for the help


  #2 (permalink)  
Old March 9th, 2007, 07:56 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Please read the first post in this forum and follow the link in the last sentence about default namespaces.

--

Joe (Microsoft MVP - XML)


Similar Threads
Thread Thread Starter Forum Replies Last Post
Param in template match=" " iceandrews XSLT 2 May 7th, 2008 07:37 AM
value-of inside template match RoeZ XSLT 5 April 17th, 2008 12:09 PM
template match doesnt match the required node Tomi XSLT 2 March 12th, 2007 06:24 AM
import / call / template match Kabe XSLT 3 February 26th, 2004 11:31 AM
help with xsl template match enT XSLT 9 September 24th, 2003 06:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.