English 中文(简体)
从Xml树中选定一组特定 no子——xpath
原标题:Select a specific group of nodes from xml tree - xpath
  • 时间:2011-09-15 20:35:52
  •  标签:
  • xpath

我有一根大nes的Xml树,我希望能够用xpath进行盘问,只从树木的每一部分中选取一些子。 例如,在以下每个家长的节点中,一是希望获得“儿童成长”;一、一、一、二、二、三、四、五、三、四、五、六、八、九、八、九、八、九、八、九、八、九、八、九、八、九、八、九、八、九、八、九、八、八、九、八、九、八、八、九、八、八、九、八、八、九、八、八、八、九、九、八、八、八、九、八、八、九、八、八、八、八、八、八、八、八、八、八、九、八、八、九、八、八、八、九、八、八、八、八、八、八、八、八、八、八、八、九、八、八、九、八、八、八、九、八、九、八、九、八、八、八、九、八、八、八、九、八、九、九、八、八、九、八、八、八、八、八、

<parents>
    <parent>
      <childTree>
        <a></a>
        <b></b>
        <c>
          <ca></ca>
          <cb></cb>
        </c>
      </childTree>
    </parent>
    <parent>
      <childTree>
        <a></a>
        <b></b>
        <c>
          <ca></ca>
          <cb></cb>
        </c>
      </childTree>
    </parent>
    <parent>
      <childTree>
        <a></a>
        <b></b>
        <c>
          <ca></ca>
          <cb></cb>
        </c>
      </childTree>
    </parent>
<parents>
问题回答

您的工作是: 在Xpath,你可以使用“你”作为工会,并做如下事情:

//childTree/a|//childTree/c/cb




相关问题
VTD XML inner XPath Expressions

I have a xml file for example like this <root> <test> <bla>test1</bla> </test> <test> <bla>test2</bla> </test> <test> </test&...

C# XML adding/copying

With the following XML I am trying to copy and add to another XML but I haven t used the C# XML document objects before. So here is the XML <config> <configXML> <Connections&...

Filter SQL queries on the XML column using XPath/XQuery

I m having a table with one XML column. I d like to filter out the rows where a specific attribute in the XML match a string, essentially doing a WHERE or HAVING. The table looks something like this ...

Python XPath Result displaying only []

Hey I have just started to use Python recently and I want to use it with a bit of xPath, the thing is when I print the result of the query I only get [] and I don t know why =S import libxml2, ...

热门标签