Reputation: 121
I'm transforming an XML-file using Saxon9he.jar. My original file has several attributes, such as:
<div>
<s id="1-1" lang="en">
<w deprel="hi" head="1-1-2" id="1-1-1" lemma="Hi" pos="NN">Hi</w>
<w deprel="ATTR" head="1-1-2" id="1-1-2" lemma="everyone" pos="NN">everyone</w>
</s>
</div>
After the transformation, Saxon writes each attribute on a single line. But I'd like to have them on a single line, like in the original. How can I achieve this? What do I have to change in the jar-file?
Thanks for any help!
Upvotes: 0
Views: 261
Reputation: 163322
Presumably you requested indent="yes"
, either explicitly or implicitly. That's a request to the XSLT processor to do the best it can to make the output as readable as possible, subject to certain constraints. One way Saxon tries to make the output readable is to avoid over-long lines in the output, since horizontal scrolling is generally considered bad for usability.
If you move to Saxon PE then you have some control over this by setting the maximum line length (use xsl:output/@saxon:line-length
). With Saxon HE you'll just have to put up with the format Saxon gives you, unless you want to write Java code to customize the serialization behaviour (which is not hard to do if you're prepared to dive in deep).
Whatever we do, of course, some people will love it and others will hate it.
Upvotes: 0