Re: [xml] DTD Validation



On Fri, Jul 28, 2006 at 05:49:34AM -0500, Bipin Mistry wrote:
hello all 
I am using following code to read XML buffer to XML_DOC pointer

xml_doc = xmlReadMemory(xml_memory_reference, 
          strlen(xml_memory_reference), 
          "noname.xml", 
          NULL, 
          XML_PARSE_DTDVALID);

& my XML Buffer Contains DTD definations...

1. I have my.EXE which has above code.
2. DTD files in the same folder.
3. When EXE runs it works fine.

Now the queries & ploblem...
1.  How Can't I relocate the DTD files and still the process can 
    be workded out without any error or the warning message.

  http://www.w3.org/TR/REC-xml/#NT-ExternalID
  [Definition: The SystemLiteral is called the entity's system identifier. It is meant to be converted to a 
URI reference (as defined in [IETF RFC 2396], updated by [IETF RFC 2732]), as part of the process of 
dereferencing it to obtain input for the XML processor to construct the entity's replacement text.]

  "relative URIs are relative to the location of the resource within which the entity declaration occurs"

  that's what drives libxml2 behaviour.

    As right now when EXE folder do not have DTD files it shows 
    me following at the command prompt.


    ................  "FileName.DTD"
                      ^


2. How can I validate the XML buffer with the DTD specified. 

 provide the correct URI-Reference pointing to the DTD

   & if above thing heppands how can i trap it to show warning
   / error to user.

 like any other error in libxml2, which I think I answer on an average of
2 times a weeks those days,

Daniel

-- 
Daniel Veillard      | Red Hat http://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]