![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - How to get boolean (true/false) values as boolean variables? [Thread Next] Re: How to get boolean (true/false) values as boolean variables?To: NULL Date: 9/15/2007 1:44:00 PM "David Lowndes" <DavidL@e...> wrote in message news:7gvle3hb6skovc69uflv52k4p85dvav32f@4...... > Currently I have an XML file with what are really boolean attribute > values being passed numerically as 0 or 1: > > <MyElem flag="1"/> > > and in the XSLT I get the value like this: > > <xsl:param name='MyFlag' > select='number($MyDocument/MyDoc/MyElem/@flag)' /> > > It's more appropriate if I represent the flag as a boolean: > > <MyElem flag="true"/> > Why? I use 0 and -1. These are the values that I find implicit coerce to boolean the best in majority of languages I use. > .. but I can't find what the equivalent would be to get the boolean > value variable in the XSLT. > > Is there a way of doing what I want? An alternative is simply not have the flag element present at all in the XML if its value is to be treated as false. I find that to be the most XSL friendly approach. -- Anthony Jones - MVP ASP/ASP.NET | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||
|
