in reply to Re^2: Going between XML and Cgi by way of DTD
in thread Going between XML and CGi by way of DTD
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 ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Going between XML and Cgi by way of DTD
by throop (Chaplain) on Aug 27, 2007 at 03:53 UTC | |
by Cody Pendant (Prior) on Aug 27, 2007 at 04:12 UTC | |
by pajout (Curate) on Aug 27, 2007 at 15:31 UTC |