question

AndrewB-4931 avatar image
0 Votes"
AndrewB-4931 asked AndrewB-4931 answered

Need help with converting SGML DTD to Schema using Visual Studio Community

Currently using Visual Studio Community Version, and I am trying to generate a Schema from SGML DTD.

When I open the SGML DTD I receive a ton of errors for example:
expecting system literal string,
Invalid token '>' at root level of document,
expecting keyword EMPTY or ANY. and so forth.

The DTD i have is valid in the SGML world.

When I go to XML - Create Schema, it generates a XSD Schema version of the SGML DTD however it does not generate <xs: sequence ref="xxxx"> information for required elements like the SGML DTD.

Is there some setup i am missing to prevent the SGML DTD errors when opening the file?
Is there some setup on the Create Schema that i need to receive the desired output?

Any Help would greatly be appreciated

vs-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

cooldadtx avatar image
0 Votes"
cooldadtx answered

AFAIK you cannot convert an SGML DTD to XSD in VS in all cases. There is an option to create a schema but I haven't heard that it actually works correctly with the SGML format. SGML is more loose than XML and therefore conversion issues can occur the further from pure XML the SGML is. Of course you could use VS to convert the bulk of the DTD and then fix up whatever is left but I don't know a good way to verify this.

You could try to first convert the SGML DTD to a regular XML DTD and then use VS as well.

Finally there may be some online converters that could do it as well if the DTD is really large.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AndrewB-4931 avatar image
0 Votes"
AndrewB-4931 answered

I haven't much luck finding other Software besides VS to actually convert the DTD to Schema.
I was hoping it wouldn't come to the manual effort as I will have a lot of DTDs to convert.

I will look into the SGML DTD to XML DTD option. Thanks

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.