[xsd-users] serialization without pretty print

Mark Stevens Mark.Stevens at dtn.com
Thu Jul 31 18:50:05 EDT 2008


Hi,
I am also interested in switching off pretty print dynamically.  
Per the message below, it appears that a patch was made in version
3.1.1.
 
Do you have a release date for a Solaris sparc bin release with this
patch included?
Thanks.
 
Mark
 

 

Mark Stevens

System Design Engineer

DTN

9110 West Dodge Road, Suite 200

Omaha, NE 68114

 

mark.stevens at dtn.com <mailto:mark.stevens at dtn.com> 

Phone: 402-255-8015

Fax: 402-255-8825

www.dtn.com <http://www.dtn.com/> 

DTN Smarter Decisions

 


[xsd-users] Re: xsd-users Digest, Vol 32, Issue 14 serialization without
pretty print


Gordon Kramer gkr at as-guides.com
<mailto:xsd-users%40codesynthesis.com?Subject=%5Bxsd-users%5D%20Re%3A%20
xsd-users%20Digest%2C%20Vol%2032%2C%0A%09Issue%2014%20serialization%20wi
thout%20pretty%20print&In-Reply-To=200802161700.m1GH0MsQ001728%40codesyn
thesis.com> 
Tue Mar 11 07:20:23 EDT 2008 

*	Previous message: [xsd-users] Roundtrip errors with CXX-Tree
<http://www.codesynthesis.com/pipermail/xsd-users/2008-March/001556.html
> 
*	Next message: [xsd-users] serialization without pretty print
<http://www.codesynthesis.com/pipermail/xsd-users/2008-March/001562.html
> 
*	Messages sorted by: [ date ]
<http://www.codesynthesis.com/pipermail/xsd-users/2008-March/date.html#1
555>  [ thread ]
<http://www.codesynthesis.com/pipermail/xsd-users/2008-March/thread.html
#1555>  [ subject ]
<http://www.codesynthesis.com/pipermail/xsd-users/2008-March/subject.htm
l#1555>  [ author ]
<http://www.codesynthesis.com/pipermail/xsd-users/2008-March/author.html
#1555>  

________________________________

Hi,
I am also interested in switching off pretty print dynamically.
 
> > One tiny question/wish: streaming out xml with std::ofstream created

> > an extra carriage return symbol after each element:
> > <?xml version="1.0" encoding="ISO8859-1" standalone="no" ?> <hello>
> >
> >   <greeting>Hello</greeting>
> >
> >   <name>its me</name>
> >
> > </hello>
> >
> > How to drop it?
> 
> XSD uses DOMWriter provided by Xerces-C++ to serialize to XML.
> It turns the format-pretty-print feature on by default which produces
> the result you see (BTW, I believe it adds extra new lines only for
> element that are directly under the root so real documents with
several
> nesting levels actually look better with these extra newlines than
> without them).
> 
> You only other option is to turn pretty-printing off altogether in
which
> case you will get unformatted XML. To do this you will need to set the
> DOM-to-XML serialization stage yourself and switch the
> format-pretty-print feature off on the DOMWriter object. For more
> information see Q3.2 in the C++/Tree Mapping FAQ:
> 
> http://wiki.codesynthesis.com/Tree/FAQ
> 
> As well as the Xerces-C++ DOMWriter documentation:
> 
> http://xerces.apache.org/xerces-c/program-dom.html#DOMWriterFeatures
> 
> Boris
> 
 
having had a look at the code it doesn't look too complicated by
introducing another serialisation flag no_pretty_print.
please find attached a patch for this proposal
I did not add a test for this feature yet.
 
Gordon
 
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xsd_no_pretty_print.patch
Type: text/x-patch
Size: 2225 bytes
Desc: not available
Url :
http://codesynthesis.com/pipermail/xsd-users/attachments/20080311/2094cf
3d/xsd_no_pretty_print.bin

 




-----------------------------------------
NOTICE: This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized use, disclosure or distribution is
prohibited. If you are not the intended recipient, please contact
the sender by reply email and destroy all copies of the original
message.


More information about the xsd-users mailing list