• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

position or iterator?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

unfortunatly i could not find any help in my xsl book or online... may you have some time to help me...

ok here is the xml code (simplified of course)


<DATA name="testdata">

<OTHERDATA></OTHERDATA>

<INSTANCE class="Start" name="Example Data">
<ATTRIBUTE name="stuff"></ATTRIBUTE>
</INSTANCE>
<INSTANCE class="OpenData" name="OpenData-44422">
<ATTRIBUTE name="Data">Last Name</ATTRIBUTE>
<ATTRIBUTE name="Comment"/>
</INSTANCE>
<INSTANCE class="ClosedData" name="OpenData-44425">
<ATTRIBUTE name="Data">Adress</ATTRIBUTE>
<ATTRIBUTE name="Comment"/>
</INSTANCE>
INSTANCE class="ClosedData" name="ClosedData-44431">
<ATTRIBUTE name="Data">Gender</ATTRIBUTE>
<RECORD name="Choice of Responses">
<ROW>
<ATTRIBUTE name="Response" type="STRING">male</ATTRIBUTE>
</ROW>
<ROW>
<ATTRIBUTE name="Response" type="STRING">female</ATTRIBUTE>
</ROW>
</RECORD>
</INSTANCE>
<INSTANCE class="OpenData" name="OpenData-44459">
<ATTRIBUTE name="Data">First Name</ATTRIBUTE>
<ATTRIBUTE name="Comment"/>
</INSTANCE>

<CONNECTOR class="Sub">
<FROM instance="Example Data" class="Start"/>
<TO instance="OpenData-44459" class="OpenData"/>
</CONNECTOR>
<CONNECTOR class="Sub">
<FROM instance="OpenData-44459" class="OpenData"/>
<TO instance="Open Data-44422" class="OpenData"/>
</CONNECTOR>
... some more connectors .....
</DATA>

what i want to do is to get the data in the right order (which works now) and after each data should be a textbox to answer - in other words it should look like a questionnaire... closed data means that there is a checkbox and open data means that there is a textbox

i wrote already some xsl code - i think the relevant part is:



with the help of this xsl code i get after each OpenData a textbox

i did the same with the ClosedData (difference: output is checkbox)

BUT now each textbox has the same name: text_answer1
now i have the problem that i cannot save the data which the user types in the form

i think i cannot solve the problem with position() as a counter ...

is there a possibility to use an iterator or something like that in xsl - i could not find anything about

thanks for helping me!!! (sitting for hours to find a solution...
reply
    Bookmark Topic Watch Topic
  • New Topic