You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to parse a HTML5 page with a custom XML badge but the resulting badge just shows "invalid". I am using this XPath: //html/head/title, which should yield the title.
I assume that has to do with the HTML5 <!DOCTYPE prefix, that the XML parser chokes on?
Last resort would be to implement a endpoint badge but maybe we could also add a "ignore HTML5 DOCTYPE option" to the XML parser?
When I am using this test script in node (from the xml service here), it can parse the XPath just fine
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I tried to parse a HTML5 page with a custom XML badge but the resulting badge just shows "invalid". I am using this XPath:
//html/head/title
, which should yield the title.I assume that has to do with the HTML5
<!DOCTYPE
prefix, that the XML parser chokes on?Last resort would be to implement a endpoint badge but maybe we could also add a "ignore HTML5 DOCTYPE option" to the XML parser?
When I am using this test script in node (from the xml service here), it can parse the XPath just fine
I also tried the JSON dynamic badge with this query:
$..dd[?(@['@class']=='script-show-total-installs')].span
[ "5,961" ]
which works on https://jsonpath.com/ when the websites source code is pasted in there.
But the custom badge query:
![Dynamic JSON Badge](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgreasyfork.org%2Fen%2Fscripts%2F406337-toc-bar-auto-generating-table-of-content&query=%24..dd%5B%3F(%40%5B'%40class'%5D%3D%3D'script-show-total-installs')%5D.span)
returns this
Beta Was this translation helpful? Give feedback.
All reactions