[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: select nodes with an attribute not contained withi

Subject: Re: select nodes with an attribute not contained within an excluding attribute
From: Mukul Gandhi <mukulgw3@xxxxxxxxx>
Date: Wed, 8 Oct 2003 05:22:19 -0700 (PDT)
xml select nodes
Hi Alan,
Please try the XSL --

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0"
encoding="UTF-8" indent="yes"/>
	
  <xsl:template match="/doc">
    <xsl:for-each select="//*">
       <xsl:if test="@id and
not(parent::*/@TemplateId)">
         <xsl:copy-of select="." />
       </xsl:if>
    </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>

Regards,
Mukul

--- Alan Flaherty <alan@xxxxxxxxxxxxxxxxxx> wrote:
> Hi List,
> 
> I have the following sample XML case:
> <doc>
> 	<paragraph id="Intro">
> 
> 	</paragraph>
> 	<table>
> 		<row>
> 			<chunk id="HeaderText"/>
> 		</row>
> 
> 		<row TemplateId="TemplatedRow">
> 			Item1: <chunk id="Item1"/> Item2: <chunk
> id="Item2"/>
> 		</row>
> 
> 		<row>
> 			<chunk id="FooterText"/>
> 		</row>
> 	</table>
> 	<paragraph TemplateId="Quotes">
> 		<chunk id="QuoteHeader"/><newline/>
> 		<chunk id="QuoteBody"/>
> 	</paragraph>
> 	<paragraph id="Finish">
> 
> 	</paragraph>
> </doc>
> 
> I need to be able to *Any* elements with an Id
> attribute not contained
> within *any* element with a TemplateId Attribute,
> templated items are
> reported on separately.
> 
> The Idea is that the TemplateId'd elements are bound
> to a Data Source but
> the others are not, at times it's easier to Load up
> the document and gather
> all the non template bound Id's using the processing
> code just before I bind
> the data to the documents rather than having to do
> this manually. There are
> quite a few documents and this will make it all a
> little bit faster to do.
> 
> Regards,
> 
> Alan
> 
> 
> 
>  XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.