xsd - Delimiters in XML-namespaces - relative import of namespaces -
i have conceptual question concerning xml-namespaces: if have 2 different xsd-files in folder hierarchy:
filea.xsd folder/ fileb.xsd
and in each of 2 files, defined separate namespace targetnamespace attribute:
in filea.xsd be
targetnamespace="http://www.anurlofmine.com/myproject/a"
and in fileb.xsd be:
targetnamespace="http://www.anurlofmine.com/myproject/folder/b"
can utilize path in th eurl relative imports ?
could illustration use
<xs:schema xmlns:relativea="../a">
in fileb.xsd ?
i'm not concerned way it, know there kinds of ways specify location of schema definition, i'm simply concerned meaning of path in url.
as far know, url string used uniquely identify types in xsd files (besides of specifying place 1 might - no guarantee - definition file). right ?
hopefully question not weird answered :)
thanks lot in advance mischa
the schema location hint in schemalocation attribute on import , include elements in xsd schema documents specified beingness of type xs:anyuri, , means yes, can relative reference.
so in fileb.xsd, can have import statement of form
<xs:import namespace="http://www.anurlofmine.com/myproject/a" schemalocation="../filea.xsd"/>
the value of namespace declaration (such xmlns:relativea
in example), on other hand, expected absolute uri, not relative uri. many programs not check namespace names legality uris, using "../a" namespace name won't raise error. foundational w3c specs defining xml technology stack specify info set document utilize relative uris namespace names undefined.
in case, adding namespace declaration xs:schema element not have effect of importing namespace or referring schema document might @ location indicated.
namespaces xsd relative-import
No comments:
Post a Comment