[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Matching values in the XML before output!

Subject: Matching values in the XML before output!
From: "Simpson, George" <GeorgeS@xxxxxxxxxxxxxxxxx>
Date: Thu, 18 Apr 2002 10:30:28 +0100
george simpson simpson studio
<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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.