Subject: Re: Select on Text Node, XML Out of Ancestors
From: John Robert Gardner <jrgardn@xxxxxxxxx>
Date: Mon, 1 Nov 1999 11:31:30 -0500 (EST)
|
Thanks to David and James, I'm getting good progress now, however I've
wound up by-passing one of my primary objectives, which is to preserve all
extant markup in the result output, cf. a reply I sent offlist in case I
was being too obtuse . . . .
> I need to preserve all the element markup _as well as_ the content. In
> other words, all i"m trying to do is cut-down the original instance to
> only those records with subfield text xxxx-xxx.
> So here's a stylesheet which simply needs to do what it now does,
> _while preserving_all the markup in the result instance:
>
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
>
> <xsl:output method="xml"/>
>
> <xsl:for-each select="record[data-field/subfield='0039-310X']">
> <xsl:apply-templates mode="copy" select="."/>
> </xsl:for-each>
>
> <xsl:template mode="copy" match="*">
> <xsl:copy>
> <xsl:copy-of select="@*"/>
> <xsl:apply-templates mode="copy"/>
> </xsl:copy>
> </xsl:template>
>
> </xsl:stylesheet>
>
> However, all this so far is not at all wasted, as going backward to a
> non-xml record form will eventually be a project, so now we've
> inadvertently done this.
>
> =-=-=-=-=-=-=-=-=-==-=-=-=
> John Robert Gardner
> XML Engineer
> ATLA-CERTR
> ------------------------------------------------------------
> http://vedavid.org/
> http://www.purl.org/CERTR/
>
> On Mon, 1 Nov 1999, David Carlisle wrote:
>
> >
> >
> > > "node() in step pattern not implemented"
> >
> > so where did you put node in a step pattern, ie one with / ?
> >
> > Anyway you can replace node() with * here unless you expect to copy
> > process instructions and other special stuff.
> >
> > David
> >
>
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|