查看网站首页
查看网站首页
查看 sitemap.xml
✏️ 正在编辑: %5b%5d-i.yaml
路径:
/opt/alt/ruby18/share/ri/1.8/system/REXML/Elements/%5b%5d-i.yaml
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
--- !ruby/object:RI::MethodDescription aliases: [] block_params: comment: - !ruby/struct:SM::Flow::P body: Fetches a child element. Filters only Element children, regardless of the XPath match. - !ruby/object:SM::Flow::LIST contents: - !ruby/struct:SM::Flow::LI label: "index:" body: the search parameter. This is either an Integer, which will be used to find the index'th child Element, or an XPath, which will be used to search for the Element. <em>Because of the nature of XPath searches, any element in the connected XML document can be fetched through any other element.</em> <b>The Integer index is 1-based, not 0-based.</b> This means that the first child element is at index 1, not 0, and the +n+th element is at index <tt>n</tt>, not <tt>n-1</tt>. This is because XPath indexes element children starting from 1, not 0, and the indexes should be the same. - !ruby/struct:SM::Flow::LI label: "name:" body: optional, and only used in the first argument is an Integer. In that case, the index'th child Element that has the supplied name will be returned. Note again that the indexes start at 1. - !ruby/struct:SM::Flow::LI label: "Returns:" body: the first matching Element, or nil if no child matched type: :NOTE - !ruby/struct:SM::Flow::VERB body: " doc = Document.new '<a><b/><c id="1"/><c id="2"/><d/></a>'\n doc.root.elements[1] #-> <b/>\n doc.root.elements['c'] #-> <c id="1"/>\n doc.root.elements[2,'c'] #-> <c id="2"/>\n" full_name: REXML::Elements#[] is_singleton: false name: "[]" params: ( index, name=nil) visibility: public
💾 保存文件
← 返回文件管理器