Lists with uniques
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 5
- Joined: Wed May 04, 2011 4:03 pm
Lists with uniques
Dear all,
I am a newbie here, and I don't know much about schemas... I am still using the GUI for that!
What am I trying to do? I'd like to create a complex type that is a list of unique elements... obviously without succeeding!
For example, I want a complex type with the following possibilities:
- a
- b
- c
- d
So, something like
is ok, and so is
However, entering the same element twice, it should raise an error:
Is it possible to do this with the GUI?
Thanks!!
I am a newbie here, and I don't know much about schemas... I am still using the GUI for that!
What am I trying to do? I'd like to create a complex type that is a list of unique elements... obviously without succeeding!
For example, I want a complex type with the following possibilities:
- a
- b
- c
- d
So, something like
Code: Select all
<mynode>
<a/>
<b/>
</mynode>
Code: Select all
<mynode>
<d/>
<a/>
</mynode>
Code: Select all
<mynode>
<d/>
<a/>
<d/>
</mynode>
Thanks!!
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Lists with uniques
Hello,
This is possible and quite simple with the GUI.
1. Add a new global complex type:
Right click on the schema frame and from the contextual menu choose:
New Global -> Complex Type, give it a name.
2. Inside the complex type add an All compositor:
Right click on the complex type and from the the contextual menu choose:
Append Child -> All
3. Inside the All compositor add each element and make it optional:
For each element right click on the All compositor and from the the contextual menu choose:
Append Child -> Element, give the element a name, right click on the added element and from the contextual menu choose Optional.
You will obtain something like this:
Regards,
Adrian
This is possible and quite simple with the GUI.
1. Add a new global complex type:
Right click on the schema frame and from the contextual menu choose:
New Global -> Complex Type, give it a name.
2. Inside the complex type add an All compositor:
Right click on the complex type and from the the contextual menu choose:
Append Child -> All
3. Inside the All compositor add each element and make it optional:
For each element right click on the All compositor and from the the contextual menu choose:
Append Child -> Element, give the element a name, right click on the added element and from the contextual menu choose Optional.
You will obtain something like this:
Code: Select all
<xs:complexType name="mytype">
<xs:all>
<xs:element name="a" minOccurs="0"></xs:element>
<xs:element name="b" minOccurs="0"></xs:element>
<xs:element name="c" minOccurs="0"></xs:element>
<xs:element name="d" minOccurs="0"></xs:element>
</xs:all>
</xs:complexType>
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
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