Re: Transform selected attribute to element when element already has a value | XSLT 2.0

"Sam Spade [email protected]" <[email protected]> Sat, 22 May 2021 00:01:56 -0000
Newsgroups gmane.text.xml.xsl.general.mulberrytech
Message-ID <[email protected]>
------=_Part_482139_519671151.1621641678021
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

=20
2.=C2=A0=C2=A0=C2=A0=C2=A0 As I point out in the post,=20

=C2=A0

https://stackoverflow.com/questions/67575484/what-attribute-node-cannot-fol=
low-non-attribute-node-in-element-content-tells

=C2=A0

it is not only very difficult to search value if anelement (<currency>) con=
tains both element (<id>) and text value(USD) but alsoreturns false result.

=C2=A0

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 <amount>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 <currency>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <id>settlementCurrency</id>US=
D</currency>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 <referenceAmount>StandardISDA</referenceAmount>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 <cashSettlement>true</cashSettlement>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 </amount>

=C2=A0

That USD really is the value of <currency>. In this case, it is legitimate =
andsensible to transform id as sibling element of its originalelement <curr=
ency> (its parent is still <amount>) to:

=C2=A0

<amount>
=C2=A0=C2=A0=C2=A0 <currency>USD</currency>
=C2=A0=C2=A0=C2=A0 <id>settlementCurrency</id>
=C2=A0=C2=A0=C2=A0 <referenceAmount>StandardISDA</referenceAmount>
=C2=A0=C2=A0=C2=A0 <cashSettlement>true</cashSettlement>
</amount>

The flattened XML is very searchable (an index on 'currency' is good enough=
) and can be transformed to JSON.

    On Friday, May 21, 2021, 10:35:53 a.m. MST, Martin Honnen martin.honnen=
@gmx.de <[email protected]> wrote:=20=20
=20
 On 21.05.2021 16:30, Sam Spade [email protected] wrote:
> |The transformation logic:
> |||
>
> |
> 1) transform namespace
>
> 2) transform root element
>
> 3) transform the selected attribute(s) to element (the attribute name is
> parameterised not hard-coded)
>
> 4) the transformed element shouldn't contain both other element
> (transformed from the attribute) and its original data
> |
>
> |
> The desired result:
>
> |<requestProduct xmlns=3D"http://fc.fasset/product"> <trade> <cal>
> <c>PRECEDING</c> <bcs> <id>businessCenters</id> <bc>USNY</bc>
> <bc>GBLO</bc> </bcs> </cal> <amount> *<currency>USD</currency>
> <id>settlementCurrency</id>*
> <referenceAmount>StandardISDA</referenceAmount>
> <cashSettlement>true</cashSettlement> </amount> </trade> </requestProduct=
>|
>
> What is wrong with my module? How can I transform the input to the
> desired result? |

What is the criteria to transform an attribute to a child element of its
parent as is done for the "id" of the "bcs" element and what is the
criteria for the other choice, to not include the new element as a child
but to make it a sibling of the (previous) parent element?


=20=20
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/3329386
or by email: [email protected]
--~--

------=_Part_482139_519671151.1621641678021
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html><head></head><body><div class=3D"ydpfce75138yahoo-style-wrap" style=
=3D"font-family:bookman old style, new york, times, serif;font-size:13px;">=
<div></div>
        <div dir=3D"ltr" data-setdir=3D"false"><div>

<p class=3D"ydp735fa017yiv9501170214ydpa3d97190MsoListParagraph" style=3D"m=
argin:0in 0in 0in 0.5in;line-height:normal;background-color:white;backgroun=
d-repeat:repeat;background-attachment:scroll;background-image:none;backgrou=
nd-size:auto;"><font size=3D"3" face=3D"Helvetica Neue, Helvetica, Arial, s=
ans-serif"><span><span>2.<span style=3D"font-style:normal;font-weight:norma=
l;font-stretch:normal;font-size:7pt;line-height:normal;font-size-adjust:non=
e;">&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style=3D"color:blac=
k;">As I point out in the post, </span></font></p><font size=3D"3" face=3D"=
Helvetica Neue, Helvetica, Arial, sans-serif">

