Hi
I´m having trouble with my xml schema.
My problem is that I want the element "PREMIE" to be able to occur several times. The other elements has to be independent of order. The element names are in swedish but that shouldn´t be a problem.
Here is the .xsd-file:
<xs:element name="BIL">
<xs:complexType>
<xs:all>
<xs:element name="TRAFIKBONUS" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="BILMERKESKOD" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="6" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- ref -->
<xs:element ref="PREMIE" />
<xs:element ref="RABATT" />
</xs:all>
</xs:complexType>
</xs:element>
I really need this to work.
Thanks!
4 1264
Can you change you <xs:all> to a <xs:sequence> instead?
Then you can have a nested sequence - <xs:sequence>
-
...
-
<xs:sequence>
-
<xs:element ref="PREMIE" maxOccurs="unbounded"/>
-
</xs:sequence>
-
<xs:element ref="RABATT" />
-
</xs:sequence>
-
inside this sequence.
Thanks for your reply. If I do like you say the order of the elements befor the "nested sequence" will matter. That is the whole problem.
I´d be happy for more input.
I was afraid you were asking for that:
http://www.thescripts.com/forum/thread88016.html
Really, the problem is that this is easier to express as a context free grammar, instead of a regular expression. The regular expression that describes your structure is ugly.
eg, renaming the elements a, b, c, d the regular expression might look something like:
c*dc*( (ac*)?(bc*)? | bc*ac*) |
c*ac*bc*dc* |
c*bc*ac*dc* |
c*ac*dc*(bc*)? |
c*bc*dc*(ac*)?
If you really want to enforce this criteria, you might be better off switching to RELAX NG, or schematron, or some other tool.
Ok thanx.
I guess there´s no easy way then.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Robert J Egan |
last post by:
Hi i'm trying to search a remote website page. The form returns xml
information, though the page extension is missing. I retrieve the
information and write it to the screen. So far so good -...
|
by: MarionEll |
last post by:
Premier XML Industry Event Slated for Dec. 7-12 in Philadelphia; Presenters
Include Adobe, BEA, Microsoft, IBM, Sun, Hewlett-Packard, Oracle
Alexandria, Va. Sept. 30, 2003 - IDEAlliance, a...
|
by: MarionEll |
last post by:
XML 2003 Exposition Draws Leading XML Vendors
Trade Show, Presentations Allow Companies to Showcase Cutting-edge Solutions
Alexandria, Va. - Dec. 1, 2003 - XML 2003, the world's largest XML...
|
by: Steve Whitlatch |
last post by:
It may be me, or it may be the Linux implementation of XML Catalogs on
slackware. Whichever, please shed some light on this XML Catalog problem.
When using the --catalogs option, xmllint resolves...
|
by: melledge |
last post by:
The Reliable Source for Everything XML - XML 2005 Update
XML 2005 - November 14-18 - Atlanta Hilton Hotel - Atlanta, GA
www.xmlconference.org
Register today and participate in IDEAlliance's...
|
by: Srini |
last post by:
I have written two simple webservice functions and trying
to consume them through a client piece. Both the
webservice functions have similar signature....
|
by: MarionEll |
last post by:
Premier XML Industry Event Slated for Dec. 7-12 in Philadelphia; Presenters
Include Adobe, BEA, Microsoft, IBM, Sun, Hewlett-Packard, Oracle
Alexandria, Va. Sept. 30, 2003 - IDEAlliance, a...
|
by: laks |
last post by:
Hi
I have the following xsl stmt.
<xsl:for-each select="JOB_POSTINGS/JOB_POSTING
\">
<xsl:sort select="JOB_TITLE" order="ascending"/>
This works fine when I use it.
But when using multiple...
|
by: jts2077 |
last post by:
I am trying to create a large nested XML object using E4X methods. The problem is the, the XML I am trying to create can only have xmlns set at the top 2 element levels. Such as:
<store
...
|
by: =?Utf-8?B?YzY3NjIyOA==?= |
last post by:
Hi all,
I had a program and it always works fine and suddenly it gives me the
following message when a pass a xml file to our server program:
error code: -1072896680 reason: XML document must...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |