[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: RE: [relax-ng] Compact syntax issue: namespace declarations
I don't believe "live with it" will work. local {...} is good, though I also like John Cowan's syntax change [1], that is (1) placing the declaration /outside/ the braces, and (2) allowing multiple declarations. Mike [1] http://lists.oasis-open.org/archives/relax-ng/200204/msg00020.html -----Original Message----- From: James Clark [mailto:jjc@jclark.com] Sent: Tuesday, April 02, 2002 10:03 PM To: RELAX NG Mailing List Subject: [relax-ng] Compact syntax issue: namespace declarations At the moment, the compact syntax allows only file-level namespace declarations. This creates a problem in translating from the XML syntax to the non-XML syntax. If a schema in the XML syntax uses prefixes inconsistently (which is not disallowed either by XML or RELAX NG), then it becomes difficult/impossible to translate it automatically to the non-XML syntax. The translator cannot simply rename the prefixes, because the in-scope namespaces might be significant for an annotation or for a <value>. For example, <group> <element name="foo" p:assert="count(.//x:foo) = 17" xmlns:x="http://www.example.com/1"> <ref name="foo"/> </element> <element name="bar" p:assert="count(.//x:foo) = 17" xmlns:x="http://www.example.com/2"> <ref name="bar"/> </element> </group> There are two basic solutions: 1. Live with it. Schemas in the XML syntax that use prefixes inconsistently may not be translatable into the non-XML syntax. 2. Solve it by providing a syntax for local namespace declarations, e.g. local { namespace x = "http://www.example.com/1" [ p:assert="count(.//x:foo) = 17" ] element foo { foo } }, local { namespace x = "http://www.example.com/2" [ p:assert="count(.//x:foo) = 17" ] element bar { bar } } James ---------------------------------------------------------------- To subscribe or unsubscribe from this elist use the subscription manager: <http://lists.oasis-open.org/ob/adm.pl>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC