⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xpath-find.xtp

📁 resinweb服务器源文件
💻 XTP
字号:
<s1 title="XPath find()"><p>XPath is a language for selecting XML nodes.  It was originally part of theXSLT spec, but was split out because the W3C realized XPath was usefulby itself.</p><p>In Resin, you can use <var/XPath.find()/> to find a node from an XML DOMdata structure.</p><def>XPath.find(String pattern, Node node)</def><p>The first example finds the first &lt;b> in the tree.</p><example title='test.xml'>&lt;top>  &lt;a id='1'>    &lt;b id='2'/>  &lt;/a>  &lt;b id='3'/>  &lt;c id='4'/>&lt;/top></example><example>import org.w3c.dom.*;import com.caucho.xml.*;import com.caucho.xpath.*;...Document doc = new Xml().parseDocument("test.xml");Element elt = (Element) XPath.find("b", doc);System.out.println("Node: " + elt.getNodeName());System.out.println("id: " + elt.getAttribute("id"));</example><results>Node: bid: 2</results><s2 title="Summary"><ul><li><var/XPath/> is a language for selecting XML nodes<li><var/XPath.find()/> returns the first matching node<li>XPath searches in <var/document order/><li>The pattern <var/b/> matches any element <var/&lt;b>/></ul></s2></s1>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -