Friday, February 17, 2012

Does XDR obey facets?

Hi,
I have a problem making XDR (SQLXML) mappings obey facets.
As example I want to apply the "whiteSpace" facet to a string in XDR:
<xsd:simpleType name="stringTrunc">
<xsd:restriction base="xsd:string" >
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="title" type="stringTrunc" sql:field="title"/>
This has no effect... The title field is a 50 char field with trailing
whitespace which I want to truncate.
Can anyone help?
Cheers,
Christian
The short answer is no - the schema is used for mapping information but the
data isn't validated against the schema.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Christian Olsen" <cho@.NOT.AVAILABLE> wrote in message
news:%23MQYi8nXEHA.2216@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I have a problem making XDR (SQLXML) mappings obey facets.
> As example I want to apply the "whiteSpace" facet to a string in XDR:
> <xsd:simpleType name="stringTrunc">
> <xsd:restriction base="xsd:string" >
> <xsd:whiteSpace value="collapse"/>
> </xsd:restriction>
> </xsd:simpleType>
> <xsd:element name="title" type="stringTrunc" sql:field="title"/>
> This has no effect... The title field is a 50 char field with trailing
> whitespace which I want to truncate.
> Can anyone help?
> Cheers,
> Christian
>
>

No comments:

Post a Comment