This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
test for a empty node
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] test for a empty node
- From: tanz at tmohammad dot fsnet dot co dot uk
- Date: Sun, 29 Apr 2001 15:59:09 +0100
- References: <20010429111243.14670.qmail@web12607.mail.yahoo.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
My xml is as follows:
<organisations>
<orgRecord>
<orgID>1</orgID>>
<organisation>World Health</organisation>
<street>3 street </street>
<city>Liverpool</city>
<state></state>
<postalCode>L42 GH</postalCode>
-----
</orgRecord>
</organisations>
I need to concatenate the address fields:
<xsl:value-of select="concat(street, ', ', city, ', ', state, ', ',
postalCode)"/>
Which returns me the values of each like this:
street, city, state, postalCode
I have two problems:
1. I would prefer the output to look like this
street,
city,
state,
postalCode
2. Is there way to check that if a "state" does not exist i.e.
<state></state> (as in xml) to return:
street,
city,
postalCode
As opposed to either:
(a) street,
city,
<!--empty space-->
postalCode
(b) street, city, , postalCode
Thanks
Tanz
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list