DTD to XML template

K

k@sh

Hi All,

Does anyone have experience in converting a dtd to a random XML
template which contains no values?
Is there a way to do this in C#?

Thanks in advance...
 
S

Soren Kuula

k@sh said:
Hi All,

Does anyone have experience in converting a dtd to a random XML
template which contains no values?
Is there a way to do this in C#?

Thanks in advance...
No, but been thinking about how to do that in a nice way... It depends
on what you want. A minimal valid document? A document demonstrating som
e varieties of what is possible?

I guess one would start out the same way in all cases: Parse the DTD,
and construct a graph with a node for each declaration, and one for each
bit and piece of the regular expressions, with edges in the obvious
places. One might want to add extra edges from some nodes to their
successors, to indicate different decisions at a choice: For example, a
node representing the expression b+ could have 2 edges to the
declaration of b, one indicating "1 b child" and the other "2 b
children". Or something like it....

Then, find a traversal of the graph that uses all edges, from the
declaration of something you decide to be the root element, and re-uses
edges as few times as possible.

Nice exercise anyway.

Soren
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,001
Messages
2,570,254
Members
46,851
Latest member
CliftonCor

Latest Threads

Top