Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何选择rel属性以“placeholder_”开头的所有节点?
rel
在 jQuery 中,我实现了它,( "[rel^='placeholder_']" )但是当我使用胡萝卜时,它不起作用
( "[rel^='placeholder_']" )
$domObj=new Zend_Dom_Query(); $domObj->setDocument($templateRender); $result=$domObj->queryXpath("//*[@rel=^'placeholder_'] " );
尝试使用以下使用starts-with()函数的 XPath 表达式:
starts-with()
"//*[starts-with(@rel, 'placeholder_')]"
W3C XPath 字符串函数