FW: [relaxng-user] FW: Jing & Trang errors when processing RNC gr
ammar
Hutchison, Ben
Ben.Hutchison at sensis.com.au
Wed Apr 28 13:03:14 ICT 2004
-----Original Message-----
From: John Cowan [mailto:cowan at ccil.org]
Sent: Wednesday, 28 April 2004 12:35:pm
To: Ben.Hutchison at sensis.com.au
Subject: Re: [relaxng-user] FW: Jing & Trang errors when processing RNC
grammar
[If you don't mind, forward this to relaxng-user; it's rejecting my
postings right now.]
Hutchison, Ben scripsit:
> I have developed a grammar by reading the RelaxNG tutorial, but when I
> attempt to validate it using Jing (within OxygenXML) I get an brief error
> message I cannot understand: E "oneOrMore" contains "group" contains
> "attribute"
You bumped up against one of the few restrictions of RELAX NG: you can't
have an iteration (either + or *, they produce the same message) that
contains a sequence (or interleave, same thing in this case) of attributes.
What you have written is tantamount to requesting an attribute sequence
like attribute foo, attribute bar, attribute foo, attribute bar ....
be allowed. This makes no sense, given that there can only be one
attribute of a given name in a given element.
Fortunately, the problem is easily cured by removing the first
reference to NamedElementAttribute.
> When I use the inbuilt Trang tool, I can successfully convert the compact
> grammar to XML form, but a conversion on to XML Schema results in a
message
> like "Choice between attributes and children cannot be presented;
> approximating", but no schema object is produced.
You can't expect correct results when applying Trang to a schema that
Jing rejects. The corrected version does convert to a plausible XSD schema.
> Any general advice on how to "debug" a RelexNG grammar would also be
> appreciated.
Try to avoid creating sequences/interleaves that contain both attributes
and data. They tend to be problematic.
--
Work hard, John Cowan
play hard, jcowan at reutershealth.com
die young, http://www.reutershealth.com
rot quickly. http://www.ccil.org/~cowan
www.sensis.com.au
A leading Australian advertising, information
and directories business.
www.yellowpages.com.au
www.whitepages.com.au
www.citysearch.com.au
www.whereis.com.au
www.telstra.com.au
This email and any attachments are intended only for the use of the recipient and may be confidential and/or legally privileged.
Sensis Pty Ltd disclaims liability for any errors, omissions, viruses, loss and/or damage arising from using, opening or transmitting this email.
If you are not the intended recipient you must not use, interfere with, disclose, copy or retain this email and you should notify the sender immediately by return email or by contacting Sensis Pty Ltd by telephone on [+61 3 9201 4888]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://relaxng.org/pipermail/relaxng-user/attachments/20040428/8fe7480e/attachment.htm
More information about the relaxng-user
mailing list