</font><p class=3D"ydp735fa017yiv9501170214ydpa3d97190MsoNormal" style=3D"m=
argin:0in 0in 0in 0.25in;line-height:normal;background-color:white;backgrou=
nd-repeat:repeat;background-attachment:scroll;background-image:none;backgro=
und-size:auto;"><font size=3D"3" face=3D"Helvetica Neue, Helvetica, Arial, =
sans-serif">&nbsp;</font></p>

<p class=3D"ydp735fa017yiv9501170214ydpa3d97190MsoNormal" style=3D"margin:0=
in 0in 0in 0.25in;line-height:normal;background-color:white;background-repe=
at:repeat;background-attachment:scroll;background-image:none;background-siz=
e:auto;"><span style=3D"color:black;"><a shape=3D"rect" href=3D"https://sta=
ckoverflow.com/questions/67575484/what-attribute-node-cannot-follow-non-att=
ribute-node-in-element-content-tells" rel=3D"nofollow" target=3D"_blank">ht=
tps://stackoverflow.com/questions/67575484/what-attribute-node-cannot-follo=
w-non-attribute-node-in-element-content-tells</a></span></p>

<p class=3D"ydp735fa017yiv9501170214ydpa3d97190MsoNormal" style=3D"margin:0=
in 0in 0in 0.25in;line-height:normal;background-color:white;background-repe=
at:repeat;background-attachment:scroll;background-image:none;background-siz=
e:auto;">&nbsp;</p>

<p class=3D"ydp735fa017yiv9501170214ydpa3d97190MsoNormal" style=3D"margin:0=
in;line-height:normal;background-color:white;background-repeat:repeat;backg=
round-attachment:scroll;background-image:none;background-size:auto;"><font =
size=3D"3" face=3D"Helvetica Neue, Helvetica, Arial, sans-serif"><span styl=
e=3D"color:black;">it is not only very difficult to search value if an
element (</span></font><span style=3D"font-size:12pt;font-family:Times New =
Roman, serif;color:rgb(0, 0, 150);background-color:white;background-repeat:=
repeat;background-attachment:scroll;background-image:none;background-size:a=
uto;">&lt;currency&gt;</span><span style=3D"font-size:12.0pt;font-family:Ti=
mes New Roman, serif;color:#000096;">) </span><span style=3D"color:black;">=
<font style=3D"background-color:inherit;" size=3D"3" face=3D"Helvetica Neue=
, Helvetica, Arial, sans-serif">contains both element </font>(</span><span =
style=3D"font-size:12pt;font-family:Times New Roman, serif;color:rgb(0, 0, =
150);background-color:white;background-repeat:repeat;background-attachment:=
scroll;background-image:none;background-size:auto;">&lt;id&gt;</span><span =
style=3D"font-size:12.0pt;font-family:Times New Roman, serif;color:#000096;=
">) </span><font size=3D"3" face=3D"Helvetica Neue, Helvetica, Arial, sans-=
serif"><span style=3D"color:black;">and text value</span></font><span style=
=3D"font-size:12.0pt;font-family:Times New Roman, serif;color:#000096;">
(USD) </span><font size=3D"3" face=3D"Helvetica Neue, Helvetica, Arial, san=
s-serif"><span style=3D"color:black;">but also
returns false result.</span></font></p>

<p class=3D"ydp735fa017yiv9501170214ydpa3d97190MsoNormal" style=3D"margin:0=
in;line-height:normal;background-color:white;background-repeat:repeat;backg=
round-attachment:scroll;background-image:none;background-size:auto;">&nbsp;=
</p>

