Re: problem with key

"Albright, Jim [email protected]" <[email protected]> Wed, 14 Apr 2021 22:28:36 -0000
Newsgroups gmane.text.xml.xsl.general.mulberrytech
Message-ID <[email protected]>
--00000000000036a06605bff643e5
Content-Type: text/plain; charset="UTF-8"

In thinking about this, it looks like this can be written as a recursive
routine.  Is this correct?
Right now I run a batch file and increment the level for each step.

Jim Albright
Wycliffe Bible Translators
704-562-1529


On Wed, Apr 14, 2021 at 4:48 PM Albright, Jim [email protected] <
[email protected]> wrote:

> Thank you David and Dimitre,
>
> You are both right.  Thank you.  I would have responded sooner but it took
> me some time to find a bug that caused the file to grow.  I now pass a
> /level/ parameter to facilitate deleting duplicates. Here is working XSLT
>
> <xsl:param name="level"></xsl:param>
>     <xsl:output method="xml" indent="yes" />
>     <xsl:variable name="lookupDoc" select="document('step2.xml')"/>
>
>     <xsl:key name="SemanticDomainByParent" match="CmSemanticDomain"
> use="@parent" />
>
>     <xsl:template match="CmSemanticDomain[@level=$level]"/>
>
>     <xsl:template match="line[@tag='gd']">
>         <xsl:variable name="parentSD" select="parent::*/@sd"/>
>         <SubPossibilities>
>             <xsl:copy-of select="key('SemanticDomainByParent', $parentSD,
> $lookupDoc)"/>
>         </SubPossibilities>
>     </xsl:template>
>
>     <!-- identity transform -->
>     <xsl:template match="@* | node()">
>         <xsl:copy>
>             <xsl:apply-templates select="@* | node()"/>
>         </xsl:copy>
>     </xsl:template>
>
> I ended up building the hierarchy one transformation at a time. The
> inserted text has tag = 'gd' which triggers the insertion the next time
> around.  So multiple application of the same XSL does the trick.
>
> I started by creating a file with just the 0 level of hierarchy. I then
> inserted the correct information from an external file at the correct
> location.  There may be easier ways of doing this.  But this is something
> that I can explain fairly easily to novices.  You continue until you have
> processed all the levels.
>
> Thank you again for your help.
>
> Jim Albright
> Wycliffe Bible Translators
> 704-562-1529
>
>
> On Mon, Apr 12, 2021 at 1:20 AM David Maus [email protected] <
> [email protected]> wrote:
>
>> On Mon, 12 Apr 2021 06:08:46 +0200,
>> Albright, Jim [email protected] wrote:
>> >
>> > [1  <text/plain; UTF-8 (7bit)>]
>> > [2  <text/html; UTF-8 (quoted-printable)>]
>> > I am trying to upconvert from a flat-file. After I get it into XML form
>> I try to add hierarchy using "key".
>> > -------------
>> > OUTPUT
>> > -------------
>> > I get NO results from
>> > <SubPossibilities>
>> >             <xsl:copy select="key('SemanticDomainByParent',
>> '$parentSD')"/>
>> > </SubPossibilities>
>>
>> The quotes around $parentSD look wrong. You are looking up elements
>> under the string key '$parentSD'.
>>
>> I think it should read:
>>
>> <xsl:copy select="key('SemanticDomainByParent', $parentSD)"/>
>>
>> HTH,
>>   -- David
>>
>> >
>> > so output looks like
>> > <SubPossibilities/>
>> >
>> > So what am I doing wrong?
>> >
>> > Starting with this XML
>> > -------------
>> > XML input
>> > -------------
>> >
>> > ...      <Possibilities>
>> >          <CmSemanticDomain level="1"      sd="1"   parent=""
>>  guid="I63403699-07C1-43F3-A47C-069D6E4316E5">
>> >             <line tag="sd">Universe, creation</line>
>> >             <line tag="gd">I63403699-07C1-43F3-A47C-069D6E4316E5</line>
>> >          </CmSemanticDomain>
>> >          <CmSemanticDomain level="2"  sd="1.1"   parent="1"
>> guid="I999581C4-1611-4ACB-AE1B-5E6C1DFE6F0C">
>> >                <line tag="sd">Sky</line>
>> >                <line
>> tag="gd">I999581C4-1611-4ACB-AE1B-5E6C1DFE6F0C</line>
>> >           </CmSemanticDomain>
>> >          <CmSemanticDomain level="3"   sd="1.1.1"    parent="1.1"
>> guid="IDC1A2C6F-1B32-4631-8823-36DACC8CB7BB">
>> >             <line tag="sd">Sun</line>
>> >             <line tag="gd">IDC1A2C6F-1B32-4631-8823-36DACC8CB7BB</line>
>> >          </CmSemanticDomain>
>> >          <CmSemanticDomain level="4"  sd="1.1.1.1"    parent="1.1.1"
>>   guid="I1BD42665-0610-4442-8D8D-7C666FEE3A6D">
>> >             <line tag="sd">Moon</line>
>> >             <line tag="gd">I1BD42665-0610-4442-8D8D-7C666FEE3A6D</line>
>> >          </CmSemanticDomain>
>> >          <CmSemanticDomain level="4"  sd="1.1.1.2"  parent="1.1.1"
>> guid="IB044E890-CE30-455C-AEDE-7E9D5569396E">
>> >             <line tag="sd">Star</line>
>> >             <line tag="gd">IB044E890-CE30-455C-AEDE-7E9D5569396E</line>
>> >          </CmSemanticDomain>
>> >          <CmSemanticDomain level="4"  sd="1.1.1.3"   parent="1.1.1"
>> guid="IA0D073DF-D413-4DFD-9BA1-C3C68F126D90">
>> >             <line tag="sd">Planet</line>
>> >             <line tag="gd">IA0D073DF-D413-4DFD-9BA1-C3C68F126D90</line>
>> >          </CmSemanticDomain>
>> >
>> > ...
>> > -------------
>> > XSL
>> > -------------
>> > ...
>> >   <xsl:key name="SemanticDomainByParent" match="CmSemanticDomain"
>> use="@parent" />
>> >
>> >     <xsl:template match="CmSemanticDomain">
>> >         <CmSemanticDomain>
>> >             <xsl:apply-templates select="@* | node()"/>
>> >             <xsl:apply-templates
>> select="key('SemanticDomainByParent',@sd)"/>
>> >         </CmSemanticDomain>
>> >     </xsl:template>
>> >
>> >     <xsl:template match="line[@tag='gd']">
>> >         <xsl:variable name="parentSD" select="parent::*/@parent"/>
>> >         <SubPossibilities>
>> >             <xsl:copy select="key('SemanticDomainByParent',
>> '$parentSD')"/>
>> >         </SubPossibilities>
>> >     </xsl:template>
>> >
>> >     <!-- identity transform -->
>> >     <xsl:template match="@* | node()">
>> >         <xsl:copy>
>> >             <xsl:apply-templates select="@* | node()"/>
>> >         </xsl:copy>
>> >     </xsl:template>
>> >
>> >
>> > -------------
>> > Desired OUTPUT
>> > -------------
>> > ...
>> >       <Possibilities>
>> >          <CmSemanticDomain level="1"      sd="1"   parent=""
>>  guid="I63403699-07C1-43F3-A47C-069D6E4316E5">
>> >                <line tag="sd">Universe, creation</line>
>> >                <SubPossibilities>
>> >                   <CmSemanticDomain level="2"  sd="1.1"   parent="1"
>> guid="I999581C4-1611-4ACB-AE1B-5E6C1DFE6F0C">
>> >                        <line tag="sd">Sky</line>
>> >                       <SubPossibilities>
>> >                           <CmSemanticDomain level="3"   sd="1.1.1"
>> parent="1.1"    guid="IDC1A2C6F-1B32-4631-8823-36DACC8CB7BB">
>> >                               <line tag="sd">Sun</line>
>> >                               <SubPossibilities>
>> >                                   <CmSemanticDomain level="4"
>> sd="1.1.1.2"  parent="1.1.1"  guid="IB044E890-CE30-455C-AEDE-7E9D5569396E">
>> >                                       <line tag="sd">Star</line>
>> >                                   </CmSemanticDomain>
>> >                                   <CmSemanticDomain level="4"
>> sd="1.1.1.3"   parent="1.1.1"
>> guid="IA0D073DF-D413-4DFD-9BA1-C3C68F126D90">
>> >                                        <line tag="sd">Planet</line>
>> >                                  </CmSemanticDomain>
>> > ...
>> >                              </SubPossibilities>
>> >                          </CmSemanticDomain>
>> >                       </SubPossibilities>
>> >                   </CmSemanticDomain>
>> >               </SubPossibilities>
>> >           </CmSemanticDomain>
>> >       </Possibilities>
>> >
>> > Jim Albright
>> > Wycliffe Bible Translators
>> > 704-562-1529
>> > XSL-List info and archive
>> > EasyUnsubscribe (by email)
>>
>> --
>> David Maus M.A.
>>
>> Www: http://dmaus.name
>> Twitter: @_dmaus
>>
>>
>> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/2835196> (by
> email <>)
>
--~----------------------------------------------------------------
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]
--~--

