tags:

views:

43

answers:

1

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 ?

+1  A: 

This script is buggy ... don't use it.

If you want to work with XML, then create REBOL objects and then covert them to XML using Gavin McKenzie's libraries. They're on rebol.org

Graham Chiu
OOps didn't see your answer until today :)ok thanks will look at Gavin's rather http://www.rebol.org/view-script.r?script=xml-object.r
Rebol Tutorial