XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Aung MonSubject: How to Define DTD in my XML Document?
Author: Aung Mon
Date: 16 Feb 2005 01:40 AM
How can i define dtd in following xml document phone no and email addr are optional:

<contact>
<name>Aung Mon</name>
<address>
<no>38</no>
<street>Main</street>
<ward>2</ward>
<township>Sanchaung</township>
<state>Yangon</state>
<country>Myanmar</country>
</address>
<phone>
<option_1>0723472130</option_1>
<option_2>95-1-518854</option_2>
<option_3>95-1-560874</option_3>
</phone>
<email>
<option_1>amon@mail2rock.com</option_1>
<option_2>amchtwe@gmail.com</option_2>
<option_3>aung@altechlanka.com</option_3>
</email>
</contact>

Posttop
Ivan PedruzziSubject: How to Define DTD in my XML Document?
Author: Ivan Pedruzzi
Date: 16 Feb 2005 06:33 PM
- Open the document in Stylus Studio
- click XML -> "create Schema from XML content"
- choose "Internal DTD"

By default Stylus Studio creates the contact children mandatory so
change this

<!ELEMENT contact (name,address,email,phone)>

to this

<!ELEMENT contact (name,address,email?,phone?)>

Hope this helps

Ivan

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.