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-tp383871p15122329.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]

Reply via email to