schema collection problem?
- From: Mark <mmodrall@xxxxxxxxxxxxx>
- Date: Wed, 27 Dec 2006 11:09:00 -0800
Hi...
I've been playing with some samples and I've noticed something that looks
like a bug. I created a schema collection like this:
create xml schema collection testcoll2 as
'<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpleType name="noContent">
<xsd:restriction base="xsd:string">
<xsd:length value="1" />
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" xmlns="http://ex.org/LogansRun"
targetNamespace="http://ex.org/LogansRun">
<xsd:element name="age">
<xsd:simpleType>
<xsd:restriction base="xsd:float">
<xsd:minInclusive value="0" />
<xsd:maxInclusive value="30" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:schema>'
but when I fetch a schema back out, the return drops the elementFormDefault
value; this seems like it could lead to some serious problems if one wants to
use SQL Server 2005 as a schema store for other applications. Any idea why
SQL Server isn't returning a functionally equivalent schema to what's put in?
Here's what is returned by
select xml_schema_namespace ('dbo','testcoll2')
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpleType name="noContent">
<xsd:restriction base="xsd:string">
<xsd:length value="1" />
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:t="http://ex.org/LogansRun" targetNamespace="http://ex.org/LogansRun">
<xsd:element name="age">
<xsd:simpleType>
<xsd:restriction base="xsd:float">
<xsd:minInclusive value="0" />
<xsd:maxInclusive value="30" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:schema>
I haven't done other tests to see whether the changing of my default
namespace designation to a named one (xmlns="" to xmlns:t="") would cause
problems; I haven't put in any refs or other examples to exercise that. But
the omission of the elementFormDefault="qualified" seems like a significant
functional discrepancy.
any thoughts?
Thanks
-mark
.
- Prev by Date: RE: Thoughts on storing address data with XML data type?
- Next by Date: RE: Thoughts on storing address data with XML data type?
- Previous by thread: OPENXML and subDocuments
- Next by thread: RE: schema collection problem?
- Index(es):
Relevant Pages
|