I am trying to parse a badly formed html table:
A couple of lines of this are:
Food:</b> Yes<b><br>
Pool: </b>Beach<b></b><b><br>
Centre:</b> Yes<b><br>
Uding php’s domdocument xpath I am able to select all the title tags like Food, center and pool, but once I have each I would like to search forward until I hit the next title tag.
I know that regex can look forward until a specific pattern. Can xpath do the same for a specifc tag?
Thanks,
Bill
Using following-sibling::br[1]/following-sibling::text()[1] appears to be what you need.
However when doing complex queries on poorly structured data the best advice is often to start by doing an XSLT transformation to create a better structure.