RELAX NG text constraint

Discussion in 'XML' started by Geert, Dec 4, 2004.

  1. Geert

    Geert Guest

    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
     
    Geert, Dec 4, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jari Kujansuu
    Replies:
    0
    Views:
    816
    Jari Kujansuu
    Sep 4, 2003
  2. James McComb
    Replies:
    1
    Views:
    374
    Bob Foster
    Nov 20, 2003
  3. Pieter
    Replies:
    6
    Views:
    429
    Pieter
    Nov 28, 2003
  4. Morten W. Petersen
    Replies:
    0
    Views:
    444
    Morten W. Petersen
    Feb 2, 2004
  5. puvit82
    Replies:
    4
    Views:
    762
    puvit82
    Feb 1, 2008
Loading...

Share This Page