Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Line feeds in xml

Status
Not open for further replies.

furtivevole

Technical User
Jun 21, 2001
84
GB
I am working on an app (in RealBasic, to run on Linux) which includes dynamically creating and then adding to an .xml file. Problem is that while it parses and displays OK in say Mozilla, the stripping-out of any line feeds makes viewing and occasional editing with a text editor such as vi, very tedious. Simplified version of the structure is as follows. There will be multiple instances of Product:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<BuildTool>
	<ProductListing id="History">
		<Product id="">
			<define name="ProductName" value=""/>
			<define name="SupportedDB" value=""/>
			<define name="UserID" value=""/>
			<define name="Date" value=""/>
		</Product>
	</ProductListing>
</BuildTool>
As this stage I need just a quick fix with either (I guess) css or xsl. Like many posters, I'm extremely new in this area, and havn't so far mentally been able to make the link with examples I've looked at elsewhere. Hopefully this will also help me comprehend it better for the future. :cool:
 
Not exactly sure what your desired goal is, but a quick fix for browser rendition might be simply to insert <br/> as needed...

Tom Morrison
 
The occasional need is to view and edit the .xml file away from the app itself with a text editor such as vi (rather than a web browser such as Mozilla).
 
You might want to search the forum on this topic as it is often raised.
 
Well, I would first see if the RealBasic XML tool has the capability when it serializes the document (as the value of ToString, perhaps).

It would seem that you could use a simple identity XSLT and use the <xsl:eek:utput indent="yes"/>, specifying this on the Transform method.
Code:
<xsl:stylesheet [COLOR=red][b]...[/b][/color]>
  <xsl:output method="xml" indent="yes"/>
  <xsl:template match="/">
    <xsl:copy-of select="."/>
  </xsl:template>
</xsl:stylesheet>

Tom Morrison
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top