xml-xalan-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes Lebek <joh.le...@gmx.de>
Subject Re: Format attributes in XML tags
Date Thu, 13 May 2004 14:42:13 GMT
Thanks, David.

The reason I'm doing this is because the output file is some kind of 
configuration file. This file needs to be changed by humans. In my 
opinion, tags with large attribute lists can be read more easily, if 
their attributes are written each in a new line.
Perhaps, XSLT is not the best way to do this.

I'm curious to learn about other approaches to make an XML file 



david_marston@us.ibm.com wrote:

> Johannes Lebek writes:
>>I'd like Xalan to format my XML output file. The requirement is to
>>put each attribute in a new line. An example:
>> <my-tag
>>    attr1="ahf"
>>    attr2="kjfr"
>>    attr3="dfhjdhf"
>>    attr4="jddjfh"/>
> You didn't say much about why you want to do that. Perhaps you
> should use the text output option instead of XML, if appearance is
> so important or if you're scanning the output line-by-line with
> a non-XML-aware application. As you may know, XML-aware applications
> are not allowed to attach any significance to such positioning.
> If you need XML output *and* you need the output to look that way,
> you could get the source code and see how xalan-indent-amount is
> implemented for elements, then adapt that code to the serialization
> of attributes.
> .................David Marston

View raw message