XForms and XPath

admin

Administrator
Staff member
Hello,

i am pretty new to XML and all related markup languages. I'm working on a patient-administration tool for a local hospital using XForms.
The problem in these XForms is, that there are often <20 Dropdown-menus (<xf:select1>) with the same value, so that I decided to "read" the possible values from the XML Schema.

Here are some snippets:

XForms/XUL:

<xf:model id="K" schema="../schemas/K.xsd">
<xf:instance id="KI" src=http://www.webdeveloper.com/forum/archive/index.php/"../documents/K.xml"/>
<xf:instance id="KIS" src="../schemas/K.xsd"/>
</xf:model>
[...]
<xf:select1 ref="//ki:a/ki:b/ki:c>
<xf:itemset node-set="instance('KIS')//xsd:simpleType[@name='tValue']/xsd:restriction/xsd:enumeration">
<xf:label ref="@value" />
<xf:value ref="@value" />
</xf:itemset>
</xf:select1>

XML Schema:
<xsd:simpleType name="tValue">
<xsd:restriction base="xsd:string">
<xsd:enumeration value=http://www.webdeveloper.com/forum/archive/index.php/"one/>
<xsd:enumeration value="two"/>
<xsd:enumeration value="three"/>
</xsd:restriction>
</xsd:simpleType>

What happens is: nothing. Neither the default value from the xml-instance nor the values from the enumeration in the XML Schema are availible. This happens with the XForms extension for Mozilla/Firefox.

When I load the schema into a validator and test the XPath (without the leading instance()) this path matches exactly the attributes that I want. Also, if I do not use a <xf:select1> but a <xf:input> and set the XPath as a ref="" the (first) value is filled in.

I hope my problem is understandable, maybe someone out there knows why no dropdown menu is displayed.
 
Back
Top