[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: How to validate the field length in DTD

Subject: Re: How to validate the field length in DTD
From: "John E. Simpson" <simpson@xxxxxxxxxxx>
Date: Mon, 24 Jan 2000 15:24:43 -0500
dtd field length
At 02:24 PM 01/24/2000 -0500, Con_Shravan Gunda wrote:
How can i validate the field length in DTD ??

<phonenumber>1234567890</phonenumber>

How can i write a DTD which validates the field length of phonenumber should
be 10.

The answer to this is the same as the answer to your question of last week (about how to validate a numeric datatype): in short, you can't using a plain old DTD. If each digit were its own element, you might be able to do something like:
<!ELEMENT phonenum (digit,digit,digit,digit,digit,
digit,digit,digit,digit,digit) >
which limits it to 10 "digit" child elements. But then (aside from the fact that it will be horrible to create documents like this, at least manually) you're stuck defining *them*, the digit elements themselve -- the best you can do is:
<!ELEMENT digit (#PCDATA) >
which doesn't limit the length at all.


Also like your question of last week, this is very much off-topic for XSL-List. You need to be asking these questions on XML-L. To subscribe to that list, or access its archives, go to:
http://listserv.heanet.ie/xml-l.html


===================================================================
John E. Simpson            |  I spilled spot remover on my dog.
simpson@xxxxxxxxxxx        |  He's gone now.
http://www.flixml.org      |  (Stephen Wright)


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.