Subject: [xsl] using key with imported xml files From: subbu@xxxxxxxxxxxx Date: Wed, 04 Dec 2002 11:41:00 +0000 |
Hello, I have a problem. I am trying to refer another reference xml file from the xsl stylesheet. for example, My xml is Main.xml, Xsl: Main.xsl and reference xml: data-reference.xml while I am processing the Main.xml file, i want to refer data-reference.xml, which has data structured somewhat similar to a hastable like below.. <Data-Set> <Data reference-id = "12543"> <value>IBM</value> </Data> .. more of <Data> elements.. </Data-Set> If this were in the my Main.xml, to get hold of value element with reference-id attribute, I would have used the kes in the following way.. <xsl:key match="/Data-set/Data" name="reference-value" use="reference-id"/> and then in the template body , I would have called the key like.. <xsl:value-of select="key('reference-value','12543')/value"/> However, this is in a different file and i have to get this using document(). and use the key functionality as above. The only way i can do is the normal way as in.. <xsl:value-of select="document('data-reference.xml')/Data-Set/Data[@reference- id = '12543']/value"/> am I normal in doing the above way or can I someway use the keys to situation like this?? Thanks -------------------------------------------------------------- Sent with "Me-Mail", Boltblue's FREE mobile messaging service. http://www.boltblue.com XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] debugging techniques [was, DPawson | Thread | Re: [xsl] using key with imported x, David Carlisle |
RE: [xsl] debugging techniques [was, DPawson | Date | RE: [xsl] using key with imported x, TSchutzerWeissmann |
Month |