469,609 Members | 1,687 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

Converting XSD into DTD?

Hello,

does anyone know of a way/solution how to convert XML Schema documents into
DTD? I am aware of the fact that such a conversion won't be possible under
certain circumstances and that probably some information loss will occur
(esp. data types). However, in many cases it should be possible to obtain
at least the structure of the XSD.

Any help would be greatly appreciated. Thanks in advance.
--
Michael Wein
Jul 20 '05 #1
10 22188
Michael Wein wrote:
does anyone know of a way/solution how to convert XML Schema documents into
DTD? I am aware of the fact that such a conversion won't be possible under
certain circumstances and that probably some information loss will occur
(esp. data types). However, in many cases it should be possible to obtain
at least the structure of the XSD.


Hi Michael,

XMLSpy 2004 supports the conversion between XSD and DTD (Menu:
"DTD/Schema"->"Convert DTD/Schema...").

HTH,

Dirk
--
There are 10 people in the world.
Those who understand binary and those who don't.
Jul 20 '05 #2
On Fri, 27 Feb 2004 06:54:13 +0100, Dirk Segelhorst wrote:
XMLSpy 2004 supports the conversion between XSD and DTD (Menu:
"DTD/Schema"->"Convert DTD/Schema...").


Hi Dirk,

thank you for the quick reply. But as we don't have XML Spy at hand we have
to look for a different solution.
--
Michael Wein
Jul 20 '05 #3
Michael Wein wrote:
On Fri, 27 Feb 2004 06:54:13 +0100, Dirk Segelhorst wrote:

XMLSpy 2004 supports the conversion between XSD and DTD (Menu:
"DTD/Schema"->"Convert DTD/Schema...").

Hi Dirk,

thank you for the quick reply. But as we don't have XML Spy at hand we have
to look for a different solution.


Hi Michael,

perhaps you give the W3C dtd2xsd conversion tool a try:
http://www.w3.org/2000/04/schema_hack/

It is free, but I do not know if it is as mighty as the XMLSpy conversion.

Dirk

--
There are 10 people in the world.
Those who understand binary and those who don't.
Jul 20 '05 #4
On Fri, 27 Feb 2004 09:43:50 +0100, Dirk Segelhorst wrote:
perhaps you give the W3C dtd2xsd conversion tool a try:
http://www.w3.org/2000/04/schema_hack/

It is free, but I do not know if it is as mighty as the XMLSpy conversion.


Well, it is actually for the wrong direction -- as fas as I can see, it
converts DTD into XSD. For that purpose there exist several other (free)
tools (e.g. Syntext's dtd2xs).

In the mean time I found dtd2xsd.xsl
(http://crism.maden.org/consulting/pub/xsl/xsd2dtd.xsl), a simple style
sheet. We will have a closer look at it.
--
Michael Wein
Jul 20 '05 #5
Michael Wein wrote:
Well, it is actually for the wrong direction


Sorry... I had a too fast look at it ;o) Just had it in my bookmarks.

Why don't you parse the XSD and generate the DTD yourself? Should not be
too hard if you use an XSD Object Model (have a look at the XSD part of
Xerces or the XSD Tool in Eclipse).

Dirk.
--
There are 10 people in the world.
Those who understand binary and those who don't.
Jul 20 '05 #6
On Fri, 27 Feb 2004 06:54:13 +0100, Dirk Segelhorst wrote:
XMLSpy 2004 supports the conversion between XSD and DTD (Menu:
"DTD/Schema"->"Convert DTD/Schema...").


Just downloaded XML Spy and tried that "feature". The DTD generated is
completely useless (not to say: crap). E.g. it generated !ATTLIST for
complex types!? I fear that won't work. :-(
--
Michael Wein
Jul 20 '05 #7
On Fri, 27 Feb 2004 17:12:58 +0100, Michael Wein wrote:
On Fri, 27 Feb 2004 06:54:13 +0100, Dirk Segelhorst wrote:
XMLSpy 2004 supports the conversion between XSD and DTD (Menu:
"DTD/Schema"->"Convert DTD/Schema...").


Just downloaded XML Spy and tried that "feature". The DTD generated is
completely useless (not to say: crap). E.g. it generated !ATTLIST for
complex types!? I fear that won't work. :-(


Small correction: As I figured out, XML Spy simply generates a DTD for the
given XML file -- it completely ignores that the XML acutally is a schema
definition. So here we are at the wrong meta level ;-)
--
Michael Wein
Jul 20 '05 #8
Michael Wein wrote:
On Fri, 27 Feb 2004 17:12:58 +0100, Michael Wein wrote:

On Fri, 27 Feb 2004 06:54:13 +0100, Dirk Segelhorst wrote:

XMLSpy 2004 supports the conversion between XSD and DTD (Menu:
"DTD/Schema"->"Convert DTD/Schema...").


Just downloaded XML Spy and tried that "feature". The DTD generated is
completely useless (not to say: crap). E.g. it generated !ATTLIST for
complex types!? I fear that won't work. :-(

Small correction: As I figured out, XML Spy simply generates a DTD for the
given XML file -- it completely ignores that the XML acutally is a schema
definition. So here we are at the wrong meta level ;-)


Which XMLSpy version do you use? Trying the same with XMLSpy 2004
Enterprise Edition works fine for my schema! And it really generated the
DTD from schema and not from XML.

Dirk.

--
There are 10 people in the world.
Those who understand binary and those who don't.
Jul 20 '05 #9
On Mon, 01 Mar 2004 06:53:14 +0100, Dirk Segelhorst wrote:
Michael Wein wrote:
On Fri, 27 Feb 2004 17:12:58 +0100, Michael Wein wrote:

On Fri, 27 Feb 2004 06:54:13 +0100, Dirk Segelhorst wrote:
XMLSpy 2004 supports the conversion between XSD and DTD (Menu:
"DTD/Schema"->"Convert DTD/Schema...").

Just downloaded XML Spy and tried that "feature". The DTD generated is
completely useless (not to say: crap). E.g. it generated !ATTLIST for
complex types!? I fear that won't work. :-(

Small correction: As I figured out, XML Spy simply generates a DTD for the
given XML file -- it completely ignores that the XML acutally is a schema
definition. So here we are at the wrong meta level ;-)


Which XMLSpy version do you use? Trying the same with XMLSpy 2004
Enterprise Edition works fine for my schema! And it really generated the
DTD from schema and not from XML.


Just one more correction: I must apologize for not following your advice
correctly. Instead of converting the schema the way you proposed I chose
"generate" schema what, of course, led to the wrong result. No looking
closer and *converting* the schema into a DTD seems to be successfull!
Thank you very much, this will be a good start for us.
--
Michael Wein
Jul 20 '05 #10


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by mustafa | last post: by
8 posts views Thread by prabha | last post: by
2 posts views Thread by Map Reader | last post: by
12 posts views Thread by Frederik Vanderhaeghe | last post: by
7 posts views Thread by Tor Aadnevik | last post: by
4 posts views Thread by gg9h0st | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.