Schema: specify that element contains XML snippet

I

ian mayo

Hi all,
I'm sure there's a way to do this - but I can't the terms to describe it and
am just wandering around a little lost....

In my XML schema, I'd like to specify than an element is a container for any
other snippet of XML.

Could anybody please give me any advice in how to do this? It's currently
specified as an xs:string, but my editor keeps complaining that it's found
invalid attributes/elements inside it.

If anybody could give even give me the correct name for what I'm doing I'll
be able to search more effectively.

Cheers,
Ian
 
M

Martin Honnen

ian said:
Hi all,
I'm sure there's a way to do this - but I can't the terms to describe it and
am just wandering around a little lost....

In my XML schema, I'd like to specify than an element is a container for any
other snippet of XML.

Could anybody please give me any advice in how to do this? It's currently
specified as an xs:string, but my editor keeps complaining that it's found
invalid attributes/elements inside it.

If anybody could give even give me the correct name for what I'm doing I'll
be able to search more effectively.

Use
<xs:element name="elementName" type="xs:any" />
or simply omit the type
<xs:element name="elementName" />
There is also an
<xs:any
element can be used inside a sequence for instance, it has attributes to
avoid validation or to validate as far as the elements contained are
defined.
 
I

ian mayo

Martin Honnen said:
Use
element can be used inside a sequence for instance, it has attributes to
avoid validation or to validate as far as the elements contained are
defined.

Thanks Martin, just what I was hoping for....

Cheers,
Ian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top