-----BEGIN PGP SIGNED MESSAGE-----
At 13:57 14/5/02, Chris Proctor wrote:
>I'm fairly new to XML, but I have written some applications to build XML
>documents. I've used DTDs to validate that my document is well-formed, but I
>know that DTDs can do a lot for me.
Hmm - there's a terminology mismatch for starters. An XML document is
(must be, even) well-formed with or without a DTD. Using a DTD, you can
ensure that the document is *valid* - valid documents are a subset of
A well-formed document complies with the rules of the XML Recommendation -
e.g., elements nest properly, start- and end-tags are balanced, etc. A
valid document is a well-formed document that complies with the rules of
its DTD - if the DTD says a chapter must start with a title, then all
chapters in the document start with titles.
>Can a DTD be used to actually build an
Generally, the answer to a verb question in connection with XML is
"no." XML doesn't, DTDs don't. They are. A system *can*, using XML
and/or a DTD, but the XML and the DTD are just data.
>In other words, can I say "here's a database file or a
>tab-delimited file" and "here's the associated DTD" and use the DTD to build
>the XML document?
No, but with a little more information you might be able to. If you can
map column headers or numbers to elements, then yes. But it's the
particular software that does this, not the DTD. (I would probably do this
in Perl, and not actually read the DTD into the program. I as the
programmer would read the DTD with my eyes, and then write code that
guarantees compliant output.)
>Forgive me if this is a stupid question, but we have so
>many vendors wanting data in a various number of formats.
Not at all. Ignorant, perhaps, but there's a huge difference between
ignorant and stupid, and no shame in the former. That's what the list is
Christopher R. Maden, Principal Consultant, crism consulting
DTDs/schemas - conversion - ebooks - publishing - Web - B2B - training
<URL: http://crism.maden.org/consulting/ >
PGP Fingerprint: BBA6 4085 DED0 E176 D6D4 5DFC AC52 F825 AFEC 58DA
-----BEGIN PGP SIGNATURE-----
Version: PGP Personal Privacy 6.5.8
-----END PGP SIGNATURE-----