Creating XML with Rebol and rebelxml

Posted by Rebol Tutorial on Stack Overflow See other posts from Stack Overflow or by Rebol Tutorial
Published on 2009-10-10T08:45:04Z Indexed on 2010/03/13 23:05 UTC
Read the original article Hit count: 443

Filed under:

The example in doc http://www.rebol.org/documentation.r?script=rebelxml.r to create XML works

>> clear-xml-data
== ""
>> set-xml-data/content 'test/test "test"
== "<test><test>test</test></test>"
>>

but when I want to create some variants it doesn't seem to work:

>> clear-xml-data
== ""
>> set-xml-data/content 'test "test"
** Script Error: foreach expected data argument of type: series
** Where: set-xml-data
** Near: foreach tag path [
    sub-rule: copy []
    append sub-rule reduce [
        'thru to-open-tag tag
    ]
    if all [...
>>

this one doesn't work either:

>> clear-xml-data
== ""
>> set-xml-data/content/with-attribute 'test/test "test" 'id "500"
== ""
>>

Is there something wrong in my syntax ?

© Stack Overflow or respective owner

Related posts about rebol