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

RE: Filtering on attributes

Subject: RE: Filtering on attributes
From: "SHEIKH Sajjad" <Sajjad.SHEIKH@xxxxxxxxxxx>
Date: Thu, 20 Nov 2003 14:36:12 +0100
attributes of partnership
Flemming, thanks for the response.

Unfortunately, It does not work.

I can only suppose for document function that it is copying the values and pasting it.  Perhaps that is the reason it does not recognise category at all.

What do you think?

-----Original Message-----
From: Flemming Jønsson [mailto:flj@xxxxxxxxxxxxx] 
Sent: 20 November 2003 14:24
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Cc: SHEIKH Sajjad
Subject: RE:  Filtering on attributes


Hello,

> Is it possible to filter the data on attribute value before
> displaying? For example, it displays the data from those 
> nodes where 'scope of dessimination' is EFSA. 
> 
> Any suggestion?

Just add the Xpath query after the variable containing the XML from the document.

> 
> Style sheet
> -----------
> 
>  <xsl:template match="/">
>   <xsl:for-each
> select="document('multiple_input1.xml')/someURIs/file">
>    <xsl:variable name="copy_current_file" 
> select="document(string(.))"/>
>    <xsl:value-of select="$copy_current_file"/>
>    <br/><br/>
>   </xsl:for-each>
>  </xsl:template>
> </xsl:stylesheet>

<xsl:value-of select="$copy_current_file//category"/>

Will get you all the category-nodes. So all you need to do is construct the Xpath to retrieve the nodes with attribute values you need.

For writing Xpaths this guide is a good intro (se the list to the left): http://www.zvon.org/xxl/XPathTutorial/General/examples.html

Cheers,
Flemming

______________________________________________________________
This message has been scanned for all viruses by BTnet VirusScreen. The service is delivered in partnership with MessageLabs.

This service does not scan any password protected or encrypted attachments.  

If you are interested in finding out more about the service, please visit our website at http://www.btignite.com/internetservices/btnet/products_virusscreen.htm
==============================================================

 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.