This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
"Skip until"??
- To: XSL-List at mulberrytech dot com
- Subject: "Skip until"??
- From: "Heiner de Wendt" <H dot dewendt at systec dot de>
- Date: Tue, 8 Aug 2000 10:06:05 +0200
- Organization: SYSTEC Elektronik und Software GmbH
- Reply-To: xsl-list at mulberrytech dot com
Hello,
this time I've got a real problem ;-)
I've got an XML file like this:
<root>
<node>name: Smith</node>
<node>subject: Feedback</node>
<node>Dontneed: Somestuff</node>
<node>date: 02-2000</node>
<node>Somedata: Dontwant</node>
<node>name: Jones</node>
<node>Unneeded: Redundance</node>
<node>subject: Questions</node>
<node>date: 03-2000</node>
<node>name: Miller</node>
<node>Dontwant: Skipthis</node>
<node>subject: Request</node>
<node>date: 03-2000</node>
</root>
Now, my XSLT file should be like this:
1. Match all <node> elements
2. If element contains "name:", "subject:" or "date:", then continue
processing
3. If element contains the unwanted name "Jones" then:
3a. Skip until element contains "name:" again
3b. Process 3 again
4. Show value of element
Most of it isn't very complex, but I have no idea how to realize
steps 3a and 3b. I've played with call-template, but things just
didn't work as I wanted.
Here's what I thought of:
<template name="skip">
<performtheskip/>
</template>
<template match="node">
<xsl: if test="contains(.,'name:') or contains(.,'subject:') or
contains(.,'date:')>
<xsl:if test="contains(.,'Jones')>
<xsl:call-template name="skip"/>
</xsl:if>
<perform-the-above-xsl:if-again/>
<xsl:value-of select="."/>
</xsl:if>
</template>
Anyone out there having an idea? :-)
Thanks,
Heiner
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list