You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2003/04/02 05:10:29 UTC

DO NOT REPLY [Bug 18594] New: - DOMWriter does not recognize Document Fragment

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18594>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18594

DOMWriter does not recognize Document Fragment

           Summary: DOMWriter does not recognize Document Fragment
           Product: Xerces-C++
           Version: Nightly build (please specify the date)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: DOM
        AssignedTo: xerces-c-dev@xml.apache.org
        ReportedBy: zhangpy@hotmail.com


Reported by elliot.rapp@ni.com <el...@ni.com>

When I try to "get XML" on a DOMDocumentFragment the DOMWriter->writeNode()
returns:

Unrecognized Node Type

Should I be able to get the content of a document fragment?  Once I append
the docfrag to a document the writeNode will show it in the contents.  But
when I try to peform this action on a DOMDocumentFragment it does not work?
Am I missing something?  I thought a DOMWriter was supposed to be able to
handle a docfrag.

                  // get the DOM representation
                  DOMNode                             *doc =
parser->getDocument();
                  DOMNode                 *docel=((DOMDocument*)doc)
->getDocumentElement();
                  DOMNode                 *docelchild=docel->getFirstChild
();
                  DOMNode                 *docelchild2=docel->getFirstChild
()->getNextSibling();
                  DOMNode
*docelchildofchild=docelchild->getFirstChild();
                  DOMDocumentType         *docdoctype=((DOMDocument*)doc)
->getDoctype();
                  DOMDocumentFragment     *docdocfrag=((DOMDocument*)doc)
->createDocumentFragment();
                  XMLCh                   *docfragname=XMLString::transcode
("newdocfrag");
                  DOMNode                 *docfragchild=((DOMDocument*)doc)
->createElement(docfragname);
                  XMLCh                   *docfragtext=XMLString::transcode
("newdocfragtext");
                  DOMText                 *docfragchildtext
=((DOMDocument*)doc)->createTextNode(docfragtext);
                  docfragchild->appendChild(docfragchildtext);
                  docdocfrag->appendChild(docfragchild);
                  cout<<"DocumentFragment XML: "<<endl;
                  theSerializer->writeNode(myFormTarget, *docdocfrag);


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org