xslt - How to place one particular element from an XML array into an FO object? -
xml code:
<eusesummary> <name>eusummary</name> <title1 index="1">proposed</title1> <title1 index="2">proposed</title1> <title1 index="3">proposed</title1> <title1 index="4">standard</title1> <title1 index="5">standard</title1> <title1 index="6">standard</title1> <title1 index="7">compliance</title1> <title1 index="8">cahp</title1> <title2 index="1">design</title2> <title2 index="2">design</title2> <title2 index="3">design</title2> <title2 index="4">design</title2> <title2 index="5">design</title2> <title2 index="6">design</title2> <title2 index="7">margin</title2> <title2 index="8">design</title2> <title3 index="0">end use</title3> <title3 index="1">site (kwh)</title3> <title3 index="2">site (therms)</title3> <title3 index="3">(ktdv/ft²-yr)</title3> <title3 index="4">site (kwh)</title3> <title3 index="5">site (therms)</title3> <title3 index="6">(ktdv/ft²-yr)</title3> <title3 index="7">(ktdv/ft²-yr)</title3> <title3 index="8">(ktdv/ft²-yr)</title3> <enduse1 index="0">space heating</enduse1> <enduse1 index="1">246</enduse1> <enduse1 index="2">286.5</enduse1> <enduse1 index="3">21.04</enduse1> <enduse1 index="4">255</enduse1> <enduse1 index="5">296.8</enduse1> <enduse1 index="6">21.80</enduse1> <enduse1 index="7">0.76</enduse1> <enduse1 index="8">23.18</enduse1> </eusesummary>
a little piece of xsl code pasted below. defining 1 cell within table. want grab enduse values @ position index=8 , place in remaining cells of table. now, need clarification how select specific value object of xml:
<fo:table-row xsl:use-attribute-sets="row"> <fo:table-cell xsl:use-attribute-sets="datacell"> <fo:block> <xsl:value-of select="/sddxml/model/proj/eusesummary/enduse1/*[@index=8]"/> </fo:block> </fo:table-cell>
what i'm expecting homecoming cell value (within larger table haven't provided code for) of: 23.18
thanks,
your current xpath ends in this...
enduse1/*[@index=8]
but /*
means looking kid element under enduse1 of there none! there text node, not element.
try instead:
<xsl:value-of select="/sddxml/model/proj/eusesummary/enduse1[@index=8]"/>
xml xslt xsl-fo
No comments:
Post a Comment