[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

No-output identity template?

Subject: No-output identity template?
From: cknell@xxxxxxxxxx
Date: Thu, 23 Jan 2003 09:42:18 -0500
identity template
If any of you received this yesterday, my apologies. I didn't receive a copy of this posting, or what I suspect were many other postings to the list yesterday afternoon. Perhaps the server was having trouble.

I have included an XML data document, an XSLT stylesheet, and the resulting output. The XML and XSLT have been severly edited for brevity. The problem I have been working for several hours is the extraneous? "Bugs Bunny" text node output at the end of the output document. I don't know what template or rule is causing its creation, so I haven't been able to suppress it. I need the aid of other eyes and brains.

I suspect I need some sort of rule with no output, but I haven't been able to discover what the rule should match.

Thanks.

XML Input
===================================
<menu>
  <item type="menu" title="AMD">
    <item>Library Home</item>
    <item>Phone Directories</item>
  </item>
  <item>Bugs Bunny</item>
</menu>

XSLT Stylesheet
===================================
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" indent="yes" encoding="UTF-8" />
  <xsl:strip-space elements="*" />

  <xsl:template match="/">
    <xsl:apply-templates mode="sub-menu" />
  </xsl:template>

  <xsl:template match="item[item]" mode="sub-menu">
    <div>
      <xsl:apply-templates mode="sub-menu-item" />
    </div>
  </xsl:template>

  <xsl:template match="item" mode="sub-menu-item">
    <div class="sub-menu-item" ><xsl:value-of select="." /></div>
  </xsl:template>

</xsl:stylesheet>

XML Output
===================================
<div>
   <div class="sub-menu-item">Library Home</div>
   <div class="sub-menu-item">Phone Directories</div>
</div>Bugs Bunny

-- 
Charles Knell
cknell@xxxxxxxxxx - email

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.