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

Ignoring a child element

Subject: Ignoring a child element
From: <Emily.Garrett@xxxxxxxxxxx>
Date: Thu, 7 Sep 2006 15:35:52 -0400
emily garrett
I'm trying to weed out a <para> element that does not have any content.
However, it does have a TLStyle element which would style the content if
it existed.  The XML table entry looks like this:


                              <entry colname="1" morerows="0"
align="left" valign="top">
                                 <para>
                                    <TLStyle>BodyText</TLStyle>
                                 </para>
                              </entry>

I tried using normalize-space(.), but since the TLStyle element is in
there, it tests true.  normalize-space(.) = BodyText

							<xsl:choose>

<xsl:when test="normalize-space(.)">

<xsl:apply-templates select="current()"/>

</xsl:when>

The following code also tests true, but I'm not sure why.  I want it to
ignore what's in TLStyle and tell me if there is any other content
inside of <entry>.

                                            <xsl:variable
name="withoutTLStyle" select="node()[not(self::TLStyle)]"/>
							<xsl:choose>

<xsl:when test="normalize-space($withoutTLStyle)">

<xsl:apply-templates select="current()"/>

</xsl:when>
                                                <xsl:otherwise>
                                                <!--do something else
because it's empty-->
                                                </xsl:otherwise>
                                          </xsl:choose>

normalize-space($withoutTLStyle) is also = BodyText.

Any thoughts on how to conquer this?

Emily Garrett

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.