![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Transform up to defined tag [Thread Next] Re: Transform up to defined tagTo: NULL Date: 5/5/2004 4:55:00 PM
Michael Faschinger wrote:
> I want to transform some XML-files and I want to introduce a "stop-tag",
> after which the transformation has to stop.
> Example:
>
> <?xml version="1.0">
> <doc>
> <foo>1</foo>
> <foo>2</foo>
> <foo>3</foo>
> <stop/>
> <foo>4</foo>
> <foo>5</foo>
> </doc>
>
> The transformation should stop at the <stop/>-tag, only <foo>1</foo> ..
> <foo>3</foo> should be transformed. Is that possible?
The following template for <doc> will only process the elements before
<stop>
<xsl:template match="doc">
<xsl:copy>
<xsl:apply-templates select="*[not(preceding-sibling::stop or
self::stop)]" />
</xsl:copy>
</xsl:template>
--
Martin Honnen
http://JavaScript.FAQTs.com/
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
