zoukankan      html  css  js  c++  java
  • XPath – Study Notes

    /catalog/cd/price   -- get price elements under catelog/cd

    //cd  -- get all cd elements of file

    /catalog/cd/* -- get all elements under cd

    /catalog/*/price

    /*/*/price

    //*  -- get all elements of file

    --Get elements

    /catalog/cd[0] -- get the first element which name is cd under catalog

    /catalog/cd[last()] -- get the last element

    /catelog/cd[price] -- get all cd elements which contain price child element

    /catalog/cd[price=10.90] -- get all cd elements which contain price child element and value is 10.90

    /catalog/cd[price-10.90]/price -- get all price elements which cd contain price child element and value is 10.90

    --Get more than one path

    /catalog/cd/title | catalog/cd/artist

    //title | //artist

    //title | //artist | //price

    --Choose attribute

    //@country  --choose all country attribute

    //cd[@country] -- choose all cd elements contain country attribute

    //cd[@*] -- choose all cd elements contain attribute

    //cd[@country="UK"] -- choose all cd elements contain attribute and value is UK

    //cd[@country="UK"][@name="test"] -- choose all cd elements contain country & name attributes and values are UK & test

    路慢慢其休远羲,吾将上下而求所
  • 相关阅读:
    组合数学
    组合数学
    组合数学
    组合数学 + STL --- 利用STL生成全排列
    组合数学
    数论
    给xcode项目重命名
    iOS中动态注入JavaScript方法。动态给html标签添加事件
    swift
    swift
  • 原文地址:https://www.cnblogs.com/garinzhang/p/2550024.html
Copyright © 2011-2022 走看看