简体   繁体   中英

XPath, two selecting conditions with “and”?

Here is my XPath selection:

/document/transport/receiver[regcode='70007'] | 
/document/metaxml/LetterMetaData[Type='bill']

But this does not fit for my needs. What I actually want, that I can tell with XPath that, if regcode='70007' and Type='bill' then do the action. As I understand then | (pipe) means OR in XPath.

Is there a way for making XPath so that it would check both?

/document[
   transport/receiver[regcode='70007'] 
 and 
   metaxml/LetterMetaData[Type='bill']
]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM