[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Self-closing elements upset some browsers

Subject: Re: Self-closing elements upset some browsers
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 13 Mar 2008 14:23:52 -0400
Re:  Self-closing elements upset some browsers
At 2008-03-13 13:02 +0000, Marroc wrote:
The identity transform part of my xsl is transferring html <a> links from
the input to the output as follows:

Input: <a name="o1399"></a><h2 class="heading2">Licensing</h2>
Output: <a name="o1399" shape="rect"/><h2 class="heading2">Licensing</h2>
...
- I don't want it, so if you can suggest how I can avoid it then good but,

In your identity transform stylesheet, this will suppress the copying of the attribute:


<xsl:template match="a/@shape"/>

my major problem, with these links (and similarly with <script /> elements
is that browsers do not like these 'self-closing' elements.

My solution for the script elements was to insert an <xsl:text> </xsl:text>
and thereby stretch them into a begin and end tag. You can see that I can't
do the same for the links because the space would appear (with blue
underline) in the output.

Any suggestions for forcing elements to use a start and end tag?

I put an empty comment in using <xsl:comment/>, not a text node using <xsl:text> ... the comment forces the need for an end tag.


I hope this helps.

. . . . . . . . . . . . . . Ken

--
Upcoming:  UBL Apr.22,24; genericode code lists Apr.23; Rome,Italy
World-wide corporate, govt. & user group XML, XSL and UBL training
RSS feeds:     publicly-available developer resources and training
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.