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

Preceding: can't filter my nodes?

Subject: Preceding: can't filter my nodes?
From: "Pollington, Lee (ELSLON)" <lee.pollington@xxxxxxxxxxxxx>
Date: Mon, 11 Sep 2000 21:12:16 +0100
sp_text
Hi, 

I'm trying to get a unique set of nodes. I can't seem to tie the preceding
axis to a filter on a given ID. I have tried filtering that node set into a
variable and then getting a unique list from that, but I am still operating
on the whole node set.(abbreviated XML below)

<xsl:variable name="ats" select="/ROWSET/ROW[R_ID='14144']"/>
<xsl:for-each select="$ats/AT_ID[not(.=preceding::AT_ID)]">
  <at_id><xsl:value-of select="."/></at_id>
</xsl:for-each>

Really I want a node set like this:
//ROW[R_ID='14144'][not(AT_ID=preceding::AT_ID)]

I've tried this and a hundred other combinations, like:
//ROW[not(AT_ID=preceding::AT_ID[parent::R_ID='14144'])]

What I thought was that the //ROW[R_ID='14144']would give a node set with
just this ID and then the preceding would be applied against it. However the
preceding seems to be against all nodes. The desired result is:
<at_id>2</at_id><at_id>5</at_id>
However I think the "5" gets knocked out by a "5" in a node that has
R_ID='3107'.

I am using Saxon & OraXSL.

If you can help me please let me know what's going on, I obviously haven't
quite got my head round this yet.

Thanks in advance
Lee

<?xml version = '1.0'?>
<ROWSET>
   <ROW num="1">
      <H_ID>2001</H_ID>
      <TITLE>Get them out of bed</TITLE>
      <R_ID>3107</R_ID>
      <REF_TEXT>My first reference</REF_TEXT>
      <R_ORDER>1</R_ORDER>
      <AT_ID>1</AT_ID>
 
<R_URL>http://archpedi.ama-assn.org/issues/v153n10/abs/poa8425.html</R_URL>
      <NAME>Medicine</NAME>
      <TEXT>Abstract</TEXT>
      <TYPE>ABST</TYPE>
      <SP_TEXT>Microbiology</SP_TEXT>
   </ROW>
   <ROW num="2">
      <H_ID>2001</H_ID>
      <TITLE>Get them out of bed</TITLE>
      <R_ID>3107</R_ID>
      <REF_TEXT>My first reference</REF_TEXT>
      <R_ORDER>1</R_ORDER>
      <AT_ID>3</AT_ID>
 
<R_URL>http://archpedi.ama-assn.org/issues/v153n10/full/poa8425.html</R_URL>
      <NAME>Medicine</NAME>
      <TEXT>Fulltext</TEXT>
      <TYPE>FULL</TYPE>
      <SP_TEXT>Microbiology</SP_TEXT>
   </ROW>
   <ROW num="3">
      <H_ID>2001</H_ID>
      <TITLE>Get them out of bed</TITLE>
      <R_ID>3107</R_ID>
      <REF_TEXT>My first reference</REF_TEXT>
      <R_ORDER>1</R_ORDER>
      <AT_ID>5</AT_ID>
      <R_URL>http://rubbish.com</R_URL>
      <NAME>Medicine</NAME>
      <TEXT>Fulltext-pay</TEXT>
      <TYPE>FULL</TYPE>
      <SP_TEXT>Microbiology</SP_TEXT>
   </ROW>
   <ROW num="19">
      <H_ID>2001</H_ID>
      <TITLE>Get them out of bed</TITLE>
      <R_ID>14144</R_ID>
      <REF_TEXT>My second reference</REF_TEXT>
      <R_ORDER>2</R_ORDER>
      <AT_ID>2</AT_ID>
 
<R_URL>http://www.sciencemag.org/cgi/content/abstract/289/5484/1550</R_URL>
      <NAME>Medicine</NAME>
      <TEXT>Abstract-reg</TEXT>
      <TYPE>ABST</TYPE>
      <SP_TEXT>Microbiology</SP_TEXT>
   </ROW>
   <ROW num="20">
      <H_ID>2001</H_ID>
      <TITLE>Get them out of bed</TITLE>
      <R_ID>14144</R_ID>
      <REF_TEXT>My second reference</REF_TEXT>
      <R_ORDER>2</R_ORDER>
      <AT_ID>5</AT_ID>
 
<R_URL>http://www.sciencemag.org/cgi/content/full/289/5484/1550</R_URL>
      <NAME>Medicine</NAME>
      <TEXT>Fulltext-pay</TEXT>
      <TYPE>FULL</TYPE>
      <SP_TEXT>Microbiology</SP_TEXT>
   </ROW>
</ROWSET>

  


 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.