Subject: [xsl] Matching values in the XML before output! From: "Simpson, George" <GeorgeS@xxxxxxxxxxxxxxxxx> Date: Thu, 18 Apr 2002 10:30:28 +0100 |
<SORRY LAST MESSAGE HAD NO SUBJECT LINE!> Hi to the forum, Firstly may I thank all that might be able to assist me with this problem I am currently having, Thanks! What I am trying to do is get the results that match each common node of <icc-point-number> e.g. when I query the XPath icc/icc-phases/icc-points/point-number to output point-number 1, I then want it to match the XPath iso-point-details/de-isolation-history/icc-point-history-oid to the point-number e.g. this being the value 29 where the <icc-point-number> matches on this case 196. The XML :- <report-root> <icc> <icc-phases> <icc-points> <point-number>1</point-number> <icc-point-oid>196</icc-point-oid> </icc-points> <icc-points> <point-number>2</point-number> <icc-point-oid>197</icc-point-oid> </icc-points> </icc-phases> </icc> <iso-point-details> <isolation-history> <icc-point-history-oid>15</icc-point-history-oid> <icc-point-oid>197</icc-point-oid> </isolation-history> <isolation-history> <icc-point-history-oid>29</icc-point-history-oid> <icc-point-oid>196</icc-point-oid> </Isolation-history> </iso-point-details> </report-root> The XSL :- <xsl:for-each select="icc/icc-phases/icc-points"> <fo:table-cell> <fo:block><xsl:value-of select="point-number"/></fo:block> </fo:table-cell> <fo:table-cell> <fo:block><xsl:value-of select="../../../iso-point-details/de-isolation-history/icc-point-history-oid"/></fo:block> </fo:table-cell> </xsl:for-each> Presently the output is POINT NUMBER = 1 - ISOLATION HISTORY OID = 15 POINT NUMBER = 2 - ISOLATION HISTORY OID = 15 Required output POINT NUMBER = 1 ISOLATION HISTORY OID = 29 POINT NUMBER = 2 ISOLATION HISTORY OID = 15 Presently the XML is generated by castor and I really don't want to touch it! I am sure that XSL can do what I am aiming at (hopefully) :) Again any help that anyone may be able to assist on the matter is greatly appreciated.... Kind regards, George Simpson PS - This is my first venture into XML, XSL and I have found this site along with http://www.dpawson.co.uk/ excellent sources of info! Well done guyz and THANKS! XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] replacing images with alt, Michael Kay | Thread | RE: [xsl] Matching values in the XM, Jarno . Elovirta |
RE: [xsl] replacing images with alt, Michael Kay | Date | [xsl] check if content value begins, Jarkko . Moilanen |
Month |