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

Re: self closing elements with attributes

Subject: Re: self closing elements with attributes
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 06 Jan 2004 16:00:31 -0500
xsl element closing
Hi Brendan,

The fact that you can duplicate the behavior in more than one processor indicates it's not simply a processor bug.

Could you be more explicit please about a couple of details?

* what is the actual name of the element(s) involved (which you're calling 'foo')?
* what output method, if any, is designated in the stylesheet?
* what is the root element of your output?


These questions are relevant because a serializer is allowed to write old-fashioned SGML syntax when outputting with the HTML method, for elements that are empty in HTML (img, br, hr, meta etc.). (HTML uses SGML syntax, after all.)

If this is the problem, the solution is as easy as tweaking the output method to "xml".

Cheers,
Wendell

At 03:21 PM 1/6/2004, you wrote:
I'm sure this is a newbie problem, but I can't see what I'm doing wrong.

I have a template like this:

<xsl:element name="foo">
<xsl:attribute name="bar">
some foo
</xsl:attribute>
</xsl:element>

I have also tried:

<foo>
<xsl:attribute name="bar">
some foo
</xsl:attribute>
</foo>

Both give the same result:

<foo bar="some foo">

Which is a problem since it does not close the tag. If I try

<xsl:element name="foo">
<xsl:attribute name="bar">
some foo
</xsl:attribute>
foo
</xsl:element>

or

<foo>
<xsl:attribute name="bar">
some foo
</xsl:attribute>
foo
</foo>

The result is a correctly closed tag:

<foo bar="some foo">foo</foo>

I have tried this with the same results on several varieties of MSXML, and on Xalan-1 and Xalan-2

Is there anything I can do about this that won't require post processing?


======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



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.