how to make the HTML output from XSL process readable in text form?

J

jaydog

Hello...

I'm new to XSL, and I've written a XSLT file that converts a XML file
to HTML format. When viewed in a browser, it appears exactly as I
would like. However, if I want to look at the HTML as text, which I
do, then I have trouble because the XSLT processor (SAXON) outputs
everything as one continuous line.

How can I make the HTML output from SAXON readable? Is there a
command in the XSLT language that forces line breaks? (not <br> but
actual breaks in the text file)

Below is a sample of the HTML code that SAXON is churning out.

As an aside, I'm looking ultimately to generate SVG output instead of
HTML. Can anyone recommend a good online tutorial?

Thank you for any help!
jason

<?xml version="1.0" encoding="utf-8"?><tr><th colspan="2"><h2
style="color:blue"><p>Blackboard
Levels</p></h2></th></tr><table><br/><br/><tr><td valign="top"
cellpadding="4"><h3 style="color:grey">Level = planes</h3><font
color="green" size="-1">planeID</font><br/><font color="green"
size="-1">planeType</font><br/><font color="green"
size="-1">maxNumberOfPassengers</font><br/><font color="orange"
size="-1">flight/flights</font><br/><td
valign="top"><table><br/><br/><tr><td valign="top" cellpadding="4"><h3
style="color:grey">Level = plane_sub_one</h3><font color="green"
size="-1">more stuff</font><br/><font color="green" size="-1">even
more stuff</font><br/><td valign="top"><table><br/><br/><tr><td
valign="top" cellpadding="4"><h3 style="color:grey">Level =
plane_sub_two</h3><font color="green" size="-1">twooooo</font><br/><td
valign="top"/></td></tr></table></td></td></tr></table></td></td></tr></table><table><br/><br/><tr><td
valign="top" cellpadding="4"><h3 style="color:grey">Level =
flights</h3><font color="green"
size="-1">numberOfPassengers</font><br/><font color="green"
size="-1">flightName</font><br/><font color="green"
size="-1">flightOrigin</font><br/><font color="green"
size="-1">flightDestination</font><br/><font color="orange"
size="-1">plane/planes</font><br/><td
valign="top"/></td></tr></table><table><br/><br/><tr><td valign="top"
cellpadding="4"><h3 style="color:grey">Level = Meta_Cognitive</h3><td
valign="top"><table><br/><br/><tr><td valign="top" cellpadding="4"><h3
style="color:grey">Level = Instance</h3><font color="green"
size="-1">id</font><br/><font color="green"
size="-1">start_time</font><br/><font color="green"
size="-1">context</font><br/><font color="green"
size="-1">interruption_count</font><br/><font color="green"
size="-1">suspension_count</font><br/><font color="green"
size="-1">time_spent</font><br/><font color="green"
size="-1">remaining_time_to_spend</font><br/><font color="green"
size="-1">priority</font><br/><font color="green"
size="-1">status</font><br/><font color="orange"
size="-1">task/Meta_Cognitive.Task</font><br/><td
valign="top"/></td></tr></table><table><br/><br/><tr><td valign="top"
cellpadding="4"><h3 style="color:grey">Level = Task</h3><font
color="green" size="-1">name</font><br/><font color="green"
size="-1">started_instances_count</font><br/><font color="green"
size="-1">total_interruption_count</font><br/><font color="green"
size="-1">total_suspension_count</font><br/><font color="green"
size="-1">total_time_spent</font><br/><font color="green"
size="-1">average_interruption_count</font><br/><font color="green"
size="-1">average_suspension_count</font><br/><font color="green"
size="-1">average_time_spent</font><br/><font color="green"
size="-1">goal_executions_counter</font><br/><font color="green"
size="-1">determine_calls_counter</font><br/><font color="green"
size="-1">micro_model_calls_counter</font><br/><font color="green"
size="-1">method_calls_counter</font><br/><font color="green"
size="-1">calculate_calls_counter</font><br/><font color="green"
size="-1">cpp_actions_calls_counter</font><br/><font color="green"
size="-1">cel_actions_calls_counter</font><br/><font color="green"
size="-1">balistic_actions_calls_counter</font><br/><font
color="orange" size="-1">instances/Meta_Cognitive.Instance</font><br/><font
color="orange" size="-1">model/Meta_Cognitive.Model</font><br/><td
valign="top"/></td></tr></table><table><br/><br/><tr><td valign="top"
cellpadding="4"><h3 style="color:grey">Level = Model</h3><font
color="green" size="-1">name</font><br/><font color="green"
size="-1">time_spent</font><br/><font color="orange"
size="-1">tasks/Meta_Cognitive.Task</font><br/><td
valign="top"/></td></tr></table></td></td></tr></table>
 
J

Joris Gillis

I'm new to XSL, and I've written a XSLT file that converts a XML file
to HTML format. When viewed in a browser, it appears exactly as I
would like. However, if I want to look at the HTML as text, which I
do, then I have trouble because the XSLT processor (SAXON) outputs
everything as one continuous line.

How can I make the HTML output readable?

Hi,

put this in your stylesheet:
<xsl:eek:utput indent="yes" />

regards,
 
J

jason schlachter

brilliant. Thank you Joris. It worked great...even put the proper
indentations in place.

-jason
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,835
Latest member
lila30

Latest Threads

Top