Open martin-honnen opened 1 year ago
oh wow, I guess so, I must admit when I've wanted an html input in recent years I've hooked Henri Sivonen's java parser https://about.validator.nu/htmlparser/ as a sax parser for Saxon, htmlparse.xsl
was a fun project (a long time ago:-) and really dates from a pre-html5 era when html parsing was nothing like as standardised. That said, I can see it could be still useful if handling fragments of html.
So I could take this as a feature request, but no promises.
On the other hand if you wanted to fork it,... But before that if it is being used I should probably split its git history into a separate repo. The structure here with unrelated projects all under the same issue tracker doesn't really make sense on github and dates back to cvs at w3c via svn at googlecode before ending here.
Yes, using a pluggable HTML parser is the better solution if possible but some implementations (e.g. SaxonJS, SaxonC) don't allow that (or don't have a library comparable to Henri Sivonen's parser) and even for Saxon Java sometimes it is easier to rely on XSLT/XPath than on the Saxon extension APIs.
If you take it as a feature request it's fine.
I just run into the issue again today with some failure of SaxonC (even EE) to bundle the HTML parser, therefore I was looking again at your library and thought I ask whether for the future you can make the integration of it/it's use easier by providing an XSLT 3 version and setting the visibility="public"
.
Hi David,
your https://github.com/davidcarlisle/web-xslt/blob/main/htmlparse/htmlparse.xsl is extremely useful, these days in the times of XSLT 3.0 and allowing to call an initial function https://www.w3.org/TR/xslt-30/#invoking-initial-function and XPath 3.1 with
fn:transform
and aninitial-function
call it would be even more useful if there were an XSLT 3.0 version where the function declaration(s) ofhtmlparse
would declare them withvisibility="public"
e.g.<xsl:function name="d:htmlparse" visibility="public">
as only that way you can use them with the mentioned features of XSLT 3 "invoking an initial function" or XPath 3.1fn:transform
andinitial-function
.