•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the XML, XSLT and XPATH section within the Software Development category of DaniWeb, a massive community of 397,816 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,575 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our XML, XSLT and XPATH advertiser:
Views: 2520 | Replies: 0
![]() |
•
•
Join Date: Mar 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Dear all
See XHTML document below,
Question and comments are with the text
Thx
Bernt
<!-- Why does not this work ????????????
I just want to have different options for each question !!!!!!
I know I can make a new model for each selection (but that is not what I wanna do)
<xforms:itemset model="allowedAnswers" nodeset="instance('A')/xforms:opt1/xforms:answ">
according to hundres of tutorial and books this is how to do it
I'm using FireFox with the Xforms plug-in and I cannot use IEXPLORE with plug-in
because IEXPLORE does work well with file protocol (only http)
-->
<!-- Neither this work ????????????
<xforms:itemset model="allowedAnswers" instance="B" nodeset="/xforms:opt1/xforms:answ">
The line below works but it always pick the first instance
-->
See XHTML document below,
Question and comments are with the text
Thx
Bernt
<?xml version="1.0" encoding="UTF-16"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xforms="http://www.w3.org/2002/xforms">
<head> <link href="EWIN_XFORMS.css" rel="stylesheet"/>
<title>XForms Itemset Example</title>
<xforms:model id="main">
<xforms:instance>
<xforms:DOCUMENT documentName="MyReportXX">
<xforms:STATUS MYCHOICE="1" REMARK="">
</xforms:STATUS>
<xforms:STATUS MYCHOICE="11" REMARK="">
</xforms:STATUS>
</xforms:DOCUMENT>
</xforms:instance>
<xforms:bind nodeset="/xforms:DOCUMENT/xforms:STATUS[1]/@MYCHOICE" id="MC1"/>
<xforms:bind nodeset="/xforms:DOCUMENT/xforms:STATUS[2]/@MYCHOICE" id="MC2"/>
<xforms:bind nodeset="/xforms:DOCUMENT/xforms:STATUS[1]/@REMARK" id="REM1"/>
<xforms:bind nodeset="/xforms:DOCUMENT/xforms:STATUS[2]/@REMARK" id="REM2"/>
<xforms:submission id="Save" action="file//:LocalFile.xml" method="put"></xforms:submission>
</xforms:model>
<xforms:model id="allowedAnswers" xslns="">
<xforms:instance id="A">
<xforms:opt1>
<xforms:answ>
<xforms:ALLOWED_ANSWER_TEXT>Medium</xforms:ALLOWED_ANSWER_TEXT>
<xforms:ANSWER_CODE>1</xforms:ANSWER_CODE>
</xforms:answ>
<xforms:answ>
<xforms:ALLOWED_ANSWER_TEXT>Some Good some bad</xforms:ALLOWED_ANSWER_TEXT>
<xforms:ANSWER_CODE>2</xforms:ANSWER_CODE>
</xforms:answ>
<xforms:answ>
<xforms:ALLOWED_ANSWER_TEXT>Happy</xforms:ALLOWED_ANSWER_TEXT>
<xforms:ANSWER_CODE>3</xforms:ANSWER_CODE>
</xforms:answ>
</xforms:opt1>
</xforms:instance>
<xforms:instance id="B">
<xforms:opt1>
<xforms:answ>
<xforms:ALLOWED_ANSWER_TEXT>BB I don't think</xforms:ALLOWED_ANSWER_TEXT>
<xforms:ANSWER_CODE>11</xforms:ANSWER_CODE>
</xforms:answ>
<xforms:answ>
<xforms:ALLOWED_ANSWER_TEXT>I was not there</xforms:ALLOWED_ANSWER_TEXT>
<xforms:ANSWER_CODE>12</xforms:ANSWER_CODE>
</xforms:answ>
</xforms:opt1>
</xforms:instance>
</xforms:model>
</head>
<body>
<!-- Itemset example -->
<xforms:select1 bind="MC1" appearance="minimal">
<xforms:label>What do u think about when u see snow?</xforms:label>I just want to have different options for each question !!!!!!
I know I can make a new model for each selection (but that is not what I wanna do)
<xforms:itemset model="allowedAnswers" nodeset="instance('A')/xforms:opt1/xforms:answ">
according to hundres of tutorial and books this is how to do it
I'm using FireFox with the Xforms plug-in and I cannot use IEXPLORE with plug-in
because IEXPLORE does work well with file protocol (only http)
-->
<xforms:itemset model="allowedAnswers" nodeset="/xforms:opt1/xforms:answ">
<xforms:label ref="xforms:ALLOWED_ANSWER_TEXT"></xforms:label>
<xforms:value ref="xforms:ANSWER_CODE"></xforms:value>
</xforms:itemset>
</xforms:select1>
<xforms:input bind="REM1">
<xforms:label>Remark:</xforms:label>
</xforms:input>
<xforms:select1 bind="MC2" appearance="minimal">
<xforms:label>What do u think about the weather last week in October 6 years ago?</xforms:label>
<xforms:itemset model="allowedAnswers" instance="B" nodeset="/xforms:opt1/xforms:answ">
The line below works but it always pick the first instance
-->
<xforms:itemset model="allowedAnswers" nodeset="/xforms:opt1/xforms:answ">
<xforms:label ref="xforms:ALLOWED_ANSWER_TEXT"/>
<xforms:value ref="xforms:ANSWER_CODE"/>
</xforms:itemset>
</xforms:select1>
<xforms:input bind="REM2">
<xforms:label>Remark:</xforms:label>
</xforms:input>
<xforms:submit submission="Save"><label>Save</label></xforms:submit>
<xforms:submit submission="Submit"><label>Submit</label></xforms:submit>
</body>
</html>
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb XML, XSLT and XPATH Marketplace
- Send data on a serial port (C++)
- Toshiba 2805-series HDD upgrade (Storage)
- Please Please Help!! (Troubleshooting Dead Machines)
- Graphics in Pixel,Mode13h:Part 1 (C++)
- Saving and opeing a JTable (Java)
- IBM X20 LCD Bulb (Monitors, Displays and Video Cards)
- MySQL - logical model from a conceptual model (MySQL)
- NEWS - MySQL Database To Get New Features (MySQL)
Other Threads in the XML, XSLT and XPATH Forum
- Previous Thread: need some help in WML
- Next Thread: XML Bug Error.


Linear Mode