--00000000000036a06605bff643e5
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>In thinking about this, it looks like this can be wri=
tten as a recursive routine.=C2=A0 Is this correct?</div><div>Right now I r=
un a batch file and increment the level for each step.<br></div><div><br></=
div><div><div><div dir=3D"ltr" data-smartmail=3D"gmail_signature"><div dir=
=3D"ltr"><div>Jim Albright</div><div>Wycliffe Bible Translators</div><div>7=
04-562-1529<br></div></div></div></div><br></div></div><br><div class=3D"gm=
ail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, Apr 14, 2021 at 4:=
48 PM Albright, Jim <a href=3D"mailto:[email protected]" target=3D"=
_blank">[email protected]</a> &lt;<a href=3D"mailto:xsl-list-servic=
[email protected]" target=3D"_blank">[email protected]=
tech.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D=
"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le=
ft:1ex"><div dir=3D"ltr"><div>Thank you David and Dimitre,</div><div><br></=
div><div>You are both right.=C2=A0 Thank you.=C2=A0 I would have responded =
sooner but it took me some time to find a bug that caused the file to grow.=
=C2=A0 I now pass a /level/ parameter to facilitate deleting duplicates. He=
re is working XSLT<br></div><div><br></div>&lt;xsl:param name=3D&quot;level=
&quot;&gt;&lt;/xsl:param&gt;<br>=C2=A0 =C2=A0 &lt;xsl:output method=3D&quot=
;xml&quot; indent=3D&quot;yes&quot; /&gt;<br>=C2=A0 =C2=A0 &lt;xsl:variable=
 name=3D&quot;lookupDoc&quot; select=3D&quot;document(&#39;step2.xml&#39;)&=
quot;/&gt;<br>=C2=A0 =C2=A0 <br>=C2=A0 =C2=A0 &lt;xsl:key name=3D&quot;Sema=
nticDomainByParent&quot; match=3D&quot;CmSemanticDomain&quot; use=3D&quot;@=
parent&quot; /&gt;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 <br>=C2=A0 =C2=A0 &lt;xsl=
:template match=3D&quot;CmSemanticDomain[@level=3D$level]&quot;/&gt;<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 <br>=C2=A0 =C2=A0 &lt;xsl:template match=3D&quot;l=
ine[@tag=3D&#39;gd&#39;]&quot;&gt;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;xsl:v=
ariable name=3D&quot;parentSD&quot; select=3D&quot;parent::*/@sd&quot;/&gt;=
<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;SubPossibilities&gt; <br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;xsl:copy-of select=3D&quot;key(&#39;Semanti=
cDomainByParent&#39;, $parentSD, $lookupDoc)&quot;/&gt;<br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 &lt;/SubPossibilities&gt;<br>=C2=A0 =C2=A0 &lt;/xsl:template&=
gt;<br>=C2=A0 =C2=A0 <br>=C2=A0 =C2=A0 &lt;!-- identity transform --&gt;<br=
>=C2=A0 =C2=A0 &lt;xsl:template match=3D&quot;@* | node()&quot;&gt;<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 &lt;xsl:copy&gt;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 &lt;xsl:apply-templates select=3D&quot;@* | node()&quot;/&gt;=
<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;/xsl:copy&gt;<br>=C2=A0 =C2=A0 &lt;/xsl=
:template&gt;<br>=C2=A0 =C2=A0 <div>I ended up building the hierarchy one t=
ransformation at a time. The inserted text has tag =3D &#39;gd&#39; which t=
riggers the insertion the next time around.=C2=A0 So multiple application o=
f the same XSL does the trick.<br></div><div><br></div><div>I started by cr=
eating a file with just the 0 level of hierarchy. I then inserted the corre=
ct information from an external file at the correct location.=C2=A0 There m=
ay be easier ways of doing this.=C2=A0 But this is something that I can exp=
lain fairly easily to novices.=C2=A0 You continue until you have processed =
all the levels.</div><div><br></div><div>Thank you again for your help.</di=
v><div><br></div><div></div><div><div><div dir=3D"ltr"><div dir=3D"ltr"><di=
v>Jim Albright</div><div>Wycliffe Bible Translators</div><div>704-562-1529<=
br></div></div></div></div><br></div></div><br><div class=3D"gmail_quote"><=
div dir=3D"ltr" class=3D"gmail_attr">On Mon, Apr 12, 2021 at 1:20 AM David =
Maus <a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]=
</a> &lt;<a href=3D"mailto:[email protected]" target=
=3D"_blank">[email protected]</a>&gt; wrote:<br></div=
><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border=
-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, 12 Apr 2021 06:0=
8:46 +0200,<br>
Albright, Jim <a href=3D"mailto:[email protected]" target=3D"_blank=
">[email protected]</a> wrote:<br>
&gt; <br>
&gt; [1=C2=A0 &lt;text/plain; UTF-8 (7bit)&gt;]<br>
&gt; [2=C2=A0 &lt;text/html; UTF-8 (quoted-printable)&gt;]<br>
&gt; I am trying to upconvert from a flat-file. After I get it into XML for=
m I try to add hierarchy using &quot;key&quot;.<br>
&gt; -------------<br>
&gt; OUTPUT <br>
&gt; ------------- <br>
&gt; I get NO results from <br>
&gt; &lt;SubPossibilities&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;xsl:copy select=3D&=
quot;key(&#39;SemanticDomainByParent&#39;, &#39;$parentSD&#39;)&quot;/&gt;<=
br>
&gt; &lt;/SubPossibilities&gt;<br>
<br>
The quotes around $parentSD look wrong. You are looking up elements<br>
under the string key &#39;$parentSD&#39;.<br>
<br>
I think it should read:<br>
<br>
&lt;xsl:copy select=3D&quot;key(&#39;SemanticDomainByParent&#39;, $parentSD=
)&quot;/&gt;<br>
<br>
HTH,<br>
=C2=A0 -- David<br>
<br>
&gt; <br>
&gt; so output looks like<br>
&gt; &lt;SubPossibilities/&gt;<br>
&gt; <br>
&gt; So what am I doing wrong?<br>
&gt; <br>
&gt; Starting with this XML<br>
&gt; -------------<br>
&gt; XML input <br>
&gt; ------------- <br>
&gt; <br>
&gt; ...=C2=A0 =C2=A0 =C2=A0 &lt;Possibilities&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;CmSemanticDomain level=3D&quot;1=
&quot;=C2=A0 =C2=A0 =C2=A0 sd=3D&quot;1&quot;=C2=A0 =C2=A0parent=3D&quot;&q=
uot;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0guid=3D&quot;I63403699-07C1-43F3-A47C=
-069D6E4316E5&quot;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;line tag=3D&quot;sd=
&quot;&gt;Universe, creation&lt;/line&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;line tag=3D&quot;gd=
&quot;&gt;I63403699-07C1-43F3-A47C-069D6E4316E5&lt;/line&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;/CmSemanticDomain&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;CmSemanticDomain level=3D&quot;2=
&quot;=C2=A0 sd=3D&quot;1.1&quot;=C2=A0 =C2=A0parent=3D&quot;1&quot;=C2=A0 =
=C2=A0 guid=3D&quot;I999581C4-1611-4ACB-AE1B-5E6C1DFE6F0C&quot;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;line tag=3D=
&quot;sd&quot;&gt;Sky&lt;/line&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;line tag=3D=
&quot;gd&quot;&gt;I999581C4-1611-4ACB-AE1B-5E6C1DFE6F0C&lt;/line&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;/CmSemanticDomain&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;CmSemanticDomain level=3D&quot;3=
&quot;=C2=A0 =C2=A0sd=3D&quot;1.1.1&quot;=C2=A0 =C2=A0 parent=3D&quot;1.1&q=
uot;=C2=A0 =C2=A0 guid=3D&quot;IDC1A2C6F-1B32-4631-8823-36DACC8CB7BB&quot;&=
gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;line tag=3D&quot;sd=
&quot;&gt;Sun&lt;/line&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;line tag=3D&quot;gd=
&quot;&gt;IDC1A2C6F-1B32-4631-8823-36DACC8CB7BB&lt;/line&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;/CmSemanticDomain&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;CmSemanticDomain level=3D&quot;4=
&quot;=C2=A0 sd=3D&quot;1.1.1.1&quot;=C2=A0 =C2=A0 parent=3D&quot;1.1.1&quo=
t;=C2=A0 =C2=A0 =C2=A0 guid=3D&quot;I1BD42665-0610-4442-8D8D-7C666FEE3A6D&q=
uot;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;line tag=3D&quot;sd=
&quot;&gt;Moon&lt;/line&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;line tag=3D&quot;gd=
&quot;&gt;I1BD42665-0610-4442-8D8D-7C666FEE3A6D&lt;/line&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;/CmSemanticDomain&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;CmSemanticDomain level=3D&quot;4=
&quot;=C2=A0 sd=3D&quot;1.1.1.2&quot;=C2=A0 parent=3D&quot;1.1.1&quot;=C2=
=A0 guid=3D&quot;IB044E890-CE30-455C-AEDE-7E9D5569396E&quot;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;line tag=3D&quot;sd=
&quot;&gt;Star&lt;/line&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;line tag=3D&quot;gd=
&quot;&gt;IB044E890-CE30-455C-AEDE-7E9D5569396E&lt;/line&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;/CmSemanticDomain&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;CmSemanticDomain level=3D&quot;4=
&quot;=C2=A0 sd=3D&quot;1.1.1.3&quot;=C2=A0 =C2=A0parent=3D&quot;1.1.1&quot=
;=C2=A0 =C2=A0 guid=3D&quot;IA0D073DF-D413-4DFD-9BA1-C3C68F126D90&quot;&gt;=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;line tag=3D&quot;sd=
&quot;&gt;Planet&lt;/line&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;line tag=3D&quot;gd=
&quot;&gt;IA0D073DF-D413-4DFD-9BA1-C3C68F126D90&lt;/line&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;/CmSemanticDomain&gt;<br>
&gt; <br>
&gt; ...<br>
&gt; -------------<br>
&gt; XSL <br>
&gt; ------------- <br>
&gt; ...<br>
&gt;=C2=A0 =C2=A0&lt;xsl:key name=3D&quot;SemanticDomainByParent&quot; matc=
h=3D&quot;CmSemanticDomain&quot; use=3D&quot;@parent&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;xsl:template match=3D&quot;CmSemanticDomain&quo=
t;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;CmSemanticDomain&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;xsl:apply-templates=
 select=3D&quot;@* | node()&quot;/&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;xsl:apply-templates=
 select=3D&quot;key(&#39;SemanticDomainByParent&#39;,@sd)&quot;/&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;/CmSemanticDomain&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;/xsl:template&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;xsl:template match=3D&quot;line[@tag=3D&#39;gd&=
#39;]&quot;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;xsl:variable name=3D&quot;parentS=
D&quot; select=3D&quot;parent::*/@parent&quot;/&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;SubPossibilities&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;xsl:copy select=3D&=
quot;key(&#39;SemanticDomainByParent&#39;, &#39;$parentSD&#39;)&quot;/&gt;<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;/SubPossibilities&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;/xsl:template&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;!-- identity transform --&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;xsl:template match=3D&quot;@* | node()&quot;&gt=
;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;xsl:copy&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;xsl:apply-templates=
 select=3D&quot;@* | node()&quot;/&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;/xsl:copy&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;/xsl:template&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -------------<br>
&gt; Desired OUTPUT <br>
&gt; ------------- <br>
&gt; ...<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;Possibilities&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;CmSemanticDomain level=3D&quot;1=
&quot;=C2=A0 =C2=A0 =C2=A0 sd=3D&quot;1&quot;=C2=A0 =C2=A0parent=3D&quot;&q=
uot;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0guid=3D&quot;I63403699-07C1-43F3-A47C=
-069D6E4316E5&quot;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;line tag=3D=
&quot;sd&quot;&gt;Universe, creation&lt;/line&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;SubPossibil=
ities&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&l=
t;CmSemanticDomain level=3D&quot;2&quot;=C2=A0 sd=3D&quot;1.1&quot;=C2=A0 =
=C2=A0parent=3D&quot;1&quot;=C2=A0 =C2=A0 guid=3D&quot;I999581C4-1611-4ACB-=
AE1B-5E6C1DFE6F0C&quot;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 &lt;line tag=3D&quot;sd&quot;&gt;Sky&lt;/line&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0&lt;SubPossibilities&gt; <br>
&gt;=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&lt;CmSemanticDomain level=3D&quot;3&quot;=C2=A0=
 =C2=A0sd=3D&quot;1.1.1&quot;=C2=A0 =C2=A0 parent=3D&quot;1.1&quot;=C2=A0 =
=C2=A0 guid=3D&quot;IDC1A2C6F-1B32-4631-8823-36DACC8CB7BB&quot;&gt;<br>
&gt;=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&lt;line tag=3D&quot;sd&quot;&gt;S=
un&lt;/line&gt;<br>
&gt;=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&lt;SubPossibilities&gt;=C2=A0 =C2=
=A0 =C2=A0 =C2=A0<br>
&gt;=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&lt;CmSemanticDomain=
 level=3D&quot;4&quot;=C2=A0 sd=3D&quot;1.1.1.2&quot;=C2=A0 parent=3D&quot;=
1.1.1&quot;=C2=A0 guid=3D&quot;IB044E890-CE30-455C-AEDE-7E9D5569396E&quot;&=
gt;<br>
&gt;=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&lt;li=
ne tag=3D&quot;sd&quot;&gt;Star&lt;/line&gt;<br>
&gt;=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&lt;/CmSemanticDomai=
n&gt;<br>
&gt;=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&lt;CmSemanticDomain=
 level=3D&quot;4&quot;=C2=A0 sd=3D&quot;1.1.1.3&quot;=C2=A0 =C2=A0parent=3D=
&quot;1.1.1&quot;=C2=A0 =C2=A0 guid=3D&quot;IA0D073DF-D413-4DFD-9BA1-C3C68F=
126D90&quot;&gt;<br>
&gt;=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 &lt;l=
ine tag=3D&quot;sd&quot;&gt;Planet&lt;/line&gt;<br>
&gt;=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 &lt;/CmSemanticDomain&gt;=
=C2=A0 =C2=A0 =C2=A0 <br>
&gt; ...<br>
&gt;=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 &lt;/SubPossibilities&gt;<br>
&gt;=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 &lt;/CmSemanticDomain&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0&lt;/SubPossibilities&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&l=
t;/CmSemanticDomain&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;/SubPossibil=
ities&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;/CmSemanticDomain&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;/Possibilities&gt;=C2=A0 =C2=A0<br>
&gt; <br>
&gt; Jim Albright<br>
&gt; Wycliffe Bible Translators<br>
&gt; 704-562-1529<br>
&gt; XSL-List info and archive <br>
&gt; EasyUnsubscribe (by email) <br>
<br>
-- <br>
David Maus M.A.<br>
<br>
Www: <a href=3D"http://dmaus.name" rel=3D"noreferrer" target=3D"_blank">htt=
p://dmaus.name</a><br>
Twitter: @_dmaus<br>
<br>
<br>
</blockquote></div>
<div>
<div style=3D"border-top:1px solid black;background-color:rgb(221,221,221);=
color:rgb(136,136,136);font-size:smaller;padding:5px;text-align:center;font=
-family:arial,verdana,arial,sans-serif;clear:both;margin:auto">
<a href=3D"http://www.mulberrytech.com/xsl/xsl-list" target=3D"_blank">
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-lis=
t/2835196" target=3D"_blank">EasyUnsubscribe</a>
(<a style=3D"color:blue" href=3D"" target=3D"_blank">by email</a>)
</div>
</div>
</div>
</blockquote></div>
<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>

--00000000000036a06605bff643e5--