@Christian, Ken<br>Yes, the solution works perfect<br><br>@Jens<br>Also, works good.<br><br><br>My confusion was that the attribute can&#39;t be find not that it can&#39;t be displayed.<br><br>Thank you!<br><br><div class="gmail_quote">
On Sun, Mar 8, 2009 at 2:57 PM, G. Ken Holman <span dir="ltr">&lt;<a href="mailto:gkholman@cranesoftwrights.com">gkholman@cranesoftwrights.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">At 2009-03-08 14:45 +0100, Michalmas wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
It still gives me the same error:<br>
<br>
XQuery Serialization Error!<br>
A document node may not have an attribute node or a namespace node as a child<br>
</blockquote>
<br></div>
Yes, because attribute nodes can only be attached to an element.<br>
<br>
You are putting out a document and you are trying to add just the attribute.<br>
<br>
I posted code that was working, and you&#39;ll see that I used the string() function in order to add a string to the document node, not the attribute itself.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Sun, Mar 8, 2009 at 2:32 PM, G. Ken Holman &lt;&lt;mailto:<a href="mailto:gkholman@cranesoftwrights.com" target="_blank">gkholman@cranesoftwrights.com</a>&gt;<a href="mailto:gkholman@cranesoftwrights.com" target="_blank">gkholman@cranesoftwrights.com</a>&gt; wrote:<br>

t:\ftemp&gt;type michalmas.xml<br>
<br>
&lt;a&gt;<br>
 &lt;aa lc=&quot;1&quot;&gt;<br>
    &lt;aaa lc=&quot;00&quot;&gt;<br>
    &lt;/aaa&gt;<br>
 &lt;/aa&gt;<br>
 &lt;bb lc=&quot;0&quot;&gt;<br>
 &lt;/bb&gt;<br>
 &lt;zz lc=&quot;1&quot;&gt;<br>
    &lt;ccc lc=&quot;123&quot;&gt;<br>
    &lt;/ccc&gt;<br>
 &lt;/zz&gt;<br>
&lt;/a&gt;<br>
<br>
t:\ftemp&gt;type michalmas.xq<br>
string( a/descendant::*[last()]/@lc ),<br>
string( (a//@lc)[last()] )<br>
t:\ftemp&gt;xquery michalmas.xml michalmas.xq<br>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;123 123<br>
t:\ftemp&gt;<br>
</blockquote>
<br></div>
Notice above how I&#39;m adding the values of the attributes, not the attributes themselves to the result.<div class="im"><br>
<br>
I hope this helps.<br>
<br>
. . . . . . . Ken<br>
<br></div><div><div></div><div class="h5">
--<br>
XQuery/XSLT training in Prague, CZ 2009-03 <a href="http://www.xmlprague.cz" target="_blank">http://www.xmlprague.cz</a><br>
XQuery/XSLT/XSL-FO training in Los Angeles/Anaheim - 2009-06-01/10<br>
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video<br>
Video lesson:    <a href="http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18" target="_blank">http://www.youtube.com/watch?v=PrNjJCh7Ppg&amp;fmt=18</a><br>
Video overview:  <a href="http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18" target="_blank">http://www.youtube.com/watch?v=VTiodiij6gE&amp;fmt=18</a><br>
G. Ken Holman                 mailto:<a href="mailto:gkholman@CraneSoftwrights.com" target="_blank">gkholman@CraneSoftwrights.com</a><br>
Crane Softwrights Ltd.          <a href="http://www.CraneSoftwrights.com/q/" target="_blank">http://www.CraneSoftwrights.com/q/</a><br>
Male Cancer Awareness Nov&#39;07  <a href="http://www.CraneSoftwrights.com/q/bc" target="_blank">http://www.CraneSoftwrights.com/q/bc</a><br>
Legal business disclaimers:  <a href="http://www.CraneSoftwrights.com/legal" target="_blank">http://www.CraneSoftwrights.com/legal</a><br>
<br>
</div></div></blockquote></div><br>