I am trying to do a sort of mail merge for creating wills and have been
advised that an XSL transform is the best route to go down.
The data is in XML format and I am just starting to convert the massive
(200+ pages) html template into an XSLT document.
The XML data is formatted as follows:
<AnswerSet title = "Test File">
<Answer name = "ABGRbefore">
<RptValue>
<TFValue>true</TFValue>
<TFValue>false</TFValue>
<TFValue>false</TFValue>
</RptValue>
</Answer>
<Answer name = "Female">
<TFValue>false</TFValue>
</Answer>
<Answer name = "ticdesc">
<TextValue>my collection of teapots</TextValue>
</Answer>
</AnswerSet>
There are around 3,000 elements in the XML file in total.
I have so far worked out that at a simplistic level I can use the
following XSL for extracting the data:
<xsl:for-each select="AnswerSet/Answer[(_at_)name='Female']">
<xsl:if test="TFValue = 'true'">
<p>the user is female.</p>
</xsl:if>
<xsl:if test="TFValue = 'false'">
<p>the user is male.</p>
</xsl:if>
</xsl:for-each>
<xsl:for-each select="AnswerSet/Answer[(_at_)name='ticdesc']">
<p><xsl:value-of select="TextValue"/></p>
</xsl:for-each>
Is this the most efficient way of extracting the data?
Each time I want to extract a value, is the Processor having to loop
through the XML file or does it do it in a single pass?
I could break the template down into more manageable chunks, but am not
sue how to import one template into another.
Before I embark on a massive conversion process, I'm just wondering if
I am going down the right route.
Any pointers would be appreciated.
--
Cheers,
Julian Voelcker
United Kingdom
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list