使用 Rebol 和 rebelxml 创建 XML
文档 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"
== ""
>>
我的语法有问题吗?
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 ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个脚本有问题......不要使用它。
如果您想使用 XML,请创建 REBOL 对象,然后使用 Gavin McKenzie 的库将它们转换为 XML。他们在 rebol.org 上
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