使用 Rebol 和 rebelxml 创建 XML

发布于 2024-08-07 05:28:42 字数 885 浏览 5 评论 0原文

文档 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

是伱的 2024-08-14 05:28:42

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

如果您想使用 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文