<p class=3D"ydp735fa017yiv9501170214ydpa3d97190MsoNormal" style=3D"margin:0=
in;line-height:normal;background-color:white;background-repeat:repeat;backg=
round-attachment:scroll;background-image:none;background-size:auto;"><span =
style=3D"font-size:12pt;font-family:Times New Roman, serif;color:black;back=
ground-color:white;background-repeat:repeat;background-attachment:scroll;ba=
ckground-image:none;background-size:auto;"><span>&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><s=
pan style=3D"font-size:12pt;font-family:Times New Roman, serif;color:rgb(0,=
 0, 150);background-color:white;background-repeat:repeat;background-attachm=
ent:scroll;background-image:none;background-size:auto;">&lt;amount&gt;</spa=
n><span style=3D"font-size:12pt;font-family:Times New Roman, serif;color:bl=
ack;background-color:white;background-repeat:repeat;background-attachment:s=
croll;background-image:none;background-size:auto;"><br clear=3D"none">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style=3D"font-size:12=
pt;font-family:Times New Roman, serif;color:rgb(0, 0, 150);background-color=
:white;background-repeat:repeat;background-attachment:scroll;background-ima=
ge:none;background-size:auto;">&lt;currency&gt;</span><span style=3D"font-s=
ize:12pt;font-family:Times New Roman, serif;color:black;background-color:wh=
ite;background-repeat:repeat;background-attachment:scroll;background-image:=
none;background-size:auto;"><br clear=3D"none">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span sty=
le=3D"font-size:12pt;font-family:Times New Roman, serif;color:rgb(0, 0, 150=
);background-color:white;background-repeat:repeat;background-attachment:scr=
oll;background-image:none;background-size:auto;">&lt;id&gt;</span><span sty=
le=3D"font-size:12pt;font-family:Times New Roman, serif;color:black;backgro=
und-color:white;background-repeat:repeat;background-attachment:scroll;backg=
round-image:none;background-size:auto;">settlementCurrency</span><span styl=
e=3D"font-size:12pt;font-family:Times New Roman, serif;color:rgb(0, 0, 150)=
;background-color:white;background-repeat:repeat;background-attachment:scro=
ll;background-image:none;background-size:auto;">&lt;/id&gt;</span><span sty=
le=3D"font-size:12pt;font-family:Times New Roman, serif;color:black;backgro=
und-color:white;background-repeat:repeat;background-attachment:scroll;backg=
round-image:none;background-size:auto;">USD</span><span style=3D"font-size:=
12pt;font-family:Times New Roman, serif;color:rgb(0, 0, 150);background-col=
or:white;background-repeat:repeat;background-attachment:scroll;background-i=
mage:none;background-size:auto;">&lt;/currency&gt;</span><span style=3D"fon=
t-size:12pt;font-family:Times New Roman, serif;color:black;background-color=
:white;background-repeat:repeat;background-attachment:scroll;background-ima=
ge:none;background-size:auto;"><br clear=3D"none">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style=3D"font-size:12=
pt;font-family:Times New Roman, serif;color:rgb(0, 0, 150);background-color=
:white;background-repeat:repeat;background-attachment:scroll;background-ima=
ge:none;background-size:auto;">&lt;referenceAmount&gt;</span><span style=3D=
"font-size:12pt;font-family:Times New Roman, serif;color:black;background-c=
olor:white;background-repeat:repeat;background-attachment:scroll;background=
-image:none;background-size:auto;">StandardISDA</span><span style=3D"font-s=
ize:12pt;font-family:Times New Roman, serif;color:rgb(0, 0, 150);background=
-color:white;background-repeat:repeat;background-attachment:scroll;backgrou=
nd-image:none;background-size:auto;">&lt;/referenceAmount&gt;</span><span s=
tyle=3D"font-size:12pt;font-family:Times New Roman, serif;color:black;backg=
round-color:white;background-repeat:repeat;background-attachment:scroll;bac=
kground-image:none;background-size:auto;"><br clear=3D"none">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style=3D"font-size:12=
pt;font-family:Times New Roman, serif;color:rgb(0, 0, 150);background-color=
:white;background-repeat:repeat;background-attachment:scroll;background-ima=
ge:none;background-size:auto;">&lt;cashSettlement&gt;</span><span style=3D"=
font-size:12pt;font-family:Times New Roman, serif;color:black;background-co=
lor:white;background-repeat:repeat;background-attachment:scroll;background-=
image:none;background-size:auto;">true</span><span style=3D"font-size:12pt;=
font-family:Times New Roman, serif;color:rgb(0, 0, 150);background-color:wh=
ite;background-repeat:repeat;background-attachment:scroll;background-image:=
none;background-size:auto;">&lt;/cashSettlement&gt;</span><span style=3D"fo=
nt-size:12pt;font-family:Times New Roman, serif;color:black;background-colo=
r:white;background-repeat:repeat;background-attachment:scroll;background-im=
age:none;background-size:auto;"><br clear=3D"none">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; </span></span><span style=3D"font-size:12pt;font-family:Tim=
es New Roman, serif;color:rgb(0, 0, 150);background-color:white;background-=
repeat:repeat;background-attachment:scroll;background-image:none;background=
-size:auto;">&lt;/amount&gt;</span><span style=3D"font-size:12pt;font-famil=
y:Times New Roman, serif;background-color:white;background-repeat:repeat;ba=
ckground-attachment:scroll;background-image:none;background-size:auto;"></s=
pan></p>

