Binesh Bannerjee
Usenet Archive
- Joined
- Nov 27, 2004
- Messages
- 3
- Reaction score
- 0
Hi...
I've asked before about making an element in a schema be able to use xhtml... I've attached my schema definition below...
What I'm curious about, is whether there's a means to add a length restriction to the memo field in there... I want to restrict it to say 200 bytes, including tags and all... Is that possible? Something like the way I can do this for a string field? <xsd:simpleType name="fifteen"> <xsd:restriction base="xsd:string"> <xsd:maxLength value="15"/> </xsd:restriction> </xsd:simpleType>
Thanks! My schema definition follows.
Binesh
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xhtml="http://www.w3.org/1999/xhtml" version="1.0"> <xs:import namespace="http://www.w3.org/1999/xhtml" schemaLocation="xhtml1-strict.xsd" /> <xs:element name="person"> <xs:complexType> <xs:sequence> <xs:element name="name"> <xs:complexType> <xs:sequence> <xs:element name="first" type="xs:string" /> <xs:element name="last" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="memo" type="xhtml:Block" /> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
I've asked before about making an element in a schema be able to use xhtml... I've attached my schema definition below...
What I'm curious about, is whether there's a means to add a length restriction to the memo field in there... I want to restrict it to say 200 bytes, including tags and all... Is that possible? Something like the way I can do this for a string field? <xsd:simpleType name="fifteen"> <xsd:restriction base="xsd:string"> <xsd:maxLength value="15"/> </xsd:restriction> </xsd:simpleType>
Thanks! My schema definition follows.
Binesh
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xhtml="http://www.w3.org/1999/xhtml" version="1.0"> <xs:import namespace="http://www.w3.org/1999/xhtml" schemaLocation="xhtml1-strict.xsd" /> <xs:element name="person"> <xs:complexType> <xs:sequence> <xs:element name="name"> <xs:complexType> <xs:sequence> <xs:element name="first" type="xs:string" /> <xs:element name="last" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="memo" type="xhtml:Block" /> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>