I am not sure I understood what you asked, but I think you need to use MemBufInputSource; see the MemParse sample for an example of its usage.

I'm working on something similar -- I posted here a month or so back about it -- and I can't get it to work either. I looked at MemParse.cpp but it's using a SAX parser and I need DOM -- so the sample has some usefulness, but is obviously different.

Here's what I'm trying:

--------------------
const XMLByte foo[256] = "<foo>Testing</foo>";
int size = strlen((char*)foo);

MemBufInputSource* stringSource = new MemBufInputSource(foo, size,
          "ignored", false);
assert(stringSource);

try {
  Wrapper4InputSource source(stringSource);
  m_parser->parseWithContext(source, &node,
        DOMBuilder::ACTION_APPEND_AS_CHILDREN);
} catch (DOMException& e) {
  printf("EXCEPTION: '%s'\n", e.getMessage());                
}
--------------------

node is a DOMNode& that's been passed in as the place to attached the resultant DOM fragment & m_parser is a DOMBuilder*. I'm obviously doing *something* wrong, but the exception I get is extremely unhelpful. The output I get is "EXCEPTION: 'T'" -- not the most informative message ^_^

Any suggestions on what I can do to alleviate this? I think I'm on the right track, but clearly something isn't right.

Any help appreciated!

..............................
Andrew Patterson
Software Engineer
Avenza Systems Inc.

email: [EMAIL PROTECTED]
phone: 416.487.5116

Reply via email to