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

RE: difference btw match="item[@distribution!='both']

Subject: RE: [xsl] difference btw match="item[@distribution!='both']" and test="@distribution!='both"
From: Edward.Middleton@xxxxxxxxxxx
Date: Tue, 14 Jan 2003 12:43:02 +0900
xsl template match item
The first method never succeeds so the default template is applied.  The default template for a text node copies text nodes to the output.  The second template succeeds in matching the <template  match=”item”> and fails on the <xsl:if test=”@distribution!='both'”> so the default template is never applied.

Edward Middleton

-----Original Message-----
From: john liao [mailto:jliao2k@xxxxxxxxx]
Sent: Tuesday, January 14, 2003 11:49 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] difference btw match="item[@distribution!='both']" and
test="@distribution!='both"


Hi list

I found the two methods yield slightly different
results w.r.t <![CDATA]>. In the first template match
the contents of CDATA is produced, but the <xsl:if
test method does not produce it. What's the
difference?

"item" looks like this:
<item distribution="both">
<![CDATA
contents of CDATA
]]
</item>

and the templates look like this:

<xsl:template match="item[@distribution!='both']"
...
...
</xsl:template>      ==> contents of CDATA show up

<xsl:template match="item">
   <xsl:if test="@distribution!='both'">
      ...
      ...
   </xsl:if>
</xsl:template>      ==> produces nothing (which is
what I want)


     

=====


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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


 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.