[xsd-users] Preserve newline characters

Boris Kolpackov boris at codesynthesis.com
Wed Oct 21 11:28:30 EDT 2009


Hi Keith,

Wire, Keith C <keith.c.wire at lmco.com> writes:

> I unfortunately do not get to control this schema, but they are using 
> xsd:string.

Ok, it should be xsd:string so this is not a problem.


> I used a debugger to look at the string as soon as the generated 
> classes are used to extract the parsed data, as well as a print 
> statement.  Both show none of the newlines.

Can you try building the hello example in the examples/cxx/tree/
directory and changing the greeting string in hello.xml to include 
some newlines and tabs. Then run the example on this file and see
what you get?

If I change:

<greeting>Hello</greeting> 

to:

<greeting>Hello

  there
	tab</greeting>

I get this (expected) output:

Hello
  
  there
        tab, sun!
Hello
  
  there
        tab, moon!
Hello
  
  there
        tab, world!


> I'm using XSD 3.2.0 and cxx-tree.

What platform and compiler are you using? Also what version of
Xerces-C++?

Boris



More information about the xsd-users mailing list