473,382 Members | 1,107 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

DTD - enforce amount of digits

Is there a way to enforce in the DTD that the user must insert 8 digits in an attribute?

Current DTD:
Expand|Select|Wrap|Line Numbers
  1. <!ELEMENT din    EMPTY>
  2. <!ATTLIST din
  3.      code       CDATA
  4. >
The user must then enter an 8 digit number in the xml document.

Expand|Select|Wrap|Line Numbers
  1. <din code="12345678">
if the user enters <din code="12345"> it should be an error.

Hope this makes sense!

Thanks.
Dec 3 '07 #1
1 1289
jkmyoung
2,057 Expert 2GB
--edit - ah sorry, forgot you wanted dtd. Will look for an answer.

---
Expand|Select|Wrap|Line Numbers
  1. <xs:simpleType>
  2.   <xs:restriction base="xs:integer">
  3.     <xs:minInclusive value="10000000"/>
  4.     <xs:maxInclusive value="99999999"/>
  5.   </xs:restriction>
  6. </xs:simpleType>
  7.  
  8. OR 
  9.  
  10. <xs:simpleType>
  11.   <xs:restriction base="xs:string">
  12.     <xs:pattern value="[0-9]{8}"/>
  13.   </xs:restriction>
  14. </xs:simpleType>
  15.  
Dec 3 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: gino | last post by:
Dear all, My monitor was set to 1600x1200 so the fonts in IE is too small for me even when I set the "View->Text Size->Largest"... I don't have previlage to change the monitor resolution... ...
1
by: shumaker | last post by:
....please. I've found other posts that explain the Cascade options, but the Enforce relationships option still is foggy to me. As to "enforcing relationship for ... UPDATEs"(with cascade NOT...
9
by: Vjay77 | last post by:
I am working on the program where is necessary to calculate huge amount of numbers in always the same sequence. In other words, these number have to be calculated and saved into memory before the...
7
by: patang | last post by:
I want to convert amount to words. Is there any funciton available? Example: $230.30 Two Hundred Thirty Dollars and 30/100
9
by: bdog4 | last post by:
I want to validate a number to so that they can only input $2.00, 5.00, 7.00, 50.00 etc... I don't wan them to be able to put cents on the amount. It can either either be 2 or 2.00 Any ideas on...
109
by: jmcgill | last post by:
Hello. Is there a method for computing the number of digits, in a given numeric base, of N factorial, without actually computing the factorial? For example, 8! has 5 digits in base 10; 10! has...
5
by: Killer42 | last post by:
Hi all. I have a query which calculates the difference between two date/time fields. This returns a number which is, of course, useless without formatting (“I couldn’t believe it took...
1
by: magz123 | last post by:
guyz.. Is there any function in vb6 to convert amount in digits to amount in words...like e.g from Rs.450 to four hundred and fifty ... if anyone knows reply to it as soon as possible..
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.