Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSLT transformation to <br /> and not <br/>

Status
Not open for further replies.

mountainbiker

Programmer
Aug 21, 2002
122
GB
The XSLT processors I have tried are transforming empty elements like <br/> and not <br />. Do you know how I can retain the space in my elements? (For our older browser customers--like Netscape 4.7--this XML(XHTML) file would have problems.
 
<xsl:template match=&quot;/&quot;>
<xsl:apply-templates />
</xsl:template>

<xsl:template match=&quot; / | @* | node()&quot;>
<xsl:copy>
<xsl:apply-templates select=&quot;@* | node()&quot; />
</xsl:copy>
</xsl:template>

<xsl:template match=&quot;br&quot;>
<br/>
</xsl:template>
Build web applications faster with a few lines of XML Code using DataML[tm]
 
Different processors seem to transform the empty tag differently, e.g., MSXML will transform an empty element like [tt]br[/tt] to [tt]<br />[/tt] and not [tt]<br>[/tt].
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top