|
From: Neal L. <ne...@3d...> - 2007-04-11 02:30:09
|
Hi Stephan,
I've started testing the new xml authoring generation/xml validation code.
I have a rnc which has an element:
level_2_button = element standard_page:level_2_button { name, value,
display_value, tool_tip?, text_item? }
display_value = attribute display_value { text }
name and value are attributes declared in goa_common
tool_tip and text_item are elements declared in goa_common
if I call:
start_level_2_button_element ("Name", "Value", "Display Value")
end_current_element
I get an exception although this element is permitted to be empty.
The generated validity statement looks like:
level_2_button_content_validity: GOA_XML_ELEMENT_SCHEMA is
-- Schema representing valid contents of a(n) level_2_button element
once
create Result.make (
create {GOA_XML_SCHEMA_ELEMENT_CONJUNCTION}.make_required (
<<
create {GOA_XML_SCHEMA_ELEMENT}.make_optional (tool_tip_element_code),
create {GOA_XML_SCHEMA_ELEMENT}.make_optional (text_item_element_code)
>>)
)
end
Shouldn't the conjunction also be make_optional?
Also, it appears that using the |= operator no longer works when
combining schemas. I noticed the template to deal with that in (I
think) flatten_2 was commented out. I just removed the only place
I'm using that operator (you may have noticed todays change in
goa_common.rnc) so fixing this is a lower priority (if it won't be
done for a while we should update the documentation accordingly).
Neal
|