Length Limit on XHTML type in a schema document.

Discussion in 'XML' started by Binesh Bannerjee, Feb 16, 2005.

  1. 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>



    --
    "Danger. Ha. I laugh in the face of Danger - then hide until it
    goes away." -- Xander, Buffy the Vampire Slayer

    PGP Key: http://www.hex21.com/~binesh/binesh-public.asc
    PGP Key fingerprint = 421D B4C2 2E96 B8EE 7190 A0CF B42F E71C 7FC3 AD96

    SSH2 Key: http://www.hex21.com/~binesh/binesh-ssh2.pub
    OpenSSH Key: http://www.hex21.com/~binesh/binesh-openssh.pub
    BubbleBabble = xibeb-voges-havez-pabaf-debop-cylil-lelyc-viruv-bygeg-zotoh-dixex
    Fingerprint = 9d:7c:84:5d:80:e3:65:8d:ee:9e:a3:b9:56:0a:e9:ad

    SSH1 Key: http://www.hex21.com/~binesh/binesh-ssh1.pub

    CipherKnight Seals:
    http://www.hex21.com/~binesh/binesh-seal.tar.bz2.cs256
    http://www.hex21.com/~binesh/binesh-seal.zip.cs256
    http://www.hex21.com/~binesh/binesh-certificate.gif.cs256
    Decrypt with CipherSaber2 N=256, Password="WelcomeJedi!" (No quotes)
    Binesh Bannerjee, Feb 16, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mike
    Replies:
    2
    Views:
    510
    Chris Smith
    Jan 14, 2005
  2. mike
    Replies:
    3
    Views:
    488
    Thomas Weidenfeller
    Jan 24, 2005
  3. Markus
    Replies:
    1
    Views:
    1,528
    Markus
    Nov 23, 2005
  4. mike
    Replies:
    6
    Views:
    1,300
    Andy Dingley
    Oct 14, 2004
  5. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,248
    Stanimir Stamenkov
    Apr 25, 2005
Loading...

Share This Page