You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Artur Lorincz <ar...@art-net.ro> on 2001/12/06 10:02:47 UTC

DTD parsing

Hello,

I would like to ask whether it is possible to read in stand-alone DTDs with xerces - not an xml file, but only the DTD. In the case this is possible, is there any sample code, or documentation about how could I program this.

thank you in advance,
   drs. Artur Lorincz

Re: DTD parsing

Posted by Artur Lorincz <ar...@art-net.ro>.
Hello,

For those who still have problems parsing DTDs with xerces I submit a sample
class.
The idea behind it is similar to Adam's idea. The class is a modifies
version of DTDReader from the sax package from xercesSamples:  now it takes
as argument a DTD not an XML file.

Compile it and you can run it directly.

cheers,
  Artur

Re: DTD parsing

Posted by Artur Lorincz <ar...@art-net.ro>.
Hello,

Thank you very much Adam..

Actually I implemented today DTDParsing exactly as you are describing in
your mail.I did it with xerces 1.4.4 so the idea works.

thanks for your help,

Artur


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: DTD parsing

Posted by Adam Najmanowicz <ad...@stardock.com>.
I know it may not be the most elegant way to retrieve the DTD info by
forcing xerces to parse some fake String and append the DTD filename like
this.
I avoided putting the DTD filename in the parsed text by implementing my own
caching EntityResolver but it would only make the sample more confusing if
added here.

Look at the main method to see how to plug it into Xerces.
You may also drop the LexicalHandler interface if you do not need to
retrieve the comments.

It have been tested on Xerces 1.3.0 and 1.3.1 but i belive it will also work
on any 1.4.x

Adam

----- Original Message -----
From: "Artur Lorincz" <ar...@art-net.ro>
To: <xe...@xml.apache.org>
Sent: Friday, December 07, 2001 8:22 AM
Subject: Re: DTD parsing


> Thank you. Actually I am using this DTD parser now. And I want to switch
to
> xerces.
>
> thanks,
> Artur
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>

Re: DTD parsing

Posted by Artur Lorincz <ar...@art-net.ro>.
Thank you. Actually I am using this DTD parser now. And I want to switch to
xerces.

thanks,
Artur



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: DTD parsing

Posted by Wendi Sisson <ws...@east.fedex.com>.
http://www.wutka.com/dtdparser.html

> Artur Lorincz wrote:
> 
> Hello,
> 
> I would like to ask whether it is possible to read in stand-alone DTDs
> with xerces - not an xml file, but only the DTD. In the case this is
> possible, is there any sample code, or documentation about how could I
> program this.
> 
> thank you in advance,
>    drs. Artur Lorincz

-- 
Wendi Sisson
Systems Programmer
International Trade Development
FedEx Services
(901) 263-6695

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: DTD parsing

Posted by Artur Lorincz <ar...@art-net.ro>.
Hello,

That is exactly what I need. I would greatly appretiate having it.

thanks for the reply,
  Artur

Re: DTD parsing

Posted by Adam Najmanowicz <ad...@stardock.com>.
I asked the same question here about a week ago with no effect, but after a day or two of reverse-engineering the source code (i feel sorry for anyone passing through all this) i've managed to create an implementation that is able to retrieve the list of entities, elements and attributes, Let me know if that's what you want to have .

Adam

----- Original Message ----- 
  From: Artur Lorincz 
  To: xerces-j-user@xml.apache.org 
  Sent: Thursday, December 06, 2001 2:34 PM
  Subject: Re: DTD parsing


  thank you very much. i will look into it.

  thanks
  Artur

Re: DTD parsing

Posted by Artur Lorincz <ar...@art-net.ro>.
thank you very much. i will look into it.

thanks
Artur

RE: DTD parsing

Posted by Aleksandr Shneyderman <al...@law.columbia.edu>.
I was lloking for one too but with no success. There are
some out there but they all are limited in one way or another.

I just lloked at Sun's web site there is a technology called
JAXB that takes your DTD and converts it to Java classes
that will validate a document for you. Since DTDs do not
change that often it mihgt be a good thing, but I have not
used it yet just read about it.

Alex.
  -----Original Message-----
  From: Artur Lorincz [mailto:artur@art-net.ro]
  Sent: Thursday, December 06, 2001 4:03 AM
  To: xerces-j-user@xml.apache.org
  Cc: Bledea Cristian
  Subject: DTD parsing


  Hello,

  I would like to ask whether it is possible to read in stand-alone DTDs
with xerces - not an xml file, but only the DTD. In the case this is
possible, is there any sample code, or documentation about how could I
program this.

  thank you in advance,
     drs. Artur Lorincz