Hi, there,

       You may incoporate the following code segment into DOMPrint.cpp
after  parser->parse(gXmlFile);

...

        parser->startDocument();        // set DOM error checking off

        try
        {
            DOM_Document doc2 = parser->getDocument();
            DOM_Element rootElem = doc2.getDocumentElement();

            DOM_Element prodElem = doc2.createElement("3InvElemName");  //
"3InvElemName" is an Invalid element name
            rootElem.appendChild(prodElem);
            DOM_Text    prodDataVal = doc2.createTextNode("You may put
anything you like here");
            prodElem.appendChild(prodDataVal);
        }

        catch (const DOM_DOMException& e)
        {
         ...
        }


     Basically u need to set DOM error checking off, otherwise,
createElement() will
reject  any __invalidelement name__.

Regards,

Peiyong Zhang
____________________________________________
XML Parsers Development
IBM Toronto Laboratory email: [EMAIL PROTECTED]
Phone: (416)448-4088; Fax: (416)448-4414; T/L: 778-4088



bertrai <[EMAIL PROTECTED]> on 04/25/2001 02:39:45 AM

Please respond to [EMAIL PROTECTED]

To:   "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
cc:
Subject:  using invalid name with Xerces-c


I would like to know if  I can (and how) create with Xerces-c an Element
which name is not a valid name. Of course, I don't intend to use a parser
with it.

Thanks for your answer



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