[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xsl-list
Subject:    [xsl] Re: can I *undefine* an attribute via xsl:attribute?
From:       "Piez, Wendell A. (Fed) wendell.piez () nist ! gov" <xsl-list-service () lists ! mulberryt
Date:       2020-08-03 13:53:48
Message-ID: 20200803095307.7082 () lists ! mulberrytech ! com
[Download RAW message or body]

Chris,

Maybe what you had mixed up is the difference between creating an attribute and \
adding an attribute to the result tree.

Once you've added an attribute to the result tree, you can't remove it, or it \
wouldn't be the result tree. You can certainly add an attribute to a temporary tree, \
then copy that attribute (or not), to the result tree. There are a number of ways \
that can be accomplished.

Cheers, Wendell

From: Chris Papademetrious christopher.papademetrious@synopsys.com \
                <xsl-list-service@lists.mulberrytech.com>
Sent: Saturday, August 1, 2020 11:04 AM
To: xsl-list@lists.mulberrytech.com
Subject: [xsl] can I *undefine* an attribute via xsl:attribute?

Hi all,

I would like to call a template that creates various attributes, then conditionally \
*undefine* certain attributes, using some **MAGIC** below:

<xsl:template name="create-my-attributes>
  <xsl:call-template name="create-their-attributes"/>
  <xsl:attribute name="unwanted-attribute" select=**MAGIC**/>
</xsl:template>

A later xsl:attribute definition overrides an earlier value. But can I somehow define \
an attribute as "undefined" to uncreate it? The spec at

https://www.w3.org/TR/xslt-30/#creating-attributes<https://gcc02.safelinks.protection. \
outlook.com/?url=https%3A%2F%2Fwww.w3.org%2FTR%2Fxslt-30%2F%23creating-attributes&data \
=02%7C01%7Cwendell.piez%40nist.gov%7C28cc03313d8749dbe46908d8362c1b47%7C2ab5d82fd8fa47 \
97a93e054655c61dec%7C1%7C0%7C637318910352971473&sdata=3XurZqUO7B%2Fuduc4MP4eD%2Bi5bhxoJCa5CkF3MT9diEU%3D&reserved=0>


doesn't mention this as an option, but I'm a novice and perhaps I missed something.

Thanks!

-----
Chris Papademetrious
Tech Writer, Implementation Group
(610) 628-9718 home office
(570) 460-6078 cell

XSL-List info and archive<https://gcc02.safelinks.protection.outlook.com/?url=http%3A% \
2F%2Fwww.mulberrytech.com%2Fxsl%2Fxsl-list&data=02%7C01%7Cwendell.piez%40nist.gov%7C28 \
cc03313d8749dbe46908d8362c1b47%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C637318910352971473&sdata=dLnxIEN87Wf1xv21doc8IVum1bvpZEVj9ps4khlH0Rc%3D&reserved=0>
 EasyUnsubscribe<https://gcc02.safelinks.protection.outlook.com/?url=http%3A%2F%2Flist \
s.mulberrytech.com%2Funsub%2Fxsl-list%2F3302254&data=02%7C01%7Cwendell.piez%40nist.gov \
%7C28cc03313d8749dbe46908d8362c1b47%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C637318910352981430&sdata=sJ%2BksZ6KWKyw15Re5Xf1stLpndXW40gUtZA6FvBYwvI%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/651070
or by email: xsl-list-unsub@lists.mulberrytech.com
--~--


[Attachment #3 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
	{mso-style-name:msonormal;
	mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
span.EmailStyle18
	{mso-style-type:personal;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
span.EmailStyle19
	{mso-style-type:personal-reply;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Chris,<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Maybe what you had mixed up is the difference between creating \
an attribute and adding an attribute to the result tree.<o:p></o:p></p> <p \
class="MsoNormal"><o:p>&nbsp;</o:p></p> <p class="MsoNormal">Once you&#8217;ve added \
an attribute to the result tree, you can&#8217;t remove it, or it wouldn&#8217;t be \
the result tree. You can certainly add an attribute to a temporary tree, then copy \
that attribute (or not), to the result tree. There are a number  of ways that can be \
accomplished.<o:p></o:p></p> <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Cheers, Wendell<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Chris Papademetrious \
christopher.papademetrious@synopsys.com \
&lt;xsl-list-service@lists.mulberrytech.com&gt; <br>
<b>Sent:</b> Saturday, August 1, 2020 11:04 AM<br>
<b>To:</b> xsl-list@lists.mulberrytech.com<br>
<b>Subject:</b> [xsl] can I *undefine* an attribute via xsl:attribute?<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Hi all,<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I would like to call a template that creates various attributes, \
then conditionally *<b>undefine</b>* certain attributes, using some **MAGIC** \
below:<o:p></o:p></p> <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">&lt;xsl:template \
name=&quot;create-my-attributes&gt;<o:p></o:p></p> <p class="MsoNormal">&nbsp; \
&lt;xsl:call-template name=&quot;create-their-attributes&quot;/&gt;<o:p></o:p></p> <p \
class="MsoNormal">&nbsp; &lt;xsl:attribute name=&quot;unwanted-attribute&quot; \
select=**MAGIC**/&gt;<o:p></o:p></p> <p \
class="MsoNormal">&lt;/xsl:template&gt;<o:p></o:p></p> <p \
class="MsoNormal"><o:p>&nbsp;</o:p></p> <p class="MsoNormal">A later xsl:attribute \
definition overrides an earlier value. But can I somehow define an attribute as \
&#8220;undefined&#8221; to uncreate it? The spec at<o:p></o:p></p> <p \
class="MsoNormal"><o:p>&nbsp;</o:p></p> <p class="MsoNormal" \
style="text-indent:.5in"><a \
href="https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.w3.org%2FT \
R%2Fxslt-30%2F%23creating-attributes&amp;data=02%7C01%7Cwendell.piez%40nist.gov%7C28cc \
03313d8749dbe46908d8362c1b47%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C637318910352 \
971473&amp;sdata=3XurZqUO7B%2Fuduc4MP4eD%2Bi5bhxoJCa5CkF3MT9diEU%3D&amp;reserved=0">https://www.w3.org/TR/xslt-30/#creating-attributes</a><o:p></o:p></p>
 <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">doesn&#8217;t mention this as an option, but I&#8217;m a novice \
and perhaps I missed something.<o:p></o:p></p> <p \
class="MsoNormal"><o:p>&nbsp;</o:p></p> <p class="MsoNormal">Thanks!<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt">-----<br>
</span>Chris Papademetrious<o:p></o:p></p>
<p class="MsoNormal">Tech Writer, Implementation Group<o:p></o:p></p>
<p class="MsoNormal">(610) 628-9718 home office<o:p></o:p></p>
<p class="MsoNormal">(570) 460-6078 cell<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<div style="border:none;border-top:solid black 1.0pt;padding:4.0pt 0in 0in \
0in;margin-top:5.0pt;margin-bottom:5.0pt"> <p class="MsoNormal" align="center" \
style="text-align:center;background:#DDDDDD"> <span \
style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#888888"><a \
href="https://gcc02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.mulberrytec \
h.com%2Fxsl%2Fxsl-list&amp;data=02%7C01%7Cwendell.piez%40nist.gov%7C28cc03313d8749dbe4 \
6908d8362c1b47%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C637318910352971473&amp;sdata=dLnxIEN87Wf1xv21doc8IVum1bvpZEVj9ps4khlH0Rc%3D&amp;reserved=0">XSL-List
  info and archive</a> <o:p></o:p></span></p>
<p class="MsoNormal" align="center" style="text-align:center;background:#DDDDDD">
<span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#888888"><a \
href="https://gcc02.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.mulberryt \
ech.com%2Funsub%2Fxsl-list%2F3302254&amp;data=02%7C01%7Cwendell.piez%40nist.gov%7C28cc \
03313d8749dbe46908d8362c1b47%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C637318910352 \
981430&amp;sdata=sJ%2BksZ6KWKyw15Re5Xf1stLpndXW40gUtZA6FvBYwvI%3D&amp;reserved=0">EasyUnsubscribe</a>
  (<a href="">by email</a>)
<o:p></o:p></span></p>
</div>
</div>
</div>
</body>
</html>
<div><!-- begin bl.html.trailer -->
<div style="border-top:1px solid black; background-color: #dddddd;
color: #888888; font-size: smaller; padding: 5px; text-align: center;
font-family: arial,verdana,arial,sans-serif; margin-top:1em; clear:
both; margin: auto">
<a href="http://www.mulberrytech.com/xsl/xsl-list">
XSL-List info and archive</a>
<div style="text-align:center;">
<a style="color: blue;"
  href="http://lists.mulberrytech.com/unsub/xsl-list/651070"
> EasyUnsubscribe</a>
(<a style="color: blue;"
href="mailto:xsl-list-unsub@lists.mulberrytech.com?subject=remove"
> by email</a>)
</div>
</div>
<!-- end bl.html.trailer --></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic