Home > Archive > MS SQL XML > January 2006 > xs:import does not work in SQLServer2005???









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author xs:import does not work in SQLServer2005???
John

2006-01-19, 8:24 pm

Hi,
I got the following message
Msg 2308, Level 16, State 1, Line 1
Reference to an undefined name 'Polygon' within namespace
'http://www.opengis.net/gml'

Thanks in advice for any advice.
John


alter XML SCHEMA COLLECTION DDMDDMS1 add
N'<?xml version="1.0" ?>
<xs:schema targetNamespace="http://metadata/test/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://metadata/test/"
xmlns:gml="http://www.opengis.net/gml"
elementFormDefault="qualified"
attributeFormDefault
="qualified">
<xs:import namespace="http://www.opengis.net/gml"
schemaLocation="DDMS_GML_Redefine.xsd" />
<xs:element name="boundingGeometry" type=" BoundingGeometryType
" />
<xs:complexType name=" BoundingGeometryType
">
<xs:choice maxOccurs="unbounded">
<xs:element ref="gml:Polygon" />
<xs:element ref="gml:Point" />
</xs:choice>
</xs:complexType>

</xs:schema>'

Michael Rys [MSFT]

2006-01-19, 8:24 pm

The schema that you import has to be part of the same XML Schema collection.

You can add it to the schema collection either in a previous statement or in
the same....

Best regards
Michael

"John" <johnxhc@yahoo.com> wrote in message
news:1137698692.672466.156940@g47g2000cwa.googlegroups.com...
> Hi,
> I got the following message
> Msg 2308, Level 16, State 1, Line 1
> Reference to an undefined name 'Polygon' within namespace
> 'http://www.opengis.net/gml'
>
> Thanks in advice for any advice.
> John
>
>
> alter XML SCHEMA COLLECTION DDMDDMS1 add
> N'<?xml version="1.0" ?>
> <xs:schema targetNamespace="http://metadata/test/"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns="http://metadata/test/"
> xmlns:gml="http://www.opengis.net/gml"
> elementFormDefault="qualified"
> attributeFormDefault
="qualified">
> <xs:import namespace="http://www.opengis.net/gml"
> schemaLocation="DDMS_GML_Redefine.xsd" />
> <xs:element name="boundingGeometry" type=" BoundingGeometryType
" />
> <xs:complexType name=" BoundingGeometryType
">
> <xs:choice maxOccurs="unbounded">
> <xs:element ref="gml:Polygon" />
> <xs:element ref="gml:Point" />
> </xs:choice>
> </xs:complexType>
>
> </xs:schema>'
>



John

2006-01-19, 8:24 pm

Thanks for the quick reply, question:
are you telling me that I need to add all the other schema I referenced
into the schema collection?
there what is xs:import and schemaLocation?
please advice.

John
Michael Rys [MSFT] wrote:[color=darkred
]
> The schema that you import has to be part of the same XML Schema collection.
>
> You can add it to the schema collection either in a previous statement or in
> the same....
>
> Best regards
> Michael
>
> "John" <johnxhc@yahoo.com> wrote in message
> news:1137698692.672466.156940@g47g2000cwa.googlegroups.com...

Brandon Berg [MSFT]

2006-01-19, 8:24 pm

"John" <johnxhc@yahoo.com> wrote in message
news:1137709075.111277.167100@g44g2000cwa.googlegroups.com...
> are you telling me that I need to add all the other schema I referenced
> into the schema collection?


Yes. Other than the built-in namespaces (XSD types, SQL types, and XML
attributes), you cannot reference a foreign schema component until you've
added it the same schema collection.

> there what is xs:import and schemaLocation?


Xs:import is necessary to tell the schema processor that you will be
referencing a component in a different namespace. If you don't have it, then
you will not be able to reference GML components even if you have added the
GML schema to your schema collection. The schemaLocation attribute is always
ignored, because we can't use components in a schema that hasn't been added
to your schema collection.

--
Brandon Berg
Software Design Engineer
Microsoft SQL Server


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com