Please check out this  API :

http://www.xmlsoft.org/html/libxml-parser.html#xmlReadMemory

And this example to use it

http://www.xmlsoft.org/examples/parse3.c


Thanks,
Ram

From: [email protected] [mailto:[email protected]] On Behalf Of Seemant 
Bisht
Sent: Wednesday, June 09, 2010 11:57 AM
To: [email protected]
Cc: [email protected]
Subject: [xml] Need XML string to parse

Hi,
   I have a very serious query. Iam looking for a libxml function that can 
parse the XML string (not file) and validate it against the DTD file. I have 
searched in library, I have got many function like:

xmlDocPtr<http://www.xmlsoft.org/html/libxml-tree.html#xmlDocPtr>      
xmlCtxtReadFile<http://www.xmlsoft.org/html/libxml-parser.html#xmlCtxtReadFile> 
       
(xmlParserCtxtPtr<http://www.xmlsoft.org/html/libxml-tree.html#xmlParserCtxtPtr>
 ctxt,

                                       const char * filename,

                                       const char * encoding,

                                       int options)
But they all take file name as input. I need function that take string as input 
for XML.

I know there is an alternate way i.e. to create a file and write the whole 
string to that file and then pass its name to the function. But it would 
degrade the performance of my application very much because of file I//O 
handling as I need to parse a number of XML strings against the DTD files.

Please show me the way as I am stuck because of this.
________________________________
Make the world eco-friendly through MSN Green Drag n' 
drop<http://green.in.msn.com/>
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to