[Trilinos-Users] Teuchos::XMLObject contents

Kevin Long kevin.long at ttu.edu
Tue Sep 10 10:29:39 MDT 2013


Hi Pavel,

When I first wrote that object over 10 years ago, it was certainly the 
intention that you could loop line-by-line. I've not looked at the code 
in a long time and don't know what the current behavior is. I'll look 
into this, and see if there's a reason the behavior has changed.

Kevin



On 09/09/2013 10:25 AM, Pavel Jiránek wrote:
> Hello,
>
> I'm working on an XML file format in my code and I would like to 
> specify a text within an XML tag like
>
> <text>
>    some text
>    more text
> </text>
>
> I would like to read the contents line by line and I thought to use 
> the XMLObject's numContentLines() and getContentLine() methods. 
> However, when I make a loop over the lines and print them to the 
> output, I get the contents of the tag character by character, i.e., 
> something like this:
>
> ' ' ' ' ' ' ... ' ' 's' 'o' 'm' 'e' ' ' 't' 'e' 'x' 't' ... etc
>
> with the code like this:
>
> for (int i = 0; i < xml.numContentLines(); ++i) std::cout << "'" << 
> xml.getContentLine(i) << "'";
>
> Is this the intended behavior or am I doing something wrong? Of course 
> I would like to get the two lines. I'm using the repository version of 
> Trilinos.
>
> Thanks in advance for any feedback.
>
> Pavel
>


-- 
Kevin Long
Associate Professor
Department of Mathematics and Statistics
Texas Tech University

"The end of fear is the beginning of wisdom"
- Bertrand Russell

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20130910/0e579f76/attachment.html 


More information about the Trilinos-Users mailing list