请问这个js库的方法是什么意思?

这是一个Photoshop 的xml.js 库的一个对象方法,我不会英语,用 有道翻译 的又看不懂..
请有空的人能教教我怎么用吗?
我只能用点赞汇报大家了,谢谢...

replace()
xmlObj.replace (name, value);
name
An element or attribute name, with or without the 0-based position index of a
specific element, or the wildcard string “*”.
? If no position index is supplied, replaces the value of all matching elements.
? If the wildcard is supplied, replaces the value of all contained elements. When an
element contain subelements, those are removed, and only the replacement
value
remains.
value An XML object or any value that can be converted to a String with toString().
Replaces one or more property values in this node.
If the named element does not exist, appends the given value as a text element.
Returns this XML object.
setChildren()
xmlObj.
阅读 2k
1 个回答

这是个替换函数。
name是你需要替换的元素或属性名,可以指定下标index,或者通选符‘*’。
如果不提供下标,所有符合name的元素都会被替换。
如果是‘*’,替换所有包含的元素,如果元素有子元素,则直接移除。
value是个XML对象或者任何能被toString()函数转换为字符串的值。
特殊情况:如果name不存在,则直接将value作为一个文本元素append进去。
返回的是XML对象。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