[relaxng-user] E "oneOrMore" contains "group" contains "attribute"
again...
Hutchison, Ben
Ben.Hutchison at sensis.com.au
Tue May 4 12:28:05 ICT 2004
I have some further questions related to the issues I had last week in a
thread "Jing & Trang errors when processing RNC grammar".
I have read 7.1.2 of the spec and now appreciate the above pattern is
forbidden. However, what I have not found is any examples showing
alternatives approaches where you do need to specify that attributes be
present on members of a repeated subgroup.
Bob Foster's suggested fix to my original schema is shown below. Note that
the NamedElementAttributes are specified for ConfigGroups. I also require a
name attribute to be present for all elements in the ConfigValue group as
well, but when I include this it becomes an illegal grammar. At the same
time, I don't want a top-level blanket requirement of a name attribute for
every element in the grammar, because eg array elements are not named.
Does anyone have a reliable approach or "algorithm" for specifying
attributes in these sorts of situations?
Regards
Ben
namespace rng = "http://relaxng.org/ns/structure/1.0"
datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
start = element ConfigRoot { ConfigGroup* }
NamedElementAttributes =
attribute name { text },
attribute platform { text }?
StringValue = element StringValue { xsd:string }
IntValue = element IntValue { xsd:integer }
FloatValue = element FloatValue { xsd:float }
BooleanValue = element BooleanValue { xsd:boolean } PrimitiveValue =
(StringValue | IntValue | FloatValue | BooleanValue)
Map = element Map { (MapEntry)* }
MapEntry = element MapEntry { PrimitiveValue }
Array = element Array { (PrimitiveValue)* }
ConfigValue = ( PrimitiveValue | Map | Array )
ConfigGroupEntry = (ConfigGroup | ConfigValue)
ConfigGroup = element ConfigGroup {
ConfigGroupEntry*,
NamedElementAttributes
}
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/20040504/362ef832/attachment.htm
More information about the relaxng-user
mailing list