我有简单的xpath
/products/product[contains(categorie,'Kinderwagens')]
Run Code Online (Sandbox Code Playgroud)
它有效,但现在如何过滤多个类别值
喜欢
/products/product[contains(categorie,'Kinderwagens')] +
/products/product[contains(categorie,'Kinderwagens')]
Run Code Online (Sandbox Code Playgroud) 我正在过滤一个大文件,其中包含适合儿童,男人和女人的各种鞋子.
现在我想过滤掉某些类型的女鞋,下面的xpath有效,但是我正在使用的程序存在xpath长度限制.所以我想知道是否有更短/更有效的方法来构建这个xpath
/Products/Product[contains(CategoryPath/ProductCategoryPath,'Halbschuhe') and contains(CategoryPath/ProductCategoryPath,'Damen') or contains(CategoryPath/ProductCategoryPath,'Sneaker') and contains(CategoryPath/ProductCategoryPath,'Damen') or contains(CategoryPath/ProductCategoryPath,'Ballerinas') and contains(CategoryPath/ProductCategoryPath,'Damen')]
Run Code Online (Sandbox Code Playgroud)
编辑:添加了请求的文件样本
<Products>
<!-- snip -->
<Product ProgramID="4875" ArticleNumber="GO1-f05-0001-12">
<CategoryPath>
<ProductCategoryID>34857489</ProductCategoryID>
<ProductCategoryPath>Damen > Sale > Schuhe > Sneaker > Sneaker Low</ProductCategoryPath>
<AffilinetProductCategoryPath>Kleidung & Accessoires?</AffilinetProductCategoryPath>
</CategoryPath>
<Price>
<DisplayPrice>40.95 EUR</DisplayPrice>
<Price>40.95</Price>
</Price>
</Product>
<!-- snip -->
</Products>
Run Code Online (Sandbox Code Playgroud)