@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't be find not that it can'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"><<a href="mailto:gkholman@cranesoftwrights.com">gkholman@cranesoftwrights.com</a>></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'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 <<mailto:<a href="mailto:gkholman@cranesoftwrights.com" target="_blank">gkholman@cranesoftwrights.com</a>><a href="mailto:gkholman@cranesoftwrights.com" target="_blank">gkholman@cranesoftwrights.com</a>> wrote:<br>
t:\ftemp>type michalmas.xml<br>
<br>
<a><br>
<aa lc="1"><br>
<aaa lc="00"><br>
</aaa><br>
</aa><br>
<bb lc="0"><br>
</bb><br>
<zz lc="1"><br>
<ccc lc="123"><br>
</ccc><br>
</zz><br>
</a><br>
<br>
t:\ftemp>type michalmas.xq<br>
string( a/descendant::*[last()]/@lc ),<br>
string( (a//@lc)[last()] )<br>
t:\ftemp>xquery michalmas.xml michalmas.xq<br>
<?xml version="1.0" encoding="UTF-8"?>123 123<br>
t:\ftemp><br>
</blockquote>
<br></div>
Notice above how I'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&fmt=18" target="_blank">http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18</a><br>
Video overview: <a href="http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18" target="_blank">http://www.youtube.com/watch?v=VTiodiij6gE&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'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>