Hello All,
I am using xerces 2.3.0 to both create and parse XML documents.  My DOM
creation code is full of snippets like the following, which adds an element
"name" with a value "value" to the root node (i.e.  <name>value</name>):

        ch = xercesc::XMLString::transcode("name");
        xercesc::DOMElement *name = doc.createElement(ch);
        xercesc::XMLString::release(&ch);
        root->appendChild(name);

        ch = xercesc::XMLString::transcode("value");
        xercesc::DOMText *value = doc.createTextNode(ch);
        xercesc::XMLString::release(&ch);
        name->appendChild(value);

Are there any exising mechanisms (class/template/macro) to make this code a
little more streamlined to automatically handle all the XMLString
manipulations, or would I need to roll my own?  It would be nice to condense
the above code to something like:

        AddTextElement(doc, root, "name", "value");

It would make the code more readable and save me a lot of typing.  I don't
want to reinvent the wheel if there is already something out there, but I
haven't found it in looking through the xerces API docs.  Thanks in advance
for your insights...
Cameron

D. Cameron DeHeer
Vice President, Research & Development
Blaze Systems Corporation
[EMAIL PROTECTED]
+1 (302) 733-7236
BEGIN:VCARD
VERSION:2.1
N:DeHeer;D.;Cameron
FN:D. Cameron DeHeer ([EMAIL PROTECTED])
ORG:Blaze Systems Corporation
TITLE:Senior Applications Engineer
TEL;WORK;VOICE:(302) 733-7236
TEL;HOME;VOICE:(302) 286-1266
TEL;WORK;FAX:(302) 733-7248
ADR;HOME:;;204 Wilson Road;Newark;DE;19711;US
LABEL;HOME;ENCODING=QUOTED-PRINTABLE:204 Wilson Road=0D=0ANewark, DE 19711=0D=0AUS
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:20041116T172923Z
END:VCARD

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

Reply via email to