Hi, thanks :) I knew I had forgot something there...
Now it works, just one little Problem left: I remove from one document a lot of nodes. Later I safe the Document with a LocalFileFormatTarget. Now, from every deleted node a newline is left. I looked into the docs for DOMDocument but couldn't find any method to refresh/rebuild the document tree. Calling normalize seems not to effect this either. So, how to get rid of those newlines? Regards Jens Weller -----Ursprüngliche Nachricht----- Von: Weiwei Wang [mailto:[email protected]] Gesendet: Mittwoch, 25. August 2010 10:11 An: [email protected] Betreff: Re: Parsing XML Schema with 2.8 before you retrive some information for a element, you should do the following check (nodeTemp->getNodeType() == DOMNode::ELEMENT_NODE) only ELEMENT_NODE contains the information you need. I also think xerces c++ is not as friendly as JDOM On Wed, Aug 25, 2010 at 4:06 PM, <[email protected]> wrote: > Hi, > > I'm having kind of a silly bug with 2.8. > I try to parse an XSD File as XML. > As I want to calculate the diff of 2 xsd files. > As XSD Files are valid XML, that should work. > > But I have the problem, that every node inside of <schema> > Seems not to be read by xerces correclty: > > Some Code: > DOMNode* node = src1->getDocumentElement(); > std::string name; > XML2String(name,node->getNodeName());// this is a function converting > XMLCh* to std::string > std::cout << name << std::endl; > XML2String(name,node->getFirstChild()->getNodeName()); > > Output of this code is: > Schema > #text > > All Nodes inside of Schema get returned as "#text". > Is this a known "bug", and is there a way to work around it? > Is there an option I could activate? > > Regards, > > Jens Weller > -- Weiwei Wang 王巍巍 百度 商务搜索部 工位:F5-BE327 分机:5594 地址:北京市海淀区上地十街10号 百度大厦 100085 手机:18601042316 百度 Hi: elegate
