Click to See Complete Forum and Search --> : how to put a checkbox into an XML file?


belen
03-11-2005, 06:23 AM
hello!
My doubt is that I need to put a checkbox into an XML file to make a tree whith the possibility of selecting a branch, and y don't know how to do it, because if I write this:

<check><input type="Checkbox"/></check>

intside my XML file, in the output I don't see anything.
Please, can you help me?
Thanks a lot.

Khalid Ali
03-11-2005, 09:09 AM
you can not put a check box in an xml file the most you can do is put statement like you already have in there.
What you ca do is use XSL/XSLT, JavaScript or any other progaminng language to parse xml file and once you do that thats when you create an input element and set its type to checkbox

crh3675
03-13-2005, 09:54 AM
You can show the checkbox if you use "copy-of" which will select the entire node contents of the <check> tag

Khalid Ali
03-13-2005, 10:04 AM
?????

crh3675
03-14-2005, 08:31 AM
It sounds like the person is trying to extract the content of the <check> node and because the <input> is recognized as an XML tag, there is no "content" but another node. So, therefore, using XSLT, using the "copy-of" will extract the XML content within the <check> tag as regular output.


<xsl:template match="check">
<xsl:copy-of select="*|text()"/>
</xsl:template>

Khalid Ali
03-14-2005, 10:49 AM
oh yeah? and why is it not so obvious that person can see when its check element he needs to read the child element input and then create a checkbox depending upon its attribute that is input?

crh3675
03-14-2005, 11:11 AM
Either way can be effective, it's just a matter of what's most efficient. I just assumed that he needed to have the actual "HTML" tag within the XML.