This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Multiple attributes present and non-present



> <xsl:if test="@ENCODINGANALOG/text()"/>
> 
> would do this.

No that is always fals as attributes do not have children, in particular
they don't have text node children.

You just want

<xsl:if test="@ENCODINGANALOG">
to test if an attribute is there at all

or

<xsl:if test="@ENCODINGANALOG=''">
to test if it is not there or has an empty string value

or

<xsl:if test="@ENCODINGANALOG and @ENCODINGANALOG=''">
to test that it is there with an empty string value.


Normally though you don't need any of these tests as you just
copy (or apply-templates to) the set of attributes and so if they are
not there nothing happens, you don't need to explictly test for them
to be empty.

If your attributes are there with empty values as in 
<x ENCODINGANALOG="">
then either they are that way in the source or your dtd is defaulting
them in that way, in which case you might want to change the dtd.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]