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 August 24th, 2006, 10:01 AM
Registered User
 
Join Date: Jun 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using a linkdoc to exclude rows

I am using a linkdoc to exclude certain fields from output within a template. Now I have a requirement to exclude certain rows if a value exists in the external xml. I would really like to exclude at the "for-each", and this is one of the attempts I have made (to no avail):

<xsl:for-each select="body/row[not($linkDoc/*/GROUP[@NAME='COSTCENTRE']/VALUE[@KEY=field2])]">

And a section from the linkdoc:

<Project_LOOKUP>
    <GROUP NAME="COSTCENTRE">
        <VALUE KEY="TEST">1</VALUE>
    </GROUP>

Xml:

<root>
    <body>
    <row>
            <field1>1</field1>
            <field2>DATE</field2>
        </row>
        <row>
            <field1>2</field1>
            <field2>DAVE</field2>
        </row>
        <row>
            <field1>2</field1>
            <field2>TEST</field2>
        </row>
    </body>
</root>

I want to ignore:

<row>
    <field1>2</field1>
    <field2>TEST</field2>
</row>

because TEST exists in the Linkdoc.

Tried different combinations, but I cannot get the syntax right.

Any help appreciated.

 
Old August 24th, 2006, 11:19 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Change field2 to current()/field2.

You need to tell it that field2 is in your original document, not deep within the linkdoc.

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
DateDiff to exclude weekends and holidays dbartelt Access 2 April 12th, 2008 05:14 PM
Exclude Namespace Atribute bonekrusher XSLT 3 May 4th, 2007 08:18 AM
Exclude Nodes seanhaggerty XSLT 1 February 3rd, 2005 06:00 AM
Exclude Certain Forms Ben Horne Access VBA 11 March 16th, 2004 03:06 PM
Exclude a field from refreshing Mimi Javascript How-To 2 August 25th, 2003 05:45 AM





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