For an upcoming project I’ll need to be capturing the relevant part of a source document during XSLT processing. For example:

 

Source:

<person>

    <firstname>Bob</firstname>

    <lastname>Smith</lastname>

</person>

 

Stylesheet:

<xsl:stylesheet>

   

<xsl:template match=”/”>

   Firstname: <xsl:value-of select=”firstname”/>

</xsl:template>

 

</xsl:stylesheet>

 

Output:

Firstname: Bob

 

What I need to capture is the “relevant” (is there a better word?) part of the source document:

 

<person>

    <firstname>bob</firstname>

</person>

 

I’ve looked around for something to do this, but I haven’t found anything. Is there a tool out there to do this, and if not, any suggestions on how to add this functionality to a XSLT processor?

 

Thanks,

Brian

 

briant@imagegroup.com