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]

Newbie to XSLT


 
I have a XML document as follows:
 
<instance name="pc">
    <value>John</value>
</instance>
<instance name="location">
    <value>Cube 47</value>
    <size>26 ft</size>
</instance>
<instance type="Association">
    <reference antecedent="pc">
        <value>John</value>
    </reference>
    <reference dependent="location">
        <value>Cube 47</value>
    </reference>
</instance>
 
 
So to find out what size John's cubicle  is,
 
1.  I need to go to the 3rd "instance" node, ( type is "Association" ) 
2.  look up the relationship between John's PC and where his location is ( Cube 47 )
3. Go back to 2nd "instance" node ( name is "location" ), and get the size.
 
Note that there could be multiple PC's and Location's in the same XML document.
 
From my basic knowledge of XSLT, I felt that doing this using a stylesheet would not be possible. So I was thinking of using the DOM tree and using XPath to do this.
 
I want to know from the XSL gurus, if this can be done using a XSL stylesheet. ( Basically, how do we store the "Cube 47" value in a variable, then use it to go back through the document and look for the size for "Cube 47" ??? )
 
 
Thanks
 
Pady

 

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