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);

I think you really meant:

    const unsigned int len =
        static_cast<unsigned int>(strlen(input));

    memBufIs = new MemBufInputSource(
                        reinterpret_cast<const XMLByte*>(input),
                        len,
                        "example",
                        false);

Dave

Reply via email to