473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

output formated text with xalan?

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.

May 1 '06 #1
5 1270
Elhanan wrote:
i don't exactly how to calls this , but is there a property for xalan,
to output xml with crarriage return?


xsl:output'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
May 1 '06 #2
Joseph Kesselman wrote:
xsl:output'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
May 1 '06 #3
how can whitespace between elements change the meaning of the docuemnt?
anyway all i wanna is to able to read it when i deubg.

May 7 '06 #4
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
May 7 '06 #5
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/

May 7 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Isaac Councill | last post by:
Hello, This seems like a newbie question, but I couldn't find the answer on google. I've been using xsl to transform rdf files into runnable programs in another (non-markup) language. It's...
0
by: Dimitre Novatchev | last post by:
You seem to be unaware of the xslt processing which uses the built-in rules in the absence of templates that match some selected node. http://www.w3.org/TR/xslt#built-in-rule According to the...
1
by: Fisch von Gestern | last post by:
I have tried to run the extension function/element examples provided with the Xalan-J download. I believe that my classpath is correct, and that my versions are up-to-date. However, I can't get...
3
by: Avalon1178 | last post by:
Hi, I recently downloaded the xalan-c source code in http://mirrors.ccs.neu.edu/Apache/dist/xml/xalan-c I followed the instructions from the apache site on how to build it (I already have...
3
by: Jeff Calico | last post by:
Hello everyone I am transforming an XML document to text, basically only outputting a small portion of it. When I run the following XSLT via Xalan's processor, I get a bunch of unwanted blank...
2
by: intrepidca | last post by:
When I try to translate an XML file (using org.apache.xalan.xslt.Process) that has a DOCTYPE declaration, I only get the <?xml ...?> processing instruction in the output file. I get no error...
5
by: eva.mukhija | last post by:
Hi I need to insert some html content generated by certain business logic into an xsl output. I have been able to insert custom Java extensions and generate the HTML to be outputted. My problem...
7
by: Xh | last post by:
Hi All, I have problems with generating valid HTML output there are few HTML elements that i don't what to output as <tagname/> but as <tagname></tagnamebut Xalan keeps generating them as...
6
by: John Larson | last post by:
Hi All, I am some information from INSPEC database records in XML to build a relational database of my own. I am currently trying to extract information by doing an XSLT transform of the XML...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.