Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Does XDR obey facets? [Thread Next] Re: Does XDR obey facets?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. You wrote =
XSD. XDR=20
looks like this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT color=3D#0000ff size=3D2>
<P><?</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> ?><BR><</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> &nbs=
p; =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>><BR></FONT><FONT =
color=3D#0000ff=20
size=3D2> <</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
><BR></FONT><FONT color=3D#0000ff size=3D2> =
<</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>/><BR></FONT><FONT color=3D#0000ff =
size=3D2> =20
</</FONT><FONT color=3D#800000 size=3D2>ElementType</FONT><FONT =
color=3D#0000ff=20
size=3D2>><BR></FONT><FONT color=3D#0000ff size=3D2></</FONT><FONT =
color=3D#800000=20
size=3D2>Schema</FONT><FONT color=3D#0000ff =
size=3D2>></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> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>"Christian Olsen" <</FONT><A=20
href=3D"mailto:cho@N..."><FONT face=3DArial=20
size=3D2>cho@N...</FONT></A><FONT face=3DArial size=3D2>> =
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>> Hi,<BR>> =
<BR>> I have=20
a problem making XDR (SQLXML) mappings obey facets.<BR>> <BR>> As =
example=20
I want to apply the "whiteSpace" facet to a string in XDR:<BR>> =
<BR>>=20
<xsd:simpleType name=3D"stringTrunc"><BR>> =
<xsd:restriction=20
base=3D"xsd:string" ><BR>> <xsd:whiteSpace=20
value=3D"collapse"/><BR>> </xsd:restriction><BR>>=20
</xsd:simpleType><BR>> <BR>> <xsd:element name=3D"title"=20
type=3D"stringTrunc" sql:field=3D"title"/><BR>> <BR>> This has =
no effect...=20
The title field is a 50 char field with trailing<BR>> whitespace =
which I want=20
to truncate.<BR>> <BR>> Can anyone help?<BR>> <BR>> =
Cheers,<BR>>=20
Christian<BR>> <BR>> </FONT></BODY></HTML>
------=_NextPart_000_0323_01C46049.BDABD290--
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
