RE: [xsl] XSL: parsing

Subject: RE: [xsl] XSL: parsing
From: "Sathasivam, Elayaraja" <elayaraja.sathasivam@xxxxxxxxxxxxx>
Date: Tue, 12 Aug 2008 15:09:38 +0530
Thanks for your mail.

Find the details as follows,

$conf:  <xsl:variable name="conf" select="document('bgh_config.xml')"/>
No issues, just loading the input xml file.
$TZ : TZ003
$TM: TZAOP

Expected output: FIXED
Actual Output: Debug < No output of @brk ???? >

$xalan -o Output.txt Index.xml File.xsl

Index.xml
*********
<?xml version="1.0" encoding="UTF-8"?>
<Envelope>
  <Part File='DET184.5371.0.xml' LinkType='REL' DocType='DET'
Format='XML'/>
</Envelope>


File.xsl
**********
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:date="http://exslt.org/dates-and-times";
exclude-result-prefixes="xsl">
<xsl:output method="text" media-type="text/plain" />

<xsl:variable name="conf" select="document('bgh_config.xml')"/>

<xsl:template match="/" >
    <xsl:for-each
select="document(/Envelope/Part/@File)/Document/CallDetails/Call">
        <xsl:variable name="TZ" select="XCD/@TZ"/>
        <xsl:variable name="TM" select="XCD/@TM"/>
	<xsl:choose>
		<xsl:when
test="$conf/Configuration/BreakdownList/BreakdownMatrix/BrkSection[@tm=$
TM]/BrkCode[tz=$TZ]"> Debug
		   <xsl:value-of select="@brk"/>
		</xsl:when>
		<xsl:otherwise> Otherwise </xsl:otherwise>
	</xsl:choose>
    </xsl:for-each>
</xsl:template>

</xsl:stylesheet>


DET184.5371.0.xml
*****************
<?xml version="1.0" encoding="UTF-8"?>
<Document>
	<CallDetails>
		<Call>

		  <XCD DV="40" Id="26231918"  UM="" DC="0.000000"
OAmt="0.000" DAmt="1.000" CC="EGP" TM="TZAOP" SN="RTEL" TT="ETP01WOP01"
TZ="TZ003" RT="BASE" CTI="0" CT="1" RTON="1" APN="111635766" NI="H"
NN="EGYEM" ANP="APN" URP="1" TTR="0.000" DES="NV" DZP="gprse"
CGI="60203" OPN="etisalat" UV="544.000000" DLV="565.000000" RQSP="0"
RQSR="0" RQSD="0" RQSPT="0" RQSMT="0" NQSP="0" NQSR="0" NQSD="0"
NQSPT="0" NQSMT="0" DAV="1109.000000" DAUM="GPRS" CQV="544.000000"
CQUM="Byte" SP="GSP" />
		</Call>
	</CallDetails>
</Document>


bgh_config.xml
**************
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
	<BreakdownList>
		<BreakdownMatrix>
			<BrkSection tm="TZAOP" comment="T-Mobile
Zakelijk Optimaal (+variants) and Data Connect, Special Edition
rateplans and Team Totaal (Dura)">
				<BrkCode brk="FIXED" comment="Vaste
nummers: fixed + WAP">
					<tz>TZ001</tz>
					<tz>TZ003</tz>
				</BrkCode>
			</BrkSection>
		</BreakdownMatrix>
	</BreakdownList>
</Configuration>


Regards,
Raja
_________________________________________________________________

Current Thread