RELAX NG text constraint

G

Geert

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
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top