Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Does XDR obey facets?

From: "Chris Lovett" <clovett@---------.---.--_---->
To: NULL
Date: 7/2/2004 3:32:00 PM
This is a multi-part message in MIME format.

------=_NextPart_000_0323_01C46049.BDABD290
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

XDR is not XSD.  You wrote XSD.  XDR looks like this:
<?xml version=3D"1.0" encoding=3D"utf-8" ?>
<Schema xmlns=3D"urn:schemas-microsoft-com:xml-data"
               xmlns:dt=3D"urn:schemas-microsoft-com:datatypes">
  <ElementType name=3D"stringTrunc" >
    <datatype dt:type=3D"string" dt:maxLength=3D"50"/>
  </ElementType>
</Schema>

And collapsing whitespace on string types is not possible in XDR.
Collapsing whitespace on numeric types in XDR is automatic.


"Christian Olsen" <cho@N...> wrote in message =
news:%23OqluQbXEHA.2716@t......
> Hi,
>=20
> I have a problem making XDR (SQLXML) mappings obey facets.
>=20
> As example I want to apply the "whiteSpace" facet to a string in XDR:
>=20
> <xsd:simpleType name=3D"stringTrunc">
>   <xsd:restriction base=3D"xsd:string" >
>   <xsd:whiteSpace value=3D"collapse"/>
>   </xsd:restriction>
> </xsd:simpleType>
>=20
> <xsd:element name=3D"title" type=3D"stringTrunc" sql:field=3D"title"/>
>=20
> This has no effect... The title field is a 50 char field with trailing
> whitespace which I want to truncate.
>=20
> Can anyone help?
>=20
> Cheers,
> Christian
>=20
> 
------=_NextPart_000_0323_01C46049.BDABD290
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1404" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>XDR is not XSD.&nbsp; You wrote =
XSD.&nbsp; XDR=20
looks like this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT color=3D#0000ff size=3D2>
<P>&lt;?</FONT><FONT color=3D#800000 size=3D2>xml</FONT><FONT =
color=3D#0000ff size=3D2>=20
</FONT><FONT color=3D#ff0000 size=3D2>version</FONT><FONT =
color=3D#0000ff=20
size=3D2>=3D</FONT><FONT size=3D2>"</FONT><FONT color=3D#0000ff =
size=3D2>1.0</FONT><FONT=20
size=3D2>"</FONT><FONT color=3D#0000ff size=3D2> </FONT><FONT =
color=3D#ff0000=20
size=3D2>encoding</FONT><FONT color=3D#0000ff size=3D2>=3D</FONT><FONT=20
size=3D2>"</FONT><FONT color=3D#0000ff size=3D2>utf-8</FONT><FONT =
size=3D2>"</FONT><FONT=20
color=3D#0000ff size=3D2> ?&gt;<BR>&lt;</FONT><FONT color=3D#800000=20
size=3D2>Schema</FONT><FONT color=3D#0000ff size=3D2> </FONT><FONT =
color=3D#ff0000=20
size=3D2>xmlns</FONT><FONT color=3D#0000ff size=3D2>=3D</FONT><FONT =
size=3D2>"</FONT><FONT=20
color=3D#0000ff size=3D2>urn:schemas-microsoft-com:xml-data</FONT><FONT=20
size=3D2>"<BR></FONT><FONT color=3D#ff0000=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;=20
xmlns:dt</FONT><FONT color=3D#0000ff size=3D2>=3D</FONT><FONT =
size=3D2>"</FONT><FONT=20
color=3D#0000ff size=3D2>urn:schemas-microsoft-com:datatypes</FONT><FONT =

