Advertisement

06.06.2008 at 01:42AM PDT, ID: 23463016 | Points: 250
[x]
Attachment Details

parsing boolean as string in XSLT

Asked by anoop0905 in Extensible Stylesheet Language Transformation (XSLT), Extensible Markup Language (XML)

Tags: XSLT, X, Xpath, Xquery, XSLT, Any, XSLT, XPath, XQuery

Hello,

I am using XSLT to transform an XML. Below, i have given an example of an XML containing the boolean character (true / false) that i need the XSL to parse as text Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
XML: 
    <FIELD type="TTextBox" label="Company Name:">
          <PROPERTIES>
            <PROPERTY name="ID">CompanyName</PROPERTY>
            <PROPERTY name="readOnly">true</PROPERTY>
          </PROPERTIES>
    </FIELD>
 
XSL: 
 
           <xsl:for-each select="./PROPERTIES/PROPERTY">
             <xsl:attribute name="{@name}">
<!-- here for the first loop, it prints ID="CompanyNmae"but for the second loop, it evaluates the boolean character and prints ReadOnly instead of ReadOnly="True" -->
               <xsl:value-of select="current()"></xsl:value-of>
             </xsl:attribute>
           </xsl:for-each>
 
Keywords: parsing boolean as string in XSLT
 
Loading Advertisement...
 
[+][-]06.06.2008 at 02:00AM PDT, ID: 21727305

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628