Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   XML (http://www.velocityreviews.com/forums/f32-xml.html)
-   -   Help please...How to import a schema with a different namespace? (http://www.velocityreviews.com/forums/t167718-help-please-how-to-import-a-schema-with-a-different-namespace.html)

Ingrid 08-23-2004 02:06 PM

Help please...How to import a schema with a different namespace?
 
I am looking to incorporate Schema 1 (below) into Schema 2, using the
<import> element. But I just can't figure out how to declare the in:
namespace prefix/use targetNamespace correctly - for both Schemas...

Any ideas? Please put me out of my misery - somebody...

As soon as I add the targetNamespace="http://num/in"> in Schema 1 both
Schemas throw up the following error message:

Error resolving component 'numType'. It was detected that 'numType'
has no namespace, but components with no target namespace are not
referenceable from schema document "Schema 1". If 'numType' is
intended to have a namespace, perhaps a prefix needs to be provided.
If it is intended that 'numType' has no namespace, then an 'import'
without a "namespace" attribute should be added to "Schema 1".

Schema 2:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema elementFormDefault="qualified"
attributeFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:in="http://num/in">
<xs:import namespace="http://num/in"
schemaLocation="Num.xsd"></xs:import>
<xs:element name="num">
<xs:complexType>
<xs:sequence>
<xs:element ref="in:num"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>


Schema 1:
<in:schema xmlns:in="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://num/in">
<in:element name="num" type="numType"></in:element>
<in:complexType name="numType">
<in:simpleContent>
<in:extension base="pageRange">
<in:attribute name="type" use="required">
<in:simpleType>
<in:restriction base="in:string">
<in:enumeration
value="pagerange"></in:enumeration>
</in:restriction>
</in:simpleType>
</in:attribute>
</in:extension>
</in:simpleContent>
</in:complexType>
<in:simpleType name="pageRange">
<in:restriction base="in:string">
<in:minLength value="3"></in:minLength>
<in:maxLength value="7"></in:maxLength>
<in:pattern value="\d{1,3}-\d{1,3}"></in:pattern>
</in:restriction>
</in:simpleType>
</in:schema>


All times are GMT. The time now is 12:42 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.