[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: self closing elements with attributes
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|