<p class=3D"ydp735fa017yiv9501170214ydpa3d97190MsoNormal" style=3D"margin:0=
in;line-height:normal;background-color:white;background-repeat:repeat;backg=
round-attachment:scroll;background-image:none;background-size:auto;">&nbsp;=
</p>

<p class=3D"ydp735fa017yiv9501170214ydpa3d97190MsoNormal" style=3D"margin:0=
in;line-height:normal;background-color:white;background-repeat:repeat;backg=
round-attachment:scroll;background-image:none;background-size:auto;"><font =
size=3D"3" face=3D"Helvetica Neue, Helvetica, Arial, sans-serif"><span styl=
e=3D"color:black;">That </span><span style=3D"font-size:12pt;color:black;ba=
ckground-color:white;background-repeat:repeat;background-attachment:scroll;=
background-image:none;background-size:auto;">USD</span><span style=3D"font-=
size:12pt;color:black;"> </span><span style=3D"color:black;">really is the =
value of</span></font><span style=3D"font-size:12.0pt;font-family:Times New=
 Roman, serif;color:black;"> </span><span style=3D"font-size:12pt;font-fami=
ly:Times New Roman, serif;color:rgb(0, 0, 150);background-color:white;backg=
round-repeat:repeat;background-attachment:scroll;background-image:none;back=
ground-size:auto;">&lt;currency&gt;</span><span style=3D"font-size:12.0pt;f=
ont-family:Times New Roman, serif;color:#000096;">.<font style=3D"backgroun=
d-color:inherit;" size=3D"3" face=3D"Helvetica Neue, Helvetica, Arial, sans=
-serif"> </font></span><font size=3D"3" face=3D"Helvetica Neue, Helvetica, =
Arial, sans-serif"><span style=3D"color:black;">In this case, it is legitim=
ate and
sensible to transform </span></font><span style=3D"font-size:12pt;font-fami=
ly:Times New Roman, serif;color:rgb(0, 0, 150);background-color:white;backg=
round-repeat:repeat;background-attachment:scroll;background-image:none;back=
ground-size:auto;">id</span><span style=3D"color:black;"> <font style=3D"ba=
ckground-color:inherit;" size=3D"3" face=3D"Helvetica Neue, Helvetica, Aria=
l, sans-serif">as sibling element of its original
element</font> </span><span style=3D"font-size:12pt;font-family:Times New R=
oman, serif;color:rgb(0, 0, 150);background-color:white;background-repeat:r=
epeat;background-attachment:scroll;background-image:none;background-size:au=
to;">&lt;currency&gt;</span><span style=3D"color:black;"> (<font style=3D"b=
ackground-color:inherit;" size=3D"3" face=3D"Helvetica Neue, Helvetica, Ari=
al, sans-serif">its parent is still</font> </span><span style=3D"font-size:=
12pt;font-family:Times New Roman, serif;color:rgb(0, 0, 150);background-col=
or:white;background-repeat:repeat;background-attachment:scroll;background-i=
mage:none;background-size:auto;">&lt;amount&gt;</span><span style=3D"color:=
black;">) <font style=3D"background-color:inherit;" size=3D"3" face=3D"Helv=
etica Neue, Helvetica, Arial, sans-serif">to:</font></span></p>

