Re: [xsl] How to retain the end tag when outputting an empty element?

Subject: Re: [xsl] How to retain the end tag when outputting an empty element?
From: "Wendell Piez wapiez@xxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 17 Jun 2022 14:18:44 -0000
Richard,

Indeed, ordinarily one would face this requirement when writing to a *non*
XML syntax target, such as HTML or many other things that look like XML,
but ain't.

As to the question of canonical form(s) and synonymy, there is history, and
maybe someone with fingers on the archives could reflect (Peter? Eliot?).
Part of the deep problem is the implications of saying there is a
difference.

Cheers, Wendell

On Fri, Jun 17, 2022 at 10:09 AM Kerry, Richard richard.kerry@xxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

>
>
> 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.
>
>
>
> Regards,
>
> Richard.
>
>
>
>
>
> *From:* Wendell Piez wapiez@xxxxxxxxxxxxxxx <
> xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
> *Sent:* 17 June 2022 14:55
> *To:* xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> *Subject:* Re: [xsl] How to retain the end tag when outputting an empty
> element?
>
>
>
> *Caution!* External email. Do not open attachments or click links, unless
> this email comes from a known sender and you know the content is safe.
>
> Roger,
>
>
>
> One way is to see to it that the element has some kind of content
>
>
> <xsl:template match="text()">
>   <xsl:comment> burp </xsl:comment>
>   <xsl:next-match/>
> </xsl:template>
>
> ... although I would call this kind of desperate and not always a
> "solution".
>
>
>
> Cheers, Wendell
>
>
>
>
>
> Cheers, Wendell
>
>
>
> On Fri, Jun 17, 2022 at 8:15 AM Roger L Costello costello@xxxxxxxxx <
> xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Hi Folks,
>
> For this element:
>
> <test>foo</test>
>
> The following XSLT:
>
>     <xsl:template match="*">
>         <xsl:element name="{name(.)}">
>             <xsl:apply-templates />
>         </xsl:element>
>     </xsl:template>
>
>     <xsl:template match="text()" />
>
> Outputs this:
>
> <test/>
>
> How do I get the XSLT processor to output both the start tag and the end
> tag:
>
> <test></test>
>
> /Roger
>
>
>
>
>
> --
>
> ...Wendell Piez... ...wendell -at- nist -dot- gov...
> ...wendellpiez.com... ...pellucidliterature.org... ...pausepress.org...
> ...github.com/wendellpiez.
>
<https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgithub.com%
2Fwendellpiez.&data=05%7C01%7Crichard.kerry%40atos.net%7Cab3b68f5ed7e4d6fdb91
08da5068fd28%7C33440fc6b7c7412cbb730e70b0198d5a%7C0%7C0%7C637910709706903888%
7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiL
CJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=8Cz6kCTioSEYJ03RVQeUN4YW%2Bm%2B7%2FUvENE4
tIGv9VeA%3D&reserved=0>..
> ...gitlab.coko.foundation/wendell...
>
> XSL-List info and archive
>
<https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.mulberr
ytech.com%2Fxsl%2Fxsl-list&data=05%7C01%7Crichard.kerry%40atos.net%7Cab3b68f5
ed7e4d6fdb9108da5068fd28%7C33440fc6b7c7412cbb730e70b0198d5a%7C0%7C0%7C6379107
09706903888%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBT
iI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=KoMcn2%2Bi9V1LcH%2BgJuvforqQ5
PXo2vcjjx8dXnesm7k%3D&reserved=0>
>
> EasyUnsubscribe
>
<https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.mulbe
rrytech.com%2Funsub%2Fxsl-list%2F2528992&data=05%7C01%7Crichard.kerry%40atos.
net%7Cab3b68f5ed7e4d6fdb9108da5068fd28%7C33440fc6b7c7412cbb730e70b0198d5a%7C0
%7C0%7C637910709706903888%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjo
iV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jtL9WFEoHPdCpGM
h9EIvokNZikmn8B2iDBe2%2BN6Z40o%3D&reserved=0>
> (by email)
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/174322> (by
> email <>)
>


--
...Wendell Piez... ...wendell -at- nist -dot- gov...
...wendellpiez.com... ...pellucidliterature.org... ...pausepress.org...
...github.com/wendellpiez... ...gitlab.coko.foundation/wendell...

Current Thread