1

doc http://www.rebol.org/documentation.r?script=rebelxml.r中的示例创建 XML 作品

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

但是当我想创建一些变体时,它似乎不起作用:

>> 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 [...
>>

这个也不起作用:

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

我的语法有问题吗?

4

1 回答 1

2

这个脚本有问题......不要使用它。

如果您想使用 XML,则创建 REBOL 对象,然后使用 Gavin McKenzie 的库将它们转换为 XML。他们在 rebol.org 上

于 2009-10-31T19:52:12.137 回答