>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.

Reply via email to