XML Enumeration
This should cover W3C XML Schema, Relax NG and DTD related problems.
XML Enumeration
When creating a type for a schema, such as
<xs:element name="test" type="xs:TestType" />
<xs:simpleType name="TestType">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="Off"></xs:enumeration>
<xs:enumeration value="On"></xs:enumeration>
</xs:restriction>
</xs:simpleType>
Is it possible to have a set method that provides the ENUM ordinal. So in addition to having setTest("Off") and setTest("On") you could do setTest(0) for off and setTest(1) for On. I havent been able to find an example of this so I'm thinking its not currently possible. Any ideas?
When you use the get method, you can use TestTypes.Off_Type which would give you 0. But the set method doesnt have an int parameter option.
<xs:element name="test" type="xs:TestType" />
<xs:simpleType name="TestType">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="Off"></xs:enumeration>
<xs:enumeration value="On"></xs:enumeration>
</xs:restriction>
</xs:simpleType>
Is it possible to have a set method that provides the ENUM ordinal. So in addition to having setTest("Off") and setTest("On") you could do setTest(0) for off and setTest(1) for On. I havent been able to find an example of this so I'm thinking its not currently possible. Any ideas?
When you use the get method, you can use TestTypes.Off_Type which would give you 0. But the set method doesnt have an int parameter option.
Re: XML Enumeration
Hi,
I do not understand the context of your question so I am afraid I cannot help you much with your question. One thing that looks trange however is this
Regards,
George
I do not understand the context of your question so I am afraid I cannot help you much with your question. One thing that looks trange however is this
You refer to the TestType using the xs prefix which is bound to the XML Schema namespace. You nee to use a prefix corresponding to your schema target namespace or if your schema has no target namespace defined then you should not use any prefix and there should be no default namespace declaration.<xs:element name="test" type="xs:TestType" />
<xs:simpleType name="TestType">
Regards,
George
George Cristian Bina
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service