You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by MAHE Vincent FTRD/DIH/REN <vi...@rd.francetelecom.com> on 2002/03/27 16:43:51 UTC

RE: How can I serialize my XML doc with an opening and closing ta g

thanks, I will build a post-process system.

Vincent

-----Message d'origine-----
De: Joseph Kesselman/CAM/Lotus [mailto:joseph_kesselman@us.ibm.com]
Date: mercredi 27 mars 2002 16:08
À: xalan-dev@xml.apache.org
Objet: Re: How can I serialize my XML doc with an opening and closing
tag



>How can I explicitly serialize my node as <toto></toto> ?

I don't think our serializer currently allows you to control that. XML
considers <toto></toto> and <toto/> to be completely equivalent, so
arguably you shouldn't _need_ to control it...

It'd be possible to modify Xalan to add a non-standard feature which
allowed telling the system which elements should always be output as
separate start and end tags. There's be some complexity in determining
where to obtain that information, where to store it, and how to pass it to
the serializer. And there's be some performance overhead since we's now
need to check element names against that list... so I'd argue that this
should be a separate subclass of the serializer, used only when an
exceptions list was provided.

Until and unless that's implemented (and I"m not entirely convinced it
would be a good investment), the easiest solution might be for you to have
Xalan generate a SAXResult, and plug in your own SAX serializer which has
the special behaviors you need. Or for you to postprocess Xalan's output to
expand those empty-element tags.