Re: [xml] Need XML string to parse



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: xml-bounces gnome org [mailto:xml-bounces gnome org] On Behalf Of Seemant Bisht
Sent: Wednesday, June 09, 2010 11:57 AM
To: xml gnome org
Cc: seemant bisht alcatel-lucent com
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      xmlCtxtReadFile        (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



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