<p class=3D"ydp735fa017yiv9501170214ydpa3d97190MsoNormal" style=3D"margin:0=
in;line-height:normal;background-color:white;background-repeat:repeat;backg=
round-attachment:scroll;background-image:none;background-size:auto;"><span =
style=3D"font-size:12.0pt;font-family:Times New Roman, serif;color:#000096;=
">&nbsp;</span></p>

<p class=3D"ydp735fa017yiv9501170214ydpa3d97190MsoNormal" style=3D"margin:0=
in;line-height:normal;background-color:white;background-repeat:repeat;backg=
round-attachment:scroll;background-image:none;background-size:auto;"><span =
style=3D"font-size:12pt;font-family:Times New Roman, serif;color:rgb(0, 0, =
150);background-color:white;background-repeat:repeat;background-attachment:=
scroll;background-image:none;background-size:auto;">&lt;amount&gt;</span><s=
pan style=3D"font-size:12pt;font-family:Times New Roman, serif;color:black;=
background-color:white;background-repeat:repeat;background-attachment:scrol=
l;background-image:none;background-size:auto;"><br clear=3D"none">
<span>&nbsp;&nbsp;&nbsp; </span></span><span style=3D"font-size:12pt;font-f=
amily:Times New Roman, serif;color:rgb(0, 0, 150);background-color:white;ba=
ckground-repeat:repeat;background-attachment:scroll;background-image:none;b=
ackground-size:auto;">&lt;currency&gt;</span><span style=3D"font-size:12pt;=
font-family:Times New Roman, serif;color:black;background-color:white;backg=
round-repeat:repeat;background-attachment:scroll;background-image:none;back=
ground-size:auto;">USD</span><span style=3D"font-size:12pt;font-family:Time=
s New Roman, serif;color:rgb(0, 0, 150);background-color:white;background-r=
epeat:repeat;background-attachment:scroll;background-image:none;background-=
size:auto;">&lt;/currency&gt;</span><span style=3D"font-size:12pt;font-fami=
ly:Times New Roman, serif;color:black;background-color:white;background-rep=
eat:repeat;background-attachment:scroll;background-image:none;background-si=
ze:auto;"><br clear=3D"none">
<span>&nbsp;&nbsp;&nbsp; </span></span><span style=3D"font-size:12pt;font-f=
amily:Times New Roman, serif;color:rgb(0, 0, 150);background-color:white;ba=
ckground-repeat:repeat;background-attachment:scroll;background-image:none;b=
ackground-size:auto;">&lt;id&gt;</span><span style=3D"font-size:12pt;font-f=
amily:Times New Roman, serif;color:black;background-color:white;background-=
repeat:repeat;background-attachment:scroll;background-image:none;background=
-size:auto;">settlementCurrency</span><span style=3D"font-size:12pt;font-fa=
mily:Times New Roman, serif;color:rgb(0, 0, 150);background-color:white;bac=
kground-repeat:repeat;background-attachment:scroll;background-image:none;ba=
ckground-size:auto;">&lt;/id&gt;</span><span style=3D"font-size:12pt;font-f=
amily:Times New Roman, serif;color:black;background-color:white;background-=
repeat:repeat;background-attachment:scroll;background-image:none;background=
-size:auto;"><br clear=3D"none">
<span>&nbsp;&nbsp;&nbsp; </span></span><span style=3D"font-size:12pt;font-f=
amily:Times New Roman, serif;color:rgb(0, 0, 150);background-color:white;ba=
ckground-repeat:repeat;background-attachment:scroll;background-image:none;b=
ackground-size:auto;">&lt;referenceAmount&gt;</span><span style=3D"font-siz=
e:12pt;font-family:Times New Roman, serif;color:black;background-color:whit=
e;background-repeat:repeat;background-attachment:scroll;background-image:no=
ne;background-size:auto;">StandardISDA</span><span style=3D"font-size:12pt;=
font-family:Times New Roman, serif;color:rgb(0, 0, 150);background-color:wh=
ite;background-repeat:repeat;background-attachment:scroll;background-image:=
none;background-size:auto;">&lt;/referenceAmount&gt;</span><span style=3D"f=
ont-size:12pt;font-family:Times New Roman, serif;color:black;background-col=
or:white;background-repeat:repeat;background-attachment:scroll;background-i=
mage:none;background-size:auto;"><br clear=3D"none">
<span>&nbsp;&nbsp;&nbsp; </span></span><span style=3D"font-size:12pt;font-f=
amily:Times New Roman, serif;color:rgb(0, 0, 150);background-color:white;ba=
ckground-repeat:repeat;background-attachment:scroll;background-image:none;b=
ackground-size:auto;">&lt;cashSettlement&gt;</span><span style=3D"font-size=
:12pt;font-family:Times New Roman, serif;color:black;background-color:white=
;background-repeat:repeat;background-attachment:scroll;background-image:non=
e;background-size:auto;">true</span><span style=3D"font-size:12pt;font-fami=
ly:Times New Roman, serif;color:rgb(0, 0, 150);background-color:white;backg=
round-repeat:repeat;background-attachment:scroll;background-image:none;back=
ground-size:auto;">&lt;/cashSettlement&gt;</span><span style=3D"font-size:1=
2pt;font-family:Times New Roman, serif;color:black;background-color:white;b=
ackground-repeat:repeat;background-attachment:scroll;background-image:none;=
background-size:auto;"><br clear=3D"none">
</span><span style=3D"font-size:12pt;font-family:Times New Roman, serif;col=
or:rgb(0, 0, 150);background-color:white;background-repeat:repeat;backgroun=
d-attachment:scroll;background-image:none;background-size:auto;">&lt;/amoun=
t&gt;</span><span style=3D"font-size:12pt;font-family:Times New Roman, seri=
f;background-color:white;background-repeat:repeat;background-attachment:scr=
oll;background-image:none;background-size:auto;"></span></p>

