473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Undefined elements XSD definition

hi !

I would like to write a schema for this kind of XML document

<request>
<params>
<param1>foo</param1>
<pouet>foo</pouet>
<truc>bidule</truc>
</params>
<body>
.....
</body>
</request>

The number and the name of the params are undefined. Another valid XML
document could be

<request>
<params>
<azerty>foo</azerty>
<qwerty>foo</qwerty>
<name>oziris</name>
</params>
<body>
.....
</body>
</request>

Is there a XSD mean to specify that?
Using <xs:any> was my first idea but I wonder if there is better
answer.

Thanks a lot.

-o--

Nov 24 '05 #1
3 1140


oziris wrote:

<params>
<param1>foo</param1>
<pouet>foo</pouet>
<truc>bidule</truc>
</params> The number and the name of the params are undefined. Is there a XSD mean to specify that?
Using <xs:any> was my first idea but I wonder if there is better
answer.


You would need xs:any if you don't know the element names.
But of course you could avoid that with e.g.
<params>
<param name="param1" value="foo"</param>
</params>
and then define that element param as having two attributes name and
value as needed.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 24 '05 #2
oziris writes:
The number and the name of the params are undefined.

Is there a XSD mean to specify that?
Using <xs:any> was my first idea but I wonder if there is better
answer.


That's precisely what xs:any is for.

ht
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Nov 24 '05 #3
Thanks a lot Martin.
So easy I don't understand why I don't find by myself.

-o--

Nov 24 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: lawrence | last post by:
I can't get this page to show in Internet Explorer, so I assume the error is quite grave. I'm using a PHP script to write the RSS file. In Netscape the page shows up as plain text. "Item" is...
24
by: DaKoadMunky | last post by:
I was recently reading an article about sequence points that used the canonical i = i++; as an illustration of modifying a variable multiple times between sequence points. Curiously the...
8
by: Scott J. McCaughrin | last post by:
The following program compiles fine but elicits this message from the linker: "undefined reference to VarArray::funct" and thus fails. It seems to behave as if the static data-member:...
66
by: Mantorok Redgormor | last post by:
#include <stdio.h> struct foo { int example; struct bar *ptr; }; int main(void) { struct foo baz; baz.ptr = NULL; /* Undefined behavior? */ return 0;
9
by: Alan Schroeder | last post by:
The following code produces the expected results on a PC using gcc, but I need to port it (or least something similar) to a different platform/compiler. I don't think I've introduced any undefined...
45
by: VK | last post by:
(see the post by ASM in the original thread; can be seen at <http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/3716384d8bfa1b0b> as an option) As that is not in relevance to...
7
by: deepak | last post by:
Using 'char' as an array index is an undefined behavior?
4
by: Hora | last post by:
Hi Guys I'm reading Andrew Koenig and Barbara E. Moo 's book, Accelerated C++. It's the best works for newbie I ever read. The way the authors introduce the language is very interesting. In...
12
by: Franz Hose | last post by:
the following program, when compiled with gcc and '-std=c99', gcc says test.c:6: error: jump into scope of identifier with variably modified type that is, it does not even compile. ...
14
by: jl_post | last post by:
Hi, I've heard that if you've declared a variable (such as a double or an int) and not initialize it, then the result of printing out its value is undefined. I've also heard that "undefined...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
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...
0
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
tracyyun
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...
0
agi2029
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.