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

Re: DTD formal syntax

  • From: Patrick Ohl <Patrick.Ohl@o...>
  • To: Jim Mehl <mehl@i...>, "xml-dev@l..." <xml-dev@l...>
  • Date: Fri, 08 Jun 2001 11:46:45 +0200

javacc dtd


Jim Mehl wrote:
> 
> Thanks for the responses, but I didn't explain myself very well. I'm
> looking for a form of the syntax that is closer to what a parser
> generator might expect. Sounds like I might have to do what
> Bob DuCharme suggested (pull it out of the XML version of the
> XML spec).
> 
> I want to write something that accepts a DTD, allows you to input
> data that conforms to the DTD, and outputs the data in valid XML.
> XMLSpy does this, but not quite the way I would like.
> 
> Jim Mehl
> 

Hi,

	I use a JavaCC Grammar to parse a DTD. I wrote it myself, or stricly
speaking, copied it from the XML Specs. It works, but fails in rare
cases.
My proggy is not open source, but get the grammar at
http://www.jnerd.de/sneak/DTDParser.jj . 
This is the raw version of the grammar (the one I use in XML2Java (
http://www.jNerd.de/xml2java.html )). I didn't edited the line you do
not need. But maybe it is a better example how to use it then.

There are certain restrictions though. The grammar does not accept
comment. I filter them before pipeing the stream to the parser.

Note that you need JavaCC2.0 (
http://www.webgain.com/products/metamata/zip_files/JavaCC2_0.zip ) for
building the code.

Use the grammar freely, but please report any bugs, enhancements or
comments ( mailto:DTDGrammar@j... ).

I hope it helps you.

CU,

	PAtrick
begin:vcard 
n:Ohl;Patrick
tel;cell:+49-1708607430
tel;home:+49-89-38859084
tel;work:+49-89-358680-45
x-mozilla-html:FALSE
url:http://www.jNerd.de
adr:;;Ainmillerstr. 6;Munich;;80801;Germany
version:2.1
email;internet:Patrick.Ohl@o...
fn:Patrick Ohl
end:vcard

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.