[oXygen-user] Validating merged grammars

George Cristian Bina
Tue Sep 7 06:23:52 CDT 2004


Hi Paul,

I guess it is a case similar with including XML content using external
entities.
Take for instance the following example:

test.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE test SYSTEM "test.dtd" [
  <!ENTITY test '1234'>
  <!ENTITY incl SYSTEM 'incl.xml'>

]>
<test>
  &test;
  &incl;
</test>

test.dtd:
<!ELEMENT test (#PCDATA|x)*>
<!ELEMENT x (#PCDATA)*>

incl.xml:
<?xml version="1.0" encoding="UTF-8"?>
<x>&test;</x>

In this case incl.xml is not valid but the test.xml document is valid.

Similarly the correctRelax_0.rng is valid while the included schema is not
valid.

Best Regards,
George
-------------------------------------------------------------
George Cristian Bina mailto:
<oXygen/> XML Editor - http://www.oxygenxml.com/


----- Original Message -----
From: "Paul Everitt" <>
To: "George Cristian Bina" <>
Cc: <>
Sent: Tuesday, September 07, 2004 11:11 AM
Subject: Re: [oXygen-user] Validating merged grammars


>
> Hmm, weird.  Looks like various tutorials are out-of-date, including
> zvon:
>
>    http://www.zvon.org/xxl/XMLSchemaTutorial/Output/ser_include_st7.html
>
> Can you show how the correctRelax_1.rng on that zvon page should be
> written?
>
> --Paul
>
> On Sep 7, 2004, at 9:54 AM, George Cristian Bina wrote:
>
> > Hi Paul,
> >
> > According with the Relax NG specification:
> > <quote
> > src="http://www.oasis-open.org/committees/relax-ng/spec
> > -20011203.html#IDASNZ
> > R">
> >  A grammar must have a start child element.
> > </quote>
> >
> > Oxygen uses Jing (2003-06-19) for Relax NG validation support.
> >
> > Best Regards,
> > George
> > -------------------------------------------------------------
> > George Cristian Bina mailto:
> > <oXygen/> XML Editor - http://www.oxygenxml.com/
> >
> >
> > ----- Original Message -----
> > From: "Paul Everitt" <>
> > To: <>
> > Sent: Tuesday, September 07, 2004 10:18 AM
> > Subject: [oXygen-user] Validating merged grammars
> >
> >
> >>
> >> Hi.  The first example in the Relax-NG tutorial under 9.3 "Merging
> >> Grammars" looks like this:
> >>
> >> <grammar xmlns="http://relaxng.org/ns/structure/1.0"
> >>      xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
> >> datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
> >>      <define name="inline">
> >>          <zeroOrMore>
> >>              <ref name="inline.class"/>
> >>          </zeroOrMore>
> >>      </define>
> >>      <define name="inline.class">
> >>          <choice>
> >>              <text/>
> >>              <element name="bold">
> >>                  <ref name="inline"/>
> >>              </element>
> >>              <element name="italic">
> >>                  <ref name="inline"/>
> >>              </element>
> >>          </choice>
> >>      </define>
> >> </grammar>
> >>
> >> However, <oxygen/> fails to validate, claiming it requires a <start>
> >> element.
> >>
> >> --Paul
> >>
> >> _______________________________________________
> >> oXygen-user mailing list
> >> 
> >> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
> >>
> >
>



More information about the oXygen-user mailing list