Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > output formated text with xalan?

Reply
Thread Tools

output formated text with xalan?

 
 
Elhanan
Guest
Posts: n/a
 
      05-01-2006
hi..

i don't exactly how to calls this , but is there a property for xalan,
to output xml with crarriage return?

i'm trying out xslt and the output can't be read with a normal editor,
i know when serliaze xml with java, you can place a parameter saying
the xml string will be output in human readble form.

 
Reply With Quote
 
 
 
 
Joseph Kesselman
Guest
Posts: n/a
 
      05-01-2006
Elhanan wrote:
> i don't exactly how to calls this , but is there a property for xalan,
> to output xml with crarriage return?


xslutput's intent attribute, possibly plus the xylem-specific
xalan:indent-amount attribute for that element.

Warning: The reason XSLT doesn't do this by default is that it may
change the meaning of the document. Excercise appropriate care in using it.


--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
 
Reply With Quote
 
 
 
 
Joseph Kesselman
Guest
Posts: n/a
 
      05-01-2006
Joseph Kesselman wrote:
> xslutput's intent attribute, possibly plus the xylem-specific
> xalan:indent-amount attribute for that element.


Oops. Of course, "intent" should have been "indent"; apologies.

The other solution, of course, is to write your stylesheet so it
explicitly outputs whitespace at the desired places, eg via
<xsl:text> </xsl:text>
That has the advantage of being a lot more controllable than the indent
directive (and more reliable, since different processors may interpret
indent in somewhat different ways), but is more work for the stylesheet
writer.

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
 
Reply With Quote
 
Elhanan
Guest
Posts: n/a
 
      05-07-2006
how can whitespace between elements change the meaning of the docuemnt?


anyway all i wanna is to able to read it when i deubg.

 
Reply With Quote
 
Joe Kesselman
Guest
Posts: n/a
 
      05-07-2006
Elhanan wrote:
> how can whitespace between elements change the meaning of the docuemnt?


There is no "between". All whitespace is contained within an element,
and is part of that element's contained text. Depending on how your
particularly markup language is being processed, and depending on what
hints you give it (eg the xml:space directive, or schema information
about the intended type), the system may be able to ignore the
whitespace ... or may not.

> anyway all i wanna is to able to read it when i deubg.


For debugging, no problem, as long as you're aware that what you're
seeing isn't exactly what other programs are seeing.

For feeding it to another application, the only simple answer is It Depends.

As long as you're aware of that, go for it.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
 
Reply With Quote
 
Peter Flynn
Guest
Posts: n/a
 
      05-07-2006
Elhanan wrote:
> how can whitespace between elements change the meaning of the docuemnt?


Because (depending on its context) it may be ignored or retained at
processing time. This may make some data run together or be kept
apart.

See the FAQ: http://xml.silmaril.ie/authors/whitespace/

> anyway all i wanna is to able to read it when i deubg.


That may be all *you* want to do, but a machine doesn't have your
eyes. All it can do is obey the markup and the rules of XML. That's
why it's got to be correct. Just "looking OK" isn't enough.

///Peter
--
XML FAQ: http://xml.silmaril.ie/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert UNIX formated text files to DOS formated? walterbyrd Python 13 05-13-2009 02:32 PM
Predictably formated output with std::cout? Carsten Fuchs C++ 5 07-08-2008 07:23 PM
Finding the position of the cursor in a text box & Rich formated <textarea> Michael Javascript 2 02-17-2006 02:33 PM
formated output excer (help) sathyashrayan C Programming 3 02-09-2006 06:30 AM
Display Data in a "Formated Excel Form" ? Ben ASP .Net 0 06-27-2003 04:18 PM



Advertisments