Re: [xml] Remove an xml file's dependence on external DTD files



On Mon, 2008-05-12 at 21:03 +0800, èæè wrote:
I am new to XML. And I am looking for a way to convert an xml file
depending on external DTD files to its equivalent not depending on
external DTD files.

You can change
<!DOCTYPE sock SYSTEM "sock.dtd">
<sock>Argyle</sock>

to
<!DOCTYPE sock [
    <!--* contents of sock.dtd here *-->
]>
<sock>Argyle</sock>

but it's possible that VTD-XML (I'm not familiar with it)
is too broken to understand that.

You can also change
<!DOCTYPE sock SYSTEM "sock.dtd">
to
<!DOCTYPE sock>
in the XML file, so that the software will not try to
load a DTD, but then the element structure will not be
checked, and any entities defined in the DTD will not
be available, e.g. if the DTD has
<!ENTITY pc "Polyester-cotton">
then you could use &pc; in your document as short-hand
for Polyester-Cotton, but only if the XML software loads
the DTD.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org www.advogato.org




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]