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

Re: How to retain the end tag when outputting an empty

Subject: Re: How to retain the end tag when outputting an empty element?
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 17 Jun 2022 15:57:21 -0000
Re:  How to retain the end tag when outputting an empty
> Surely <test/> is canonical, and <test></test> isnbt?
> Or maybe I should look-up what canonical means in this context.
> And I guess the next question would be bwhyb as all XML parsers are (or
should be) happy with the single form, shouldnbt they.
>

https://www.w3.org/TR/xml-c14n/#XMLCanonicalization section 2.3.

<test></test> is the canonical form. I've no idea why. Perhaps because it's
simpler, in the sense that all elements are serialized the same way regardless
of whether or not they are empty. (With no need for special rules about edge
cases, like elements that are empty except for comments).

Michael Kay
Saxonica

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.