Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
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
 
Old February 13th, 2004, 03:42 PM
Registered User
 
Join Date: Aug 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to demiwolf
Default Exact Match problem

Here's the XML:

<repository>
   <so>
    <type>doc</type>
    <author>Melnik, Grigori</author>
    <author>Read, Kristopher</author>
    <title>Customer Collaboration in DSDM Projects</title>
        ...
   </so>
</repository>

Here's the XSL:

<xsl:template match = "/doc[.=$repository/so/type/.]">
<repository>
    <xsl:for-each select="repository/so">
        <p/><xsl:copy-of select="author/."/>
                <br/><b><xsl:value-of select = "title"/></b>
          <p/>
        </xsl:for-each>
</repository>
</xsl:template>

And I'm trying to find all elements which only have the type "doc" which is an attempt at an exact match. However, it either brings back everything, or nothing. I'm not sure if I'm using the <xsl:template match = ".."> properly.

Help ASAP would be much appreciated.

-Demi.
 
Old February 14th, 2004, 10:28 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

If your template matches so[type = 'doc'] you'll be better placed to then output all the authors and the title. It does depend on how you select the nodes, not just how you match them.

--

Joe





Similar Threads
Thread Thread Starter Forum Replies Last Post
Exact year month and days mankoti_mankoti2000 Access 1 July 3rd, 2008 10:05 AM
STRING EXACT MATCH ricespn Beginning VB 6 6 November 12th, 2007 01:18 PM
exact mb we can upload??.. asudhakar C# 1 April 4th, 2007 07:31 AM
template match doesnt match the required node Tomi XSLT 2 March 12th, 2007 06:24 AM





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