Re: [xml] adding DTD to document without parsing from file



On Sun, Dec 29, 2002 at 01:33:32PM -0600, Scott Peshak wrote:
hi,

i want to associate a DTD with a document I'm creating in memory (and
then dumping to disk) but all of the information i have found about this
use xmlParseDtd to get a xmlDtdPtr to associate with the document.  My
DTD does not exist as a external file it is hard coded in my app as a
const char[].  Is there a way to parse this so I can add it to my
document?

  Make an xmlParserInputBufferPtr from your string and use
  xmlDtdPtr
  xmlIOParseDTD(xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input,
                xmlCharEncoding enc);
You may have to dig a bit in the code to find the right entry points
and examples, but that should be doable

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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