Subject: [xsl] Streamlining XSL and transform performance (how does it actually work?) From: Julian Voelcker <asp@xxxxxxx> Date: Fri, 19 Mar 2004 10:00:07 GMT |
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[@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[@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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] getting rid of doctype de, Paul Tremblay | Thread | Re: [xsl] Streamlining XSL and tran, Wendell Piez |
Re: [xsl] Newbie - trying to extrac, Julian Voelcker | Date | RE: [xsl] breaking up a big xml fil, Ragulf Pickaxe |
Month |