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

pointer to a node/nodeset?

Subject: pointer to a node/nodeset?
From: KRokicki@xxxxxxxxxxxxx
Date: Thu, 15 Aug 2002 17:36:17 -0400
node nodeset
So basically, I have a xml structure like this:

<resultset>

  <metadata>
    <path name="DONOR">   <!--  #1 -->
      <property name="label">Donor</property>
      <path name="DONOR_ID">
        <property name="label">Donor Id</property>
        <property name="link">DONOR</property>
      </path>
      <path name="DOCUMENT">
        <property name="label">Document</property>
        <path name="URL"/>
      </path>
    </path>
  </metadata>

  <result>
    <result-item name="DONOR">
      <attr name="DONOR_ID">100</attr>   <!-- #2 -->
      <ref name="DOCUMENT">
        <attr name="URL"></attr>
      </ref>
    </result-item>
  </result>

</resultset>

As I traverse the <result> I need access to the appropriate meta data.
Currently, if I'm at <attr name="DONOR_ID"> (node #2) and I want its label,
I build a string path by going through the ancestor-or-self axis. So I end
up with "DONOR.DONOR_ID" and then I traverse the metadata looking for the
node with that path.
This would be a lot more efficient if I moved through the metadata at the
same time as the result.. is there a way to maintain a pointer to the
appropriate metadata node (maybe using a tree fragment/nodeset? cant figure
those things out) and pass it around with xsl:param while I'm traversing
the <result>?
So I'm at node #2 I'd have a variable $metanode that points to #1 somehow.
Then I'd know to go to its child with name "DONOR_ID",  and that would be
the next $metanode.
Or can anyone see an even nicer way of doing this, with keys or something
fancy?  :)

Thanks much,
Konrad Rokicki


==========================================================================
==  The information contained in this email message is intended only for
use by the      ==
==  recipient(s) to which it is addressed.  This message may be privileged
and            ==
==  confidential and protected from disclosure.  If the reader of this
message is not        ==
==  the intended recipient or an agent responsible for delivering it to the
intended           ==
==  recipient,  you are hereby notified that you have received this
document in error       ==
==  and that any review, retransmission, dissemination, distribution,
copying or other     ==
==  use of, or taking of any action in reliance upon this information, is
strictly                       ==
==  prohibited.  If you have received this communication in error, please
contact the       ==
==  sender and delete the material from your computer.
==
==========================================================================



 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.