Paste xml text into a pre style and preserve indents?

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
TechnicalDisaster
Propeller Head
Posts: 61
Joined: Mon Jan 03, 2011 12:09 pm

Paste xml text into a pre style and preserve indents?

Post by TechnicalDisaster »

I hope the group here can help me with two questions:

1. I want to copy xml code from a text editor and paste it into Flare while preserving the indents. Flare is taking my text and left justifying it all. For example:

This is what I copy from a text editor:

Code: Select all

<?xml version ="1.0"?>
<msg>
	<head>
		<RoundTripInfo>64 bytes of transaction information</ RoundTripInfo >
	</head>
	<body>
		<HostIdentifier>
			<SiteIdent>00000000811000000000</SiteIdent>
		</HostIdentifier>
		<AddSubscriber>
			<BSSubscriberKey>1234567890123456</BSSubscriberKey>
			
		</AddSubscriber>
	</body>
</msg> 
And this is what it looks like when I paste it into Flare:

Code: Select all

<?xml version ="1.0"?>
<msg>
<head>
<RoundTripInfo>64 bytes of transaction information</ RoundTripInfo >
</head>
<body>
<HostIdentifier>
<SiteIdent>00000000811000000000</SiteIdent>
</HostIdentifier>
<AddSubscriber>
<BSSubscriberKey>1234567890123456</BSSubscriberKey>
</AddSubscriber>
</body>
</msg> 
Is their a way to preserve the indents?

2. The default tab space for <pre> is too large. When I manually add a tab space into the style to reformat it closer to original, the tab is twice as deep as the original code. How do I set the tab space in a style?

Thanks for any help!
MAD Certified Version 6
Flare 7.1
Andrew
Propellus Maximus
Posts: 1237
Joined: Fri Feb 10, 2006 5:37 am

Re: Paste xml text into a pre style and preserve indents?

Post by Andrew »

1) the way to preserve the indents is to use a <pre> tag, or to use the whitespace property (with the pre value). This will result in the problem you described in 2).

2) Did a brief search, and this is the best page I could come up with. It has links leading to some other interesting areas you could explore. I don't know that any of it will give you exactly what you need, but it may help.
Flare v6.1 | Capture 4.0.0
Post Reply