|
#1
|
|||
|
|||
|
xsd:string
Does anyone know if you can asign a maxlength for an type="xsd:string" element in a XML schema? I need to limit the length of the value for a particular element in my document Regards Jaco de Villiers |
|
#2
|
|||
|
|||
|
Re: xsd:string
The new W3C XSD definition supports it "Jaco de Villiers" <jacodv_32@hotmail.com> wrote: > >Does anyone know if you can asign a maxlength for an type="xsd:string" element >in a XML schema? I need to limit the length of the value for a particular >element in my document > >Regards > >Jaco de Villiers |
|
#3
|
|||
|
|||
|
Re: xsd:string
"Jaco de Villiers" <jacodv_32@hotmail.com> wrote: > >The new W3C XSD definition supports it > >"Jaco de Villiers" <jacodv_32@hotmail.com> wrote: >> >>Does anyone know if you can asign a maxlength for an type="xsd:string" element >>in a XML schema? I need to limit the length of the value for a particular >>element in my document >> >>Regards >> >>Jaco de Villiers > Both XML Schema (W3C) and XML Data Reduced (xdr) support constraining "facets" for the string data type (and both techniques are very similar). In the case of XML Schemas "xsd:string", the most common facets are: 1) <xsd:length = ""> where the length facet value is a bounded constraint (representing both minium and maximum) 2) <xsd:minLength = ""> where the minLength facet value is the minimum length (fairly obvious from the facet name). 3) <xsd:maxLength = ""> where the maxLength facet value is the maximum length (again, fairly obvious from the facet name). In the case of XML Data Reduced "dt:type="string", the most common facets are: 1) dt:minLength = "" (declared as an attribute of the ElementType) 2) dt:maxLength = "" (declared as an attribute of the ElementType) There are also other facets available for "xsd:string". Best advice... take a look at the current W3C recommendation for XML Schemas. As you might expect, parser support for xdr data typing and facets varies. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|