xml-xalan-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From david_mars...@us.ibm.com
Subject Re: Format attributes in XML tags
Date Thu, 13 May 2004 14:20:19 GMT
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