473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

test for an empty result tree fragment

Hi,

using XSLT 1.0, consider something like this:

<xsl: variable name="foo">
<apply-templates select="..." mode="..." />
</xsl:variable>
<xsl:if test="$foo">
do something in here
</xsl:if>

here the test always returns true because even an empty RTF has one node.
how can i tell if it has any children(assuming none of the children might be
a text node)?

Andy

Feb 8 '07 #1
1 1582
In article <Qt****************@text.news.blueyonder.co.uk>,
Andy Fish <aj****@blueyonder.co.ukwrote:
>here the test always returns true because even an empty RTF has one node.
how can i tell if it has any children(assuming none of the children might be
a text node)?
I think you can't without using an extension function such as exslt:node-set.

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Feb 8 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Aleksi Kallio | last post by:
I'm passing a result tree fragment that holds multiple strings (fieldnames, in this case) and in the called template I wan't to test if a certain string contains any of those names. I have this:...
18
by: Tjerk Wolterink | last post by:
i have the following rule, <xsl:template match="br"> <br/> </xsl:template> This should convert all <br/> to <br/> but, my transformer transforms it all to
6
by: WindAndWaves | last post by:
Hi Folks I have inhereted a script that I understand reasonably well, I just do not understand !/^\d+$/.test(el.value) what the hell does that mean? Below is the script (there are really...
5
by: Harlan Messinger | last post by:
Is the following a legal URL? http://www.invalid.com/path# This underlies my real questions: 1. Is <a href="#"> a *valid* (whether or not intentionally) way to go to the top of a page. ...
3
by: Fede | last post by:
Hi everybody, in vb.net I have this code: ...... myNode= XmlDoc.CreateElement("aNode") myAttribute = XmlDoc.CreateAttribute("xlink", "href", "http://www.w3.org/1999/xlink") ...
8
by: yawnmoth | last post by:
Say I have the following HTML: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> </head> <body> <form action="">
3
by: tschwartz | last post by:
I'm trying to write a stylesheet which removes nodes which are empty as a result of other template processing. For example, given the following xml, I'd like to: - remove all "b" elements -...
16
by: Lastwebpage | last post by:
Hello, I am little surprised about the following: <a href="#" ... I found some lines about the href tag for a site should point to an name or in XHTML to an ID, but in both cases this seems to...
4
by: grbeal | last post by:
How do I test for a child element with xsl if condition? We have a vendor application that outputs an XML file containing records of School Closings due to inclement weather. That XML file gets...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.