>alsm wrote, >I made the changes but now when the program executes >parser->parse(*memBufIs); an error occurs.. typo mistake in my previuos email, casting should be from size not from input buffer.. unsigned int *len = reinterpret_cast<unsigned int *>(&InputSize);
-----Original Message----- From: alsm [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 11, 2006 5:08 PM To: [email protected] Subject: RE: Parse a XML tree from string Thanks! I made the changes but now when the program executes parser->parse(*memBufIs); an error occurs... Any idea? Tomorrow I'm gonna try to catch the correct exception (it´s neither XMLException nor DOMException, because when I debug the program, the "..." catch is executed...). Now I´m going home. Thanks again and sorry about my English! Tatireddy, Vinod wrote: > >>alsm wrote, >>I have to read a XML tree from a char* received like this: >>example(char* input) >>I did it using the input as the file name, but now I can't read the tree >>from a file, it'll be passed as a string. How can I do it? > I guess you may need to use the input source from Memory for the parser > instead of default. You may need to create an instance of > MemBufInputSource() and pass that instance to parse() member function, > below snippet of code may help i guess. > > size_t InputSize= strlen(input); > unsigned int *len = reinterpret_cast<unsigned int *>(&input); > memBufIs = new MemBufInputSource(reinterpret_cast<const > XMLByte*>(input), > *len, > "example", > false); > parser->parse(*memBufIs); > > > > > -----Original Message----- > From: alsm [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 11, 2006 4:14 PM > To: [email protected] > Subject: Parse a XML tree from string > > > > Hi, > > I have to read a XML tree from a char* received like this: > > example(char* input) > > I did it using the input as the file name, but now I can't read the tree > from a file, it'll be passed as a string. How can I do it? > > thanks > > alsm > -- > View this message in context: > http://www.nabble.com/Parse-a-XML-tree-from-string-t1434198.html#a3869628 > Sent from the Xerces - C - Users forum at Nabble.com. > > > -- View this message in context: http://www.nabble.com/Parse-a-XML-tree-from-string-t1434198.html#a3870699 Sent from the Xerces - C - Users forum at Nabble.com.
