Correct use of externalRef sought

J

Jeff Chimene

Hi,

(cross-posted on (e-mail address removed))

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>
 

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

Forum statistics

Threads
473,999
Messages
2,570,246
Members
46,843
Latest member
WizcraftEntertainmentAgen

Latest Threads

Top