> Dear list, > I need to generate SGML instances for FrameMaker 6 from XML instances. > There is a problem with elements that are empty, but not declared EMPTY in > the > SGML DTD: > > >From the XSLT script I write elements with their start and end tags which > are possibly empty. > When such elements happen to be empty, Xalan produces the <../> notation > instead of an explicit end tag. > > Is there an easy (no Java programming) way to force Xalan to write an > expilicit end tag?
This problem has been the bane of my life for ages... especially when you have in your output something like: <div style="color:blue"> <div/> </div> As the empty div is parsed as the opening tag to the closing tag of the first div, which means all subsequent html takes on the the colour blue! The general solution to this is to output a space on each occurance of this, such as using  , preferrably wrapped in a test: <xsl:if test="not(child::node())"> </xsl:if> A pretty poor solution, don’t you think. I asked (on xsl-list) for a miminise-elements="no" switch but it met with apathy, mainly because it’s the browsers 'fault' and not xslt's. Anyway, if you use xslt 2.0 you can use the xhtml output method, which solves all of this. cheers andrew --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.495 / Virus Database: 294 - Release Date: 30/06/2003