Re: How to allow html tags and restrict number of characters‏

  Another use case for XSD 1.1 assertions:

<xs:assert test="string-length(.) le 50000"/>

It can't be done in XSD 1.0.

(I would question whether it *should* be done. I find it hard to think 
of a good reason for designing a system with this limit in it. But 
that's another question.)

Michael Kay
Saxonica

On 07/10/2010 2:58 PM, Vani Gupta wrote:
> Hello All,
>
> I am in the process of developing an XSD.
>
> I have requirement, there is a tag which should allow html tags in it, it is a description field, users can enter any text with bold, italics, paragraphs etc.
>
> And the filed length should be 50,000 characters.
>
> How do I achieve this in xsd?
>
> Any suggestions are much appreciated.
>
> So far I managed to allow html tags but not able to restrict the number of characters.
>
> Please find part of my xsd
>
> <xsd:complexType name="htmltagsok">
> <xsd:sequence>
> <xsd:element xmlns:q1="http://www.w3.org/1999/xhtml" ref="q1:body" minOccurs="0" />
> </xsd:sequence>
> </xsd:complexType>
>
>
> <xsd:element name="Conclusion" type="htmltagsok" />
>
> Regards,
>
>
>
>
>
>
>
>

Received on Friday, 8 October 2010 08:08:57 UTC