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

RE: Writing a DTD

  • From: johns@s... (John F. Schlesinger)
  • To: 'Pramod Rao Pesara' <ppesara@c...>, xml-dev@l...
  • Date: Tue, 07 Nov 2000 17:03:15 -0500

writing a dtd
Pramod asked for help writing a DTD for:
	Expression  ::=  "(" "lambda" text1 text2 ")"

I assume that what you are asking for is a DTD to describe an XML syntax for
representing a grammar where left and right parenthesis and lambda are
special characters. In addition, 'Expression' and '::=' have special
meaning. On the other hand, text1 and text2 are place holders for some kind
of text.

One XML representation of the line above might, therefore, be:

<expression>
	<parenthesis>
		<lambda/>
		<text/>
		<text/>
	</parenthesis>
</expression>

with a DTD of

<!ELEMENT expression  (parenthesis )>
<!ELEMENT parenthesis  (lambda , text+ )>
<!ELEMENT lambda EMPTY>
<!ELEMENT text EMPTY>

I have assumed that "(" and ")" always balance. If this is not the case,
then the following is better:

<expression>
	<lparenthesis/>
	<lambda/>
	<text/>
	<text/>
	<rparenthesis/>
</expression>

with a DTD of:

<!ELEMENT expression  (lparenthesis, lambda , text+, rparenthesis)>
<!ELEMENT lparenthesis EMPTY>
<!ELEMENT lambda EMPTY>
<!ELEMENT text EMPTY>
<!ELEMENT rparenthesis EMPTY>

Yours,
John F Schlesinger
SysCore Solutions
212 619 5200 x 219
917 886 5895 Mobile

-----Original Message-----
From: Pramod Rao Pesara [mailto:ppesara@c...]
Sent: Friday, November 03, 2000 10:55 AM
To: xml-dev@l...
Subject: Writing a DTD


 Hi,
    I new to XMl and just learning to write DTDs. Could anyone please help
me in writing a DTD for the following Grammar. Here "lamda", "(" and
,")" are keywords and text1 and test2 can be any character data.

    Expression  ::=  "(" "lambda" text1 text2 ")"

Thank You.
Pramod



  • References:

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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.