users@jaxb.java.net

Re: xml-stylesheet example & whitespace

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Wed, 12 Nov 2003 09:23:12 -0800

I think it's XSLT that's messing all the whitespaces.

You have to have:

    <xsl:output indent="yes" />

or something like this in your stylesheet. In my experience, Xalan sucks
in terms of the indentation and for that reason I tend to use SAXON.

Or you could alternatively pipe the output of XSLT into a formatting XML
writer, such as DataWriter by David Megginson or Apache XML Serializer.

Also, JAXB RI 1.0.2 has a new feature that forces the marshaller not to
produce XML declaration. Your finaloutput is a stream, then you can
write the XML decl + whatever PI manually, then marshal the rest of the
document normally.

regards,
--
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net