As previously explained, the pretty print feature does not preserve 
white space. If you think about it, it's an unavoidable trade-off
(that is to say, one that cannot always be avoided).
On the other hand, the pretty print feature only affects the
marshalling.
The true infoset is still accessible. So you haven't lost the original
whitespace.

-----Original Message-----
From: ravikumar [mailto:[EMAIL PROTECTED] 
Sent: Sunday, January 27, 2008 10:35 AM
To: [email protected]
Subject: RE: Whitespace is not preserved


Hi

I am running into the same issue. setSavePrettyPrint() is trimming the
data
in addition to indenting the xml.    I am looking for an option not to
trim
the data, but still indent the xml.

Thanks


dmorales wrote:
> 
> Hi,
> 
> Can anyone tell me how to do anything like this??.... I mean, how to
> "pretty print" from xmlcursor??  
> 
> Thanks in advance
> 
> 
> 
> Radu Preotiuc-Pietro wrote:
>> 
>> Well, to be honest, the meaning of pretty print is that you give up
space
>> preservation in order to get a document that's easier to read. If you
>> care about spaces being preserved, you should _not_ use pretty print.
>> They're exclusive and I am not sure how would they work together.
>>  
>> However, if you access the document using, say, XmlCursor, then all
the
>> original spaces in the infoset will be there, regardless of the
Pretty
>> Print value.
>>  
>> Radu
>> 
>> -----Original Message-----
>> From: Buxton, Gretchen C. [mailto:[EMAIL PROTECTED]
>> Sent: Friday, July 01, 2005 10:01 AM
>> To: '[email protected]'
>> Subject: Whitespace is not preserved
>> 
>> 
>> I have a string element that contains text leading whitespace.  When
I
>> use XMLOptions setSavePrettyPrint() the spaces within this element
are
>> trimmed from the beginning and end of the element.  Without
>> setSavePrettyPrint the trimming does not occur.
>>  
>> From what I can tell, the data inside the element should fall within
the
>> specification for the Infoset so I expected Pretty Print should not
>> affect this data.  I have tried adding the <xs:whiteSpace
>> value="preserve" /> to this element definition in my schema and this
does
>> not seem to make a difference in the behavior.
>>  
>> Can someone explain why this occurs?
>>  
>> Here's a relevent fragment from my .xsd.
>>  
>> <xs:element name="response">
>>     <xs:simpleType>
>>              <xs:restriction base="xs:string">
>>                <xs:whiteSpace value="preserve" /> 
>>       </xs:restriction>
>>     </xs:simpleType>
>> </xs:element>
>>  
>> Thanks.
>> 
>>
************************************************************************
**** 
>> 
>> This email may contain confidential 
>> material. If you were not an intended recipient, 
>> Please notify the sender and delete all copies. 
>> We may monitor email to and from our network.
>> 
>> 
>>
************************************************************************
*** 
>> 
>>  
>> 
>> 
>> 
> 
> 

-- 
View this message in context:
http://www.nabble.com/RE%3A-Whitespace-is-not-preserved-tp383871p1512232
9.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Notice:  This email message, together with any attachments, may contain 
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated 
entities,  that may be confidential,  proprietary,  copyrighted  and/or legally 
privileged, and is intended solely for the use of the individual or entity 
named in this message. If you are not the intended recipient, and have received 
this message in error, please immediately return this by email and then delete 
it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to