Re: [xsl] xpath query

Subject: Re: [xsl] xpath query
From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx>
Date: Sun, 20 Jan 2008 16:05:07 +0000
>>>>> "Sean" == Sean Tiley <sean.tiley@xxxxxxxxx> writes:

    Sean> I guess fundamentally I do not understand how the processor
    Sean> applies the stylesheet templates to the xml document.

    Sean> Say I have the followng XML

    Sean> <root> <file name=""> <error line="4"
    Sean> message="Message1" severity="2"/> <error line="67"
    Sean> message="Message2" severity="4"/> </file> <file
    Sean> name=""> <error line="2" message="Message1"
    Sean> severity="2"/> <error line="54" message="Message2"
    Sean> severity="4"/> <error line="122" message="Message1"
    Sean> severity="2"/> </file> </root>

    Sean> Then as the processor processes the tree for this xml file,
    Sean> it finds the <root> element, then looks for a template that
    Sean> matches it.  It would find the identity template and invoke
    Sean> this template.  At this point, what does it put out to the
    Sean> result tree if anything?

A recap of what the identity template looks like. here is one form.

  <xsl:template match="@* | node()">
           <xsl:apply-templates select="@* | node()"/>

If this is the template that proves to be the best match for your
element named root, then the processor will perform an xsl:copy of
that element.

Current Thread