Here's my thinking. Although XML is often used for traditional two-dimensional row-and-column data, it doesn't have to be. It can have arbitrary levels of nestedness, extra dimensions.
So if you take this XML
which follows this DTD:<items> <item> <foo>a</foo> <bar>b</bar> <baz>c</baz> </item> <item> <foo>x</foo> <bar>y</bar> <baz>z</baz> </item> </items>
Yes, it's pretty much plain sailing to generate the HTML.<!ELEMENT bar (#PCDATA)> <!ELEMENT baz (#PCDATA)> <!ELEMENT foo (#PCDATA)> <!ELEMENT item (foo, bar, baz)> <!ELEMENT items (item+)>
But what about this?
Which matches the DTD with one small change:<items> <item> <foo>a</foo> <bar>b</bar> <baz>c</baz> <item> <!-- items can contain sub-items --> <foo>d</foo> <bar>e</bar> <baz>f</baz> </item> </item> <item> <foo>x</foo> <bar>y</bar> <baz>z</baz> </item> </items>
<!ELEMENT bar (#PCDATA)> <!ELEMENT baz (#PCDATA)> <!ELEMENT foo (#PCDATA)> <!ELEMENT item (foo, bar, baz, item?)> <!ELEMENT items (item+)>
What's my HTML form going to look like when any given <item> element can contain an arbitrary number of other <item> elements?
Nobody says perl looks like line-noise any more
kids today don't know what line-noise IS ...
In reply to Re^3: Going between XML and Cgi by way of DTD
by Cody Pendant
in thread Going between XML and CGi by way of DTD
by throop
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |