Re: [XSL-FO] xsl test not working !
- If the tags are not present then your first test is false (the tags -
because they are not present - do not have a value of 'empty-text').
If you want to check for a tag NOT being present then (I think) the
simplest way is 'not $add-chk/ShipToContactName'.
You could define a variable for the value of each tag and test that
instead - taht would be more laborious but would allow you to test more
the tag not existing OR not having any content.
(or define a variable which is the concatenation of the values of all
the fields you want to check are empty/not there - and test variable for
having empty content.)
Or - you might find it easier to check for the existence of the tags toy
do want, count the total number of child tags and then just do a test on
(or maybe test="count($add-chk/*[starts-with(name(),'ShipTo')]) = 0" --
I haven't tested that so not sure the syntax is correct).
aananth s wrote:
> I have the follwoing XML fragment
>and the following xsl fragment
><xsl:when test="$add-chk/ShipToContactName='' and
>$add-chk/ShipToAddress4='' and $add-chk/ShipToCity=''
>and $add-chk/ShipToCounty='' and
>always prints the otherwise part and not the when part
>even though the tags in the test condition are not
>What am i missing?Is there a better way to do
>this?thanks for your inputs.
>STRENGTH IS LIFE , WEAKNESS IS DEATH!
>Do you Yahoo!?
>Exclusive Video Premiere - Britney Spears
>To unsubscribe from this group, send an email to:
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
8 Eileen Road
London SE25 5EJ
UK Co. Reg: 4383635
VAT Reg.: 798 7531 60