Create Library of multiple XSD -



Create Library of multiple XSD -

i have potential of having quite lot of little xsd's containing individual types of big project. (components)

i have biggish number of xsd's requiring big number of these individual xsd's. (screens)

i know import each 1 of "components" each "screen" xsd. lot of work on each one.

what hoping import each 1 of these "components" single xsd (componentlibrary) , import 1 "componentlibrary" each "screen" xsd.

i wrote code thought may have been needed doesn't seem want work. errors undeclared.

tf.xsd:

<xs:schema targetnamespace="http://namespace.com/tf" xmlns:xs="http://www.w3.org/2001/xmlschema" elementformdefault="qualified"> <xs:complextype name="tftype"> <xs:attribute name="size" type="xs:decimal" /> <xs:attribute name="colour" type="xs:decimal" /> </xs:complextype> </xs:schema>

componentslibrary.xsd:

<xs:schema targetnamespace="http://namespace.com/componentslibrary" xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:tf="http://namespace.com/tf" elementformdefault="qualified"> <xs:import schemalocation="tf.xsd" namespace="http://namespace.com/tf"/> <xs:element name="tf" type="tf:tftype" /> </xs:schema>

screen1.xsd:

<xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:cl="http://namespace.com/componentslibrary" elementformdefault="qualified"> <xs:import schemalocation="componentslibrary.xsd" namespace="http://namespace.com/componentslibrary" /> <xs:element name="tftitle" type="cl:tf" /> </xs:schema>

error get

screen1.xsd (8:3) error type 'http://namespace.com/components:tf' not declared.

your components library schema declares element tf, not type tf, hence error in screen1.xsd.

if want create tf type available in componentlibrary utilize chameleon schema approach.

tf.xsd should have no namespace componentlibrary should include (not import) tf.xsd all types in tf.xsd available under componentlibrary namespace

xsd

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -