1

目前我有这个 XML 文件:

<?xml version="1.0" encoding="UTF-8"?>
<productFeed>
        <product id="233004">
        <name><![CDATA[Van Bommel P2577]]></name>
        <description><![CDATA[Leren casual herensneaker met nopjes op de hiel van Van Bommel. Kleur: cognac.]]></description>
        <price><![CDATA[199.95]]></price>        <productURL>http://vanarendonk.cleafs.com/go?k=4upHUYcQalVXox0zikwnMgTagF73SwA5&amp;c=1190&amp;redirect=http%3A%2F%2Fwww%2Evanarendonk%2Enl%2Fheren%2FVan%2DBommel%2FP2577%2D%2FCognac%2F120%2E13%2E6</productURL>
        <imageURL><![CDATA[http://www.vanarendonk.nl/update/images/120.13.6/.tmp/tmb.MTIwLjEzLjZfMDEuanBn800733.jpg]]></imageURL>
        <additional>
            <category><![CDATA[schoen]]></category>
            <sub_category><![CDATA[heren]]></sub_category>
            <gender><![CDATA[heren]]></gender>
            <type><![CDATA[Sneakers]]></type>            <model><![CDATA[16102/02 751]]></model>            <brand><![CDATA[Van Bommel]]></brand>            <color><![CDATA[Cognac]]></color>            <topmaterial><![CDATA[Glad leer]]></topmaterial>            <insole><![CDATA[rubber]]></insole>                                    <size><![CDATA[41;42;42,5;43,5;44;45;46;47]]></size>            <size_UK><![CDATA[7,5;8;8,5;9,5;10;10,5;11;12]]></size_UK>            <image_1><![CDATA[http://www.vanarendonk.nl/update/images/120.13.6/.tmp/tmb.MTIwLjEzLjZfMDEuanBn480440.jpg]]></image_1>
<image_2><![CDATA[http://www.vanarendonk.nl/update/images/120.13.6/.tmp/tmb.MTIwLjEzLjZfMDIuanBn480440.jpg]]></image_2>
<image_3><![CDATA[http://www.vanarendonk.nl/update/images/120.13.6/.tmp/tmb.MTIwLjEzLjZfMDMuanBn480440.jpg]]></image_3>
<image_4><![CDATA[http://www.vanarendonk.nl/update/images/120.13.6/.tmp/tmb.MTIwLjEzLjZfMDQuanBn480440.jpg]]></image_4>
<image_5><![CDATA[http://www.vanarendonk.nl/update/images/120.13.6/.tmp/tmb.MTIwLjEzLjZfMDUuanBn480440.jpg]]></image_5>
<image_6><![CDATA[http://www.vanarendonk.nl/update/images/120.13.6/.tmp/tmb.MTIwLjEzLjZfMDYuanBn480440.jpg]]></image_6>
<image_7><![CDATA[http://www.vanarendonk.nl/update/images/120.13.6/.tmp/tmb.MTIwLjEzLjZfMDcuanBn480440.jpg]]></image_7>
<image_8><![CDATA[http://www.vanarendonk.nl/update/images/120.13.6/.tmp/tmb.MTIwLjEzLjZfMDguanBn480440.jpg]]></image_8>
            <delivery_costs><![CDATA[geen verzendkosten vanaf 75,00]]></delivery_costs>
            <delivery_time><![CDATA[3 days]]></delivery_time>
        </additional>
    </product>
        ... 
<productFeed>

我想过滤这个品牌的提要。我试过了:

/productFeed/product[1]/additional[1][contains(brand,'BRANDNAME')]

但这并没有给我任何结果。

谁知道如何仅根据品牌名称过滤此提要?有没有简单的在线工具可以做到这一点?自己搜索过但找不到。

4

1 回答 1

1

试试这个(它使用品牌中的子字符串 Pant 获取节点):

/productFeed/product/additional/brand[contains(.,'Pant')]
于 2012-10-06T16:00:41.257 回答