[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: "Martinez, Brian" <brian.martinez@xxxxxxxxxxx>
Date: Tue, 6 Jan 2004 14:06:17 -0700
self closing
> From: annirack@xxxxxxx [mailto:annirack@xxxxxxx]
> Sent: Tuesday, January 06, 2004 1:22 PM
> Subject:  self closing elements with attributes
> 
> 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.

Unless something is horribly broken in your XSLT processor, I believe you're
misreading your output.  If your output is set to XML (the default if you
don't specify an xsl:output element), you should get a minimized empty
element:

<foo bar="some foo" /> (note the slash before the greater-than bracket)

Saxon omits the space between the attribute value and the slash:

<foo bar="some foo"/>

Either result is valid XML.

cheers,
b.

| brian martinez                           brian.martinez@xxxxxxxxxxx |
| lead gui programmer                                    303.357.3548 |
| cheap tickets, part of trip network                fax 303.357.3380 |
| 6560 greenwood plaza blvd., suite 400           englewood, co 80111 |
| cendant travel distribution services   http://www.cheaptickets.com/ |

 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.