[xquery-talk] last possible child's attribute
michalmas at gmail.com
Sun Mar 8 15:02:03 PST 2009
Yes, the solution works perfect
Also, works good.
My confusion was that the attribute can't be find not that it can't be
On Sun, Mar 8, 2009 at 2:57 PM, G. Ken Holman <gkholman at cranesoftwrights.com
> At 2009-03-08 14:45 +0100, Michalmas wrote:
>> It still gives me the same error:
>> XQuery Serialization Error!
>> A document node may not have an attribute node or a namespace node as a
> Yes, because attribute nodes can only be attached to an element.
> You are putting out a document and you are trying to add just the
> 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
> On Sun, Mar 8, 2009 at 2:32 PM, G. Ken Holman <<mailto:
>> gkholman at cranesoftwrights.com>gkholman at cranesoftwrights.com> wrote:
>> t:\ftemp>type michalmas.xml
>> <aa lc="1">
>> <aaa lc="00">
>> <bb lc="0">
>> <zz lc="1">
>> <ccc lc="123">
>> t:\ftemp>type michalmas.xq
>> string( a/descendant::*[last()]/@lc ),
>> string( (a//@lc)[last()] )
>> t:\ftemp>xquery michalmas.xml michalmas.xq
>> <?xml version="1.0" encoding="UTF-8"?>123 123
> Notice above how I'm adding the values of the attributes, not the
> attributes themselves to the result.
> I hope this helps.
> . . . . . . . Ken
> XQuery/XSLT training in Prague, CZ 2009-03 http://www.xmlprague.cz
> XQuery/XSLT/XSL-FO training in Los Angeles/Anaheim - 2009-06-01/10
> Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
> Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18
> Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18
> G. Ken Holman mailto:gkholman at CraneSoftwrights.com
> Crane Softwrights Ltd. http://www.CraneSoftwrights.com/q/
> Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/q/bc
> Legal business disclaimers: http://www.CraneSoftwrights.com/legal
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the talk