Re: [xsl] attributes and elements

Subject: Re: [xsl] attributes and elements
From: "Bruce D'Arcus" <bdarcus@xxxxxxxxxxx>
Date: Fri, 5 Dec 2003 18:51:16 -0500
J.Pietschmann wrote:

Bruce D'Arcus wrote:
--->                    <xsl:if test="*/condition">
--->                        <xsl:apply-templates/>
--->                    </xsl:if>

The test test, whether one of the child elements of the section element has a condicion element as child. I just can't quite match the XSLT with your problem spec, as a rather wild guess I'd say try: ... <content> <xsl:apply-templates mode="filter-condition"/> ...

  <xsl:template match="*[@condition='screen']"

<xsl:template match="node()" mode="filter-condition"/>

I've put together a stripped down example. Let's say here's my instance:

<p>Some text to become <q type="screen">a bullet</q> here.</p>

I just want output like:

	<bullet>a bullet</bullet>

I can't seem to get that. Here's the xslt, using your example:

<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version='1.0' xmlns:xsl=''>
<xsl:output method='xml' version='1.0' encoding='utf-8' indent='yes'/>

<xsl:template match="section">
		<xsl:apply-templates select="title"/>
      <xsl:apply-templates mode="filter-condition"/>

<xsl:template match="*[@type='screen']" mode="filter-condition">

<xsl:template match="node()" mode="filter-condition"/>


XSL-List info and archive:

Current Thread