Newbie XSLT question
Posted: Tue Jan 29, 2008 5:12 pm
Hello, I'm new with XSLT and I got asigned to do an xslt spreedsheet at work but I got stuck in this point:
XML:
I have to select the Intro/@Tier that applies with:
IF<INTRO;PURCHASE;APR> != “None†or is NOT equal to <GOTO;PURCHASE;APR> but from the same Tier.
Example <INTRO[@Tier = 1];PURCHASE;APR> != "None" and <GOTO[@Tier = 1];PURCHASE;APR>
This is what I got so far:
This select doesn't work because the second * is selecting "any Tier" and not the same Tier that the first * . I can not think of a way to compare differents nodes from the same Tier.
BTW, I can't change the XML, I have to work with that one
Sorry for my english.
Thanks
XML:
Code: Select all
<Intro BillingCycles="12 Billing Cycles"
FlipDate="None"
Tier="1">
Purchase=0.00:F
BT=0.00:F
CC=0.00:F
BillingCycles=12 Billing Cycles
FlipDate=None
<Purchase APR="0.00" />
<BT APR="0.00" />
</Intro>
<Intro BillingCycles="12 Billing Cycles"
FlipDate="None"
Tier="2">
Purchase=0.00:F
BT=0.00:F
CC=0.00:F
BillingCycles=12 Billing Cycles
FlipDate=None
<Purchase APR="0.00" />
<BT APR="0.00" />
</Intro>
<Intro BillingCycles="12 Billing Cycles"
FlipDate="None"
Tier="3">
Purchase=0.00:F
BT=0.00:F
CC=0.00:F
BillingCycles=12 Billing Cycles
FlipDate=None
<Purchase APR="0.00" />
<BT APR="0.00" />
</Intro>
<Goto BillingCycles="None"
FlipDate="None"
Tier="1">
Purchase=14.24:V
BT=14.24:V
CC=14.24:V
BillingCycles=None
FlipDate=None
<Purchase APR="14.24" />
<BT APR="14.24" />
</Goto>
<Goto BillingCycles="None"
FlipDate="None"
Tier="2">
Purchase=14.24:V
BT=14.24:V
CC=14.24:V
BillingCycles=None
FlipDate=None
<Purchase APR="14.24" />
<BT APR="14.24" />
</Goto>
<Goto BillingCycles="None"
FlipDate="None"
Tier="3">
Purchase=14.24:V
BT=14.24:V
CC=14.24:V
BillingCycles=None
FlipDate=None
<Purchase APR="14.24" />
<BT APR="14.24" />
</Goto>
IF<INTRO;PURCHASE;APR> != “None†or is NOT equal to <GOTO;PURCHASE;APR> but from the same Tier.
Example <INTRO[@Tier = 1];PURCHASE;APR> != "None" and <GOTO[@Tier = 1];PURCHASE;APR>
This is what I got so far:
Code: Select all
<xsl:variable name="IntroTiers" select="Intro[@Tier = * and Purchase/@APR!='None' and not(Purchase/@APR != /Goto[@Tier = *]/Purchase/@APR) ]/@Tier" />
BTW, I can't change the XML, I have to work with that one

Sorry for my english.
Thanks