You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Olumide <50...@web.de> on 2012/03/30 19:37:04 UTC

Getting (non-element) text between tags e.g. Text

Hi -

I'd appreciate pointers on how to get (non-element) text between tags. 
For example given the element <Tag>ABC</Tag> I'd like to get the text ABC.

Currently, I'm able to use DefaultHandler::(const XMLCh *const chars, 
const XMLSize_t length) in order to get the characters between two 
consecutive start or end tags. Unfortunately I'm getting uncesarry 
newlines and formatting spaces. Between parent tags and child elements. 
For example in the bit of code below, I'm getting 5 extra formatting 
characters -- one newline and four spaces:

<Parent>
     <Child>XYX</Child>
</Parent>

What is be the best (standard) way of filtering out these formatting 
characters?

Regards,

- Olumide