I dont know why i expected the index to be "value", after a patch I
get the correct values and dont need the double emits either.
Applies to Roxen 4.5.241 and rxmltags.pike,v 1.537

Petters-Lappy:tags petter$ diff -u ~/rxmltags.orig rxmltags.pike
--- /Users/petter/rxmltags.orig 2008-10-09 12:28:35.000000000 +1300
+++ rxmltags.pike       2008-10-09 12:29:01.000000000 +1300
@@ -3281,7 +3281,7 @@
                                    if (objectp (elem))
                                      return elem->get_text_content();
                                    else
-                                     return values (res)[0];
+                                     return values (elem)[0];
                                  });
              else if (objectp (res))
                value = ({res->get_text_content()});


On Thu, Oct 9, 2008 at 10:17 AM, Petter Larsson <[EMAIL PROTECTED]> wrote:
> Hi
>
> The code below is not working as I expected, there seem to be an issue
> with copy-of in the contents tag, has this been resolved in later
> versions of roxen?
> I'm using: 4.5.241
>
> <define container="tag">
>   <set variable="_.tag2"><contents value-of="tag2/@value" 
> result-set=''/></set>
>   <emit source="values" variable="_.tag2">
>   <emit source="values" variable="_.value">
>      &_.index;:&_.value;<br/>
>   </emit>
>   </emit>
> </define>
>
> <tag>
>   <tag2 value="2">2</tag2>
>   <tag2 value="3">3</tag2>
> </tag>
>
> === Result ===
> value:2
> value:2
>
> === Expected ===
> value:2
> value:3
>
> BR
> Petter Larsson
>



-- 
Petter Larsson

Reply via email to