<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="color: rgb(0, 0, 0); font-size: 14px; font-family: 'Palatino Linotype', sans-serif; ">I have used the xquery typeswitch function to transform elements from a TEI file, but I am stymied by a task involving the following fragment:</div><div style="color: rgb(0, 0, 0); font-size: 14px; font-family: 'Palatino Linotype', sans-serif; "><br></div><div><div><div style="margin: 0px; "><font><font face="Lucida Grande" style="color: rgb(0, 0, 0); font-size: medium; ">  </font><font face="Palatino">  <closer><br>               <signed>Your ever affectionate WOODVILLE.</signed><br>               <postscript><br>                  <p>P.S. You have a house, within a mile of York; where we have spent many happy days—<q rend="inline">"Days of ease, and nights of pleasure."</q> Who knows but we may there recover our juve‑nile tastes and passions! impossible! As well when advanced in life, might we hope to reco‑ver our youth, <hi>in those fields where we once were young.</hi>—But is that house untenanted? Will you be our host? Or have you lett, or lent it?</p><br>               </postscript><br>            </closer></font></font></div></div></div><div style="margin: 0px; "><font><font face="Palatino"><br></font></font></div><div style="margin: 0px; "><font><font face="Palatino">I want to move the <postscript> element from its position as the last child of <closer> into the position of right sibling of <closer> so that the desire output would look like this:</font></font></div><div style="margin: 0px; "><font><font face="Palatino"><br></font></font></div><div style="margin: 0px; "><font><font face="Lucida Grande"> </font><font face="Palatino"><closer><br>           <signed>Your ever affectionate WOODVILLE.</signed><br>               <br> </closer></font></font></div><div style="margin: 0px; "><font><span style="font-family: Palatino; "><postscript></span><br style="font-family: Palatino; "><span style="font-family: Palatino; ">                  <p>P.S. You have a house, within a mile of York; where we have spent many happy days—<q rend="inline">"Days of ease, and nights of pleasure."</q> Who knows but we may there recover our juve‑nile tastes and passions! impossible! As well when advanced in life, might we hope to reco‑ver our youth, <hi>in those fields where we once were young.</hi>—But is that house untenanted? Will you be our host? Or have you lett, or lent it?</p></span><br style="font-family: Palatino; "><span style="font-family: Palatino; "></postscript></span></font></div><div style="margin: 0px; "><font><font face="Palatino"><br></font></font></div><div style="margin: 0px; "><font><font face="Palatino"><br></font></font></div><div style="margin: 0px; "><span style="font-family: Palatino; ">How do I do this? </span>In a typeswitch function the different tasks relating to elements are carried out by subsidiary function. Here is the postscript function that simply passes through the element:</div><div style="margin: 0px; "><br></div><div style="margin: 0px; "><p style="margin: 0px; "><font face="Palatino"><b>declare function </b><i>eccoparse:postscript</i>(<b>$node</b> <b>as </b><i>element</i>(<b>tei:postscript</b>)) <b>as </b><i>element</i>() <br>
{<br>
<postscript>{<b>$node</b>/<b><i>@*</i></b>}{<i>eccoparse:recurse</i>(<b>$node</b>)}</postscript><br>
};</font></p><p style="margin: 0px; "><font face="Palatino"><br></font></p><p style="margin: 0px; "><font face="Palatino">I know how to various things that would change the postscript element but leave it in its current place. But how do I put it in another place without changing anything in it?  Is this a task that should be done at the level of the parent element? </font></p><p style="margin: 0px; "><font face="Palatino"><br></font></p><p style="margin: 0px; "><font face="Palatino">I'll be grateful for any advice. </font></p><p style="margin: 0px; "><font face="Palatino"><br></font></p><p style="margin: 0px; "><font face="Palatino"><br></font></p><p style="margin: 0px; "><font face="Palatino">Martin Mueller</font></p><p style="margin: 0px; ">Professor emeritus of English and Classics</p><p style="margin: 0px; ">Northwestern University</p><p style="margin: 0px; "><br></p></div></body></html>