Correct use of externalRef sought

Discussion in 'XML' started by Jeff Chimene, May 17, 2005.

  1. Jeff Chimene

    Jeff Chimene Guest

    Hi,

    (cross-posted on )

    I'm trying to learn relaxNG. Perhaps some of my design decisions are
    overly influenced by older products, and externalRef isn't the correct
    choice.

    My question is why does jing report "Text not allowed here" and
    "Unfinished element" for the following document:
    <?xml version="1.0" encoding="UTF-8"?>
    <access>
    <subscriber>
    <id>15</id>
    </subscriber>
    </access>


    Thank-you in advance,
    jec

    I have a data dictionary with the following structure:
    /
    /Patterns
    /Schemas

    I have a schema called Schemas/access.rng
    <?xml version="1.0" encoding="UTF-8"?>
    <grammar
    xmlns="http://relaxng.org/ns/structure/1.0"
    datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
    xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
    xmlns:sch="http://www.ascc.net/xml/schematron">

    <start>
    <choice>
    <ref name="access"/>
    </choice>
    </start>

    <define name="access">
    <element name="access">
    <oneOrMore>
    <ref name="Subscriber"/>
    </oneOrMore>
    </element>
    </define>

    <define name="Subscriber">
    <element name="subscriber">
    <element name="id">
    <externalRef href="../Patterns/id.rng"/>
    </element>
    </element>
    </define>
    </grammar>

    id.rng is as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <grammar
    datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
    xmlns="http://relaxng.org/ns/structure/1.0"
    xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
    xmlns:sch="http://www.ascc.net/xml/schematron">

    <define name="id">
    <element name="id">
    <data type="long"/>
    </element>
    </define>

    <start>
    <ref name="id"/>
    </start>
    </grammar>
    Jeff Chimene, May 17, 2005
    #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. joon
    Replies:
    1
    Views:
    511
    Roedy Green
    Jul 8, 2003
  2. Dan

    correct or not correct?

    Dan, Oct 2, 2003, in forum: HTML
    Replies:
    7
    Views:
    433
  3. J.Ram
    Replies:
    7
    Views:
    641
  4. Chris Mohan
    Replies:
    0
    Views:
    92
    Chris Mohan
    Jul 21, 2004
  5. froil
    Replies:
    12
    Views:
    304
    Gunnar Hjalmarsson
    Mar 2, 2006
Loading...

Share This Page