size=3D2>"</FONT><FONT color=3D#0000ff size=3D2>&gt;<BR></FONT><FONT =
color=3D#0000ff=20
size=3D2>&nbsp; &lt;</FONT><FONT color=3D#800000 =
size=3D2>ElementType</FONT><FONT=20
color=3D#0000ff size=3D2> </FONT><FONT color=3D#ff0000 =
size=3D2>name</FONT><FONT=20
color=3D#0000ff size=3D2>=3D</FONT><FONT size=3D2>"</FONT><FONT =
color=3D#0000ff=20
size=3D2>stringTrunc</FONT><FONT size=3D2>"</FONT><FONT color=3D#0000ff =
size=3D2>=20
&gt;<BR></FONT><FONT color=3D#0000ff size=3D2>&nbsp;&nbsp;&nbsp; =
&lt;</FONT><FONT=20
color=3D#800000 size=3D2>datatype</FONT><FONT color=3D#0000ff size=3D2> =
</FONT><FONT=20
color=3D#ff0000 size=3D2>dt:type</FONT><FONT color=3D#0000ff =
size=3D2>=3D</FONT><FONT=20
size=3D2>"</FONT><FONT color=3D#0000ff size=3D2>string</FONT><FONT=20
size=3D2>"</FONT><FONT color=3D#0000ff size=3D2> </FONT><FONT =
color=3D#ff0000=20
size=3D2>dt:maxLength</FONT><FONT color=3D#0000ff =
size=3D2>=3D</FONT><FONT=20
size=3D2>"</FONT><FONT color=3D#0000ff size=3D2>50</FONT><FONT =
size=3D2>"</FONT><FONT=20
color=3D#0000ff size=3D2>/&gt;<BR></FONT><FONT color=3D#0000ff =
size=3D2>&nbsp;=20
&lt;/</FONT><FONT color=3D#800000 size=3D2>ElementType</FONT><FONT =
color=3D#0000ff=20
size=3D2>&gt;<BR></FONT><FONT color=3D#0000ff size=3D2>&lt;/</FONT><FONT =
color=3D#800000=20
size=3D2>Schema</FONT><FONT color=3D#0000ff =
size=3D2>&gt;</P></FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>And collapsing whitespace on string =
types is not=20
possible in XDR.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Collapsing whitespace on numeric types =
in XDR is=20
automatic.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>"Christian Olsen" &lt;</FONT><A=20
href=3D"mailto:cho@N..."><FONT face=3DArial=20
size=3D2>cho@N...</FONT></A><FONT face=3DArial size=3D2>&gt; =
wrote in message=20
</FONT><A href=3D"news:%23OqluQbXEHA.2716@t..."><FONT =
face=3DArial=20
size=3D2>news:%23OqluQbXEHA.2716@t...</FONT></A><FONT =
face=3DArial=20
size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>&gt; Hi,<BR>&gt; =
<BR>&gt; I have=20
a problem making XDR (SQLXML) mappings obey facets.<BR>&gt; <BR>&gt; As =
example=20
I want to apply the "whiteSpace" facet to a string in XDR:<BR>&gt; =
<BR>&gt;=20
&lt;xsd:simpleType name=3D"stringTrunc"&gt;<BR>&gt; &nbsp; =
&lt;xsd:restriction=20
base=3D"xsd:string" &gt;<BR>&gt; &nbsp; &lt;xsd:whiteSpace=20
value=3D"collapse"/&gt;<BR>&gt; &nbsp; &lt;/xsd:restriction&gt;<BR>&gt;=20
&lt;/xsd:simpleType&gt;<BR>&gt; <BR>&gt; &lt;xsd:element name=3D"title"=20
type=3D"stringTrunc" sql:field=3D"title"/&gt;<BR>&gt; <BR>&gt; This has =
no effect...=20
The title field is a 50 char field with trailing<BR>&gt; whitespace =
which I want=20
to truncate.<BR>&gt; <BR>&gt; Can anyone help?<BR>&gt; <BR>&gt; =
Cheers,<BR>&gt;=20
Christian<BR>&gt; <BR>&gt; </FONT></BODY></HTML>

------=_NextPart_000_0323_01C46049.BDABD290--



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent