Subject: [xsl] pointer to a node/nodeset? From: KRokicki@xxxxxxxxxxxxx Date: Thu, 15 Aug 2002 17:36:17 -0400 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] How to handle XML with and wi, gerry . king | Thread | RE: [xsl] pointer to a node/nodeset, Hunsberger, Peter |
Re: [xsl] FO:Text Alignment in a Ta, David Tolpin | Date | [xsl] Inserting softHyphens in FO, Danny Vint |
Month |