I have the following XML file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root [
<!ELEMENT root (entry*)>
<!ELEMENT entry (#PCDATA)>
<!ENTITY abc "a b c">
<!ENTITY xyz "x y z">
]>
<root>
<entry>&abc;</entry>
<entry>&xyz;</entry>
<entry>text</entry>
</root>
I use the following command to test my XPaths on it:
xmllint --xpath '...' test.xml
I am trying to match some custom entities with an XPath that looks like:
//entry[text() = '&abc;']
But it doesn't match anything. So I even tried:
//entry/text()
And the only result is text from the last entry, nothing from the first two. If text() doesn't return custom entities, is there anything else that does? Is there a way to match only entries containing &abc;?