This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

pointer to a 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]