|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] SAXON: ElementCopier, \n needed?
Hello all,
A few days ago I wrote about a problem I ran into while I was using
SAXON to split and transform2HTML XML files. The problem was:
The input could be let's say:
<text>Bla bla bla <name>J. Smith</name>, blab bla blablablabla.</text>
I used the SAXON 4.5 API and wrote a small program to split bigger
files. The default element handler was ElementCopier. This handler puts
a \n after all endElement. So the result is:
<text>Bla bla bla <name>J. Smith</name>
, blab bla blablablabla.</text>
The problem is that the \n is shown in browsers as space, so when
displaying as HTML with a servlet:
Bla bla bla J. Smith , blab bla blablablabla.
^^^^^
My question is: Is that \n really needed?
The part of com.icl.saxon.handlers.ElementCopier which I've mentioned:
...
public void endElement( ElementInfo e, Context context ) throws
SAXException
{
Outputter out = context.getOutputter();
out.write( "</" );
out.write(e.getName());
out.write( ">\n" );
}
...
Again: Is it really needed? Probably there's something in the background
but I don't know what.
Thank you very much,
Zsolt Czinkos
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








