João,

I can't remember what the default encoding setting for MemBufInputSource is,
but it may be that you need to set the encoding to single-byte characters.

-----Original Message-----
From: João Graça [mailto:[EMAIL PROTECTED]
Sent: 16 March 2005 03:01
To: xerces-c-dev@xml.apache.org
Subject: Getting a parser from a string


Hello,

I am trying to start a parser from a std::string because this is what i
receive from a xml rpc channel.

The problem is that i already have tried to use DomBuilder,
MemBufInputSource with and without wrappers and i can't make it. Could
someone help me with this problem, like sugesting what i should properly
do.
I have read all the documentation several times and i can't figure it out.

I appreciate your atention,
Best regards,
João Graça

PS: I send i little bit of code from one of my experiment so that you
can see what i am trying to do.

 DOMBuilder* parser =
((DOMImplementationLS*)_impl)->createDOMBuilder(DOMImplementationLS::MODE_SY
NCHRONOUS,
0);

  const char * msg = analysisXml.c_str();
  MemBufInputSource* memBufIS = new MemBufInputSource
    (
        (const XMLByte*)msg
        , strlen(msg)
        , "repository"
        , false
    );
  Wrapper4DOMInputSource domISWrapper(memBufIS);
  //  Wrapper4DOMInputSource domISWrapper(inputSource);
  DOMDocument *doc = 0;
   try {
            doc = parser->parse(domISWrapper);
        }
        catch (const XMLException& toCatch) {
            char* message = XMLString::transcode(toCatch.getMessage());
            cout << "Exception message is: \n"
                 << message << "\n";
            XMLString::release(&message);
            return 0;
        }

   ///Build domain model from dom node

  return 0;

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to