Subject:Imports / Includes / Namespaces and oagis Author:Steve Cutbush Date:08 Jun 2004 03:35 AM
I having some difficulties getting my head around namespaces & Stylus,
and am hoping someone can help me out!
We are resonably new to XML, so I have downloaded the oagis schema to
get me started.
I'm basically using the schema definitions as a basis for developing our
own schema. My goal is to create a schema in MY namespace that extends the
I have created a new schema file "v1.xsd" that operates in the oagis namespace,
and defines a new complex type that "includes" two of the oagis schema files, and
basically joins two complex elements (ItemDetail and SupplierReference).
I have then created a second schema file (v2.xsd). This one Imports v1.xsd,
and defines a new element that refers to the "combination" element created in v1.xsd.
All these schema's validate in Stylus (4.6 103v) just fine, however
when I try to build an XML document around this schema I run into all
sorts issues. (Most of the namespace issues have been resolved by using
the two schema's mentioned above).
Where owgItem is my joined complex element, I get the following validation
Untitled6.xml:4,24: Unknown element 'ItemId'
Untitled6.xml:4,28: Unknown element 'Id'
Untitled6.xml:4,63: Element 'ItemId' is not valid for content model: '(ItemId?,Type?,Variation?,Status?,UOM?,UOMType?,OwnershipCode?,SerialNumberSpecification?,((LotNumberSpecification?,LotSizeMultiplier?,MinimumLotSizeQuantity?,MaximumLotSizeQuantity?))?,OrganizationalUnit?,GLEntitySource?,GLNominalAccount?,LastModifiedDateTime?,UnitPackaging?,Property*,Note*,RoutingDisposition?,HazardousMaterial?,UOMGroupId?,AlternateUOM*,Value*,((DocumentReferences?,Attachments?))?)'
I cannot work out why it says that ItemID is unknown, yet then goes on to enumerate the
content model. In some previous incarnations of this I've even had
Stylus autocompleting my tags, yet then complaining that it doesn't know about them!
Am I battling a stylus bug, or a fundamental namespace understanding issue?
Can anyone suggest a better way of handling this?
Should I just rename the oagis schema with my own version & namespace?
(I kind of thought that that would be bad!)
Thanks in anticipation,
Orlando Wyndham Group.
Subject:Imports / Includes / Namespaces and oagis Author:Alberto Massari Date:08 Jun 2004 08:58 AM
>I have created a new schema file "v1.xsd" that operates in
>the oagis namespace, and defines a new complex type
>that "includes" two of the oagis schema files, and
>basically joins two complex elements (ItemDetail and
>I have then created a second schema file (v2.xsd). This
>one Imports v1.xsd, and defines a new element that
>refers to the "combination" element created in v1.xsd.
>Given the very simple XML doc:
><?xml version='1.0' ?>
>Where owgItem is my joined complex element, I get the following validation errors:
From what I see, the schema in v2.xsd has no targetNamespace, while v1.xsd creates elements and types in the OAGIS namespace.
This means that you need to place the elements from the OAGIS schema into the right namespace, or they will not be considered as valid children of owgItem.