XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: Erado UCEI: 4.0 Re: [xml-dev] RELAX NG equivalent of <xsd:any processContents="lax">?

Sorry, it was a hacked up attempt at a simple example.  I’ll try to take more care with my next submission.

 


From: Radu Cernuta [mailto:radu.cernuta@gmail.com]
Sent: Wednesday, February 07, 2007 12:02 PM
To: Jeff Lowery
Cc: noah_mendelsohn@us.ibm.com; xml-dev@lists.xml.org
Subject: Erado UCEI: 4.0 Re: [xml-dev] RELAX NG equivalent of <xsd:any processContents="lax">?

 

I took a better look and you are right, you have also crossed rule 4.6. But if you try:

Test.rng:


<?xml version="1.0"?>
<grammar
 xmlns=" http://relaxng.org/ns/structure/1.0"

 ns=" http://foo.org/bar">

   <start>
       <ref name="children"></ref>
   </start>


   <define name="children">
       <zeroOrMore>
           <element>
               <anyName>
                   <except>

                       <nsName/>
                   </except>
               </anyName>
               <ref name="children"></ref>
           </element>

       </zeroOrMore>
       <optional>
           <ref name="interestingElements"></ref>
       </optional>
   </define>

   <define name="interestingElements">
       <choice>

           <externalRef href=""anythingElseButTest.rng"/>        </choice>
   </define>

</grammar>

You'll see there are more mistakes in the schema.

2007/2/7, Jeff Lowery <jlowery@myrio.com>:

I'm sure you're correct, however the error I get from Jing is this:

 

C:\ > java -jar \xml\jing-20030619\bin\jing.jar test.rng

C:\ > Test.rng:28:43: error: recursive inclusion of URL "file:/C:/[…]/Test.rng"


I took a better look and you are right, you have also crossed rule 4.6. But if you try:

Test.rng:


<?xml version="1.0"?>
<grammar
 xmlns=" http://relaxng.org/ns/structure/1.0"

 ns="http://foo.org/bar">

   <start>
       <ref name="children"></ref>
   </start>


   <define name="children">
       <zeroOrMore>
           <element>
               <anyName>
                   <except>

                       <nsName/>
                   </except>
               </anyName>
               <ref name="children"></ref>
           </element>

       </zeroOrMore>
       <optional>
           <ref name="interestingElements"></ref>
       </optional>
   </define>

   <define name="interestingElements">
       <choice>

           <externalRef href=""anythingElseButTest.rng"/>        </choice>
   </define>

</grammar>

You'll see there are more mistakes in the schema.
 

 

I now wonder: if all patterns are defined inside a containing grammar, could one except the container from a contained definition?  That way, all definitions would be excluded automatically when new ones were added to the container. Something I'll try later…


I'm not sure I can follow.

Radu Cernuta

 


From: Radu Cernuta [mailto:radu.cernuta@gmail.com]
Sent: Wednesday, February 07, 2007 1:56 AM
To: Jeff Lowery
Cc: noah_mendelsohn@us.ibm.com; xml-dev@lists.xml.org
Subject: Re: [xml-dev] RELAX NG equivalent of <xsd:any processContents="lax">?

 

Sorry, I've overlooked the <optional> element. Rule 4.12 comes first in this case and adds a <group>, then 7.15. The basic idea stays the same: you cannot have several roots in an XML document.




_________________________________________________
Scanned on 07 Feb 2007 20:02:45



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS