How to disallow empty string elements using XML Schema?

Joined
Aug 28, 2003
Messages
1
Reaction score
0
Hi.
I want to do something like
<root>
<n>Some text only</n>
</root>

I wan't to define a schema that disallows the following xml-files:
<root>
<n/>
</root>
and
<root>
<n></n>
</root>

where the node 'n' is specified in the schema as xsd:string.

Is this possible? I haven't figured out how to do this.

Anyone know how to do this?

Thanks in advance, Jan-Erik
 

Bob Foster

Usenet Archive
Joined
Aug 14, 2002
Messages
220
Reaction score
0
minLength facet, non-empty pattern facet, etc.

Bob

"Jan-Erik hman" wrote:

Hi.
I want to do something like
<root>
<n>Some text only</n>
</root>

I wan't to define a schema that disallows the following xml-files:
<root>
<n/>
</root>
and
<root>
...
 

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
548,042
Messages
3,104,224
Members
248,132
Latest member
henrywalsh

Latest Threads

Top