[xml/sgml] Correct use of externalRef sought

Jeff Chimene jeffchimene@yahoo.com
Tue, 17 May 2005 14:00:22 -0700 (PDT)


Hi,

(cross posted on comp.text.xml &
relaxng-user@relaxng.org)

Perhaps this list can help...

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>



		
__________________________________ 
Yahoo! Mail Mobile 
Take Yahoo! Mail with you! Check email on your mobile phone. 
http://mobile.yahoo.com/learn/mail