Re: [libxml++] ignore empty text nodes



On Fri, 2010-03-26 at 19:57 +0900, Andrej van der Zee wrote:
> Hi Murray Cumming,
> 
> Thank you for your reply.
> 
> >
> > By checking for them in your application when you read the XML document.
> > It's entirely up to your application to decide whether white space is
> > interesting.
> >
> 
> How can I "check for them"? I am parsing a file like this:
> 
>   DomParser session_parser;
>   session_parser.set_substitute_entities();
>   session_parser.parse_file("session-cfg.xml");
>   Document * doc_session = session_parser.get_document();
> 
> Do you mean manually traverse doc_session and remove them with
> remove_child?

Yes. I guess you are doing that somehow anyway during your "merge" of
two documents.

>  I was hoping that there was an option that I could use
> to instruct the parser. I am sure that empty text nodes in many cases
> should be ignored, so I expect to be able to do such a thing without
> to much manual coding.

I guess I'd accept a patch that adds an
Element::remove_empty_text_nodes() method. The you could call that on
get_root_node().


-- 
murrayc murrayc com
www.murrayc.com
www.openismus.com





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]