Fix xhtml namespace.

pull/1082/head
Sutra Zhou 3 years ago
parent 6747046b6c
commit 16221e391d

@ -75,6 +75,7 @@ public class Xpath2Selector implements Selector {
private XPath2NamespaceContext() { private XPath2NamespaceContext() {
put("fn", NamespaceConstant.FN); put("fn", NamespaceConstant.FN);
put("xslt", NamespaceConstant.XSLT); put("xslt", NamespaceConstant.XSLT);
put("xhtml", NamespaceConstant.XHTML);
} }
@Override @Override

@ -1376,7 +1376,7 @@ public class XpathSelectorTest {
@Test @Test
public void testXpath2Selector() { public void testXpath2Selector() {
Xpath2Selector xpath2Selector = new Xpath2Selector("//a/@href"); Xpath2Selector xpath2Selector = new Xpath2Selector("//xhtml:a/@href");
String select = xpath2Selector.select(html); String select = xpath2Selector.select(html);
Assert.assertEquals("http://www.oschina.net/", select); Assert.assertEquals("http://www.oschina.net/", select);

Loading…
Cancel
Save