Newbie XSLT question
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 3
- Joined: Tue Jan 29, 2008 4:47 pm
Newbie XSLT question
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
-
- Posts: 89
- Joined: Mon Mar 06, 2006 10:13 pm
Re: Newbie XSLT question
Could we see the context in which it is used? Did you need to select all of the @Tier nodes?
It might take 2 steps. I think it'd be something closer to:
select = "Intro[@Tier != '' and Purchase/@APR!='None']/@Tier[not( (Purchase/@APR != //Goto[@Tier = *]/Purchase/@APR))]
It might take 2 steps. I think it'd be something closer to:
select = "Intro[@Tier != '' and Purchase/@APR!='None']/@Tier[not( (Purchase/@APR != //Goto[@Tier = *]/Purchase/@APR))]
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service