<div class=3D"ydp735fa017yiv9501170214ydpa3d97190MsoNormal" style=3D"margin=
:0in;line-height:normal;background-color:white;background-repeat:repeat;bac=
kground-attachment:scroll;background-image:none;background-size:auto;"><br =
clear=3D"none"></div><font size=3D"3"><font face=3D"Helvetica Neue, Helveti=
ca, Arial, sans-serif">The flattened XML is very searchable (an index on 'c=
urrency' is good enough) and can be transformed to JSON.</font></font></div=
><div><br></div></div><div><br></div>
=20=20=20=20=20=20=20=20
        </div><div id=3D"ydpcf39a37fyahoo_quoted_1746359216" class=3D"ydpcf=
39a37fyahoo_quoted">
            <div style=3D"font-family:'Helvetica Neue', Helvetica, Arial, s=
ans-serif;font-size:13px;color:#26282a;">
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
                <div>
                    On Friday, May 21, 2021, 10:35:53 a.m. MST, Martin Honn=
en [email protected] &lt;[email protected]&gt; wro=
te:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div dir=3D"ltr">On 21.05.2021 16:30, Sam Spade <a sha=
pe=3D"rect" href=3D"mailto:[email protected]" rel=3D"nofollow" target=
=3D"_blank">[email protected]</a> wrote:<br clear=3D"none">&gt; |The =
transformation logic:<br clear=3D"none">&gt; |||<br clear=3D"none">&gt;<br =
clear=3D"none">&gt; |<br clear=3D"none">&gt; 1) transform namespace<br clea=
r=3D"none">&gt;<br clear=3D"none">&gt; 2) transform root element<br clear=
=3D"none">&gt;<br clear=3D"none">&gt; 3) transform the selected attribute(s=
) to element (the attribute name is<br clear=3D"none">&gt; parameterised no=
t hard-coded)<br clear=3D"none">&gt;<br clear=3D"none">&gt; 4) the transfor=
med element shouldn't contain both other element<br clear=3D"none">&gt; (tr=
ansformed from the attribute) and its original data<br clear=3D"none">&gt; =
|<br clear=3D"none">&gt;<br clear=3D"none">&gt; |<br clear=3D"none">&gt; Th=
e desired result:<br clear=3D"none">&gt;<br clear=3D"none">&gt; |&lt;reques=
tProduct xmlns=3D"<a shape=3D"rect" href=3D"http://fc.fasset/product" rel=
=3D"nofollow" target=3D"_blank">http://fc.fasset/product</a>"&gt; &lt;trade=
&gt; &lt;cal&gt;<br clear=3D"none">&gt; &lt;c&gt;PRECEDING&lt;/c&gt; &lt;bc=
s&gt; &lt;id&gt;businessCenters&lt;/id&gt; &lt;bc&gt;USNY&lt;/bc&gt;<br cle=
ar=3D"none">&gt; &lt;bc&gt;GBLO&lt;/bc&gt; &lt;/bcs&gt; &lt;/cal&gt; &lt;am=
ount&gt; *&lt;currency&gt;USD&lt;/currency&gt;<br clear=3D"none">&gt; &lt;i=
d&gt;settlementCurrency&lt;/id&gt;*<br clear=3D"none">&gt; &lt;referenceAmo=
unt&gt;StandardISDA&lt;/referenceAmount&gt;<br clear=3D"none">&gt; &lt;cash=
Settlement&gt;true&lt;/cashSettlement&gt; &lt;/amount&gt; &lt;/trade&gt; &l=
t;/requestProduct&gt;|<br clear=3D"none">&gt;<br clear=3D"none">&gt; What i=
s wrong with my module? How can I transform the input to the<br clear=3D"no=
ne">&gt; desired result? |<br clear=3D"none"><br clear=3D"none">What is the=
 criteria to transform an attribute to a child element of its<br clear=3D"n=
one">parent as is done for the "id" of the "bcs" element and what is the<br=
 clear=3D"none">criteria for the other choice, to not include the new eleme=
nt as a child<br clear=3D"none">but to make it a sibling of the (previous) =
parent element?<br clear=3D"none"><br clear=3D"none"><br clear=3D"none"></d=
iv></div></div>
            </div>
        </div></body></html>
<div><!-- begin bl.html.trailer -->
<div style=3D"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=3D"http://www.mulberrytech.com/xsl/xsl-list">
XSL-List info and archive</a>
<div style=3D"text-align:center;">
<a style=3D"color: blue;"
  href=3D"http://lists.mulberrytech.com/unsub/xsl-list/3329386"
>EasyUnsubscribe</a>
(<a style=3D"color: blue;"
href=3D"mailto:[email protected]?subject=3Dremove"
>by email</a>)
</div>
</div>
<!-- end bl.html.trailer --></div>

------=_Part_482139_519671151.1621641678021--