xsd - Declaring an attribute for a different namespace in XML Schema -
i've been using xml format mix of different existing formats , custom elements , attributes, , thought should write schema custom bits.
one thing use custom attributes on elements in existing formats, this:
<ns1:something atta="b" attb="a" ns2:extraatt="c"/>
i understand doing allowed cannot think how declare "extraatt" in xml schema or, worse, in dtd.
i have tried reading specification, written in chinese far concerned. tutorials talk "name", "type", , "use", e.g. this one , that one.
each schema document defines components (pieces of schema) 1 namespace. define attribute ns2:extraatt
want schema document one:
<xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema" targetnamespace="http://example.com/my-ns2"> <xs:attribute name="extraatt" type="xs:anysimpletype"/> </xs:schema>
the declaration of element ns1:something need allow attribute somehow, either attribute reference (<xs:attribute ref="ns2:extraatt"/>
) or attribute wildcard (<xs:anyattribute namespace="http://example.com/my-ns2"/>
or similar).
sorry legibility of spec; it's long story, members of wg did not think people exist ("no 1 except implementors reads spec, , long don't complain it's readable enough" -- @ least, said before implementors did complain, loudly , bitterly; changed subject).
Comments
Post a Comment