RELAX NG text constraint

Geert

Usenet Archive
Joined
Jan 25, 2001
Messages
10
Reaction score
0
Hello,

I'm trying to write a RELAX NG schema that *only* validates the following XML instance (with mixed content):

<div id="1">A<a href="X"/></div>

The problem is to constrain the text value after the opening <div> tag to some fixed value. Is this actually possible, and if so, how can it be done?

I tried with the following schema, but validation fails at the "<value>A</value>" line. Jing says: Error, group of "string" or "data" element.

<element name="div">
<attribute name="id">
<value>1</value>
</attribute>
<value>A</value>
<element name="a">
<attribute name="href"/>
<value>X</value>
</attribute>
</element>
</element>

Regards
--Geert
 

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