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 Bart Read <ba...@uk.lionbioscience.com> on 2003/07/23 16:48:44 UTC

Re: Parsing DTDs and converting from DTD to XML schema

Hi All,

 

 

I have a question concerning parsing DTDs.  Obviously when you use
Xerces with validation turned on it parses any DTD that is referenced.
It also parses internal subsets etc.  However, what I want it to do is
to parse JUST a DTD (and any DTDs that it references and so forth in a
recursive fashion).  So, if I give it an XML document I want it to parse
the DTD (this is no problem and I can get the results I'm looking for
now just by turning on validation) but sometimes I just want to give it
a DTD to start off with, and I'm unsure how to go about this.

 

Coupled to this I would like to take a DTD and turn it into an XML
schema.  I'm aware that I can use trang for this, but unfortunately it
doesn't handle internal subsets, so is there a way to take my DTDGrammar
and turn it into a SchemaGrammer, and having done this can I then write
this schema out to a file?

 

I've been digging through the source code for the 2.4.0 release but
there is rather a lot so I'd be extremely grateful if anybody out there
could give me a few pointers.

 

 

Many thanks,

Bart Read

 

 

 

 

 


RE: Parsing DTDs and converting from DTD to XML schema

Posted by Vinay Shukla <vi...@oracle.com>.
Could you not use an a tool like XMLSpy to convert dtd to schema? There are
quite a few tools that do this. Please check the references/tools on the w3
xml schemas page.

Thanks
Vinay
  -----Original Message-----
  From: Bart Read [mailto:bart.read@uk.lionbioscience.com]
  Sent: Wednesday, July 23, 2003 10:49 AM
  To: xerces-j-user@xml.apache.org
  Subject: Re: Parsing DTDs and converting from DTD to XML schema


  Hi All,





  I have a question concerning parsing DTDs.  Obviously when you use Xerces
with validation turned on it parses any DTD that is referenced.  It also
parses internal subsets etc.  However, what I want it to do is to parse JUST
a DTD (and any DTDs that it references and so forth in a recursive fashion).
So, if I give it an XML document I want it to parse the DTD (this is no
problem and I can get the results I'm looking for now just by turning on
validation) but sometimes I just want to give it a DTD to start off with,
and I'm unsure how to go about this.



  Coupled to this I would like to take a DTD and turn it into an XML schema.
I'm aware that I can use trang for this, but unfortunately it doesn't handle
internal subsets, so is there a way to take my DTDGrammar and turn it into a
SchemaGrammer, and having done this can I then write this schema out to a
file?



  I've been digging through the source code for the 2.4.0 release but there
is rather a lot so I'd be extremely grateful if anybody out there could give
me a few pointers.





  Many thanks,

  Bart Read