List Info

Thread: DTD Validation




DTD Validation
user name
2006-07-28 10:49:34
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.
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.
& if above thing heppands how can i trap it to show warning
/ error to user.

Thanks to all in advance.

Bipin Mistry

-----------------------------------------------------------
Hi..! Get this Exclusive Offer From 30gigs.com. Free Ipod Nano! Click Here.
Don't have 30gigs email account yet? Sign up and get your 30GB Webmail account Now!

DTD Validation
user name
2006-07-28 10:58:42
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://ww
w.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/
veillardredhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ |
Rpmfind RPM search engine http://rpmfind.net/
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )