Project

Profile

Help

Bug #5613

open

Saxon-EE profiling HTML not well-formed

Added by Oliver Budke about 1 month ago. Updated 17 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
2022-07-20
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

Running Saxon-EE with "-TP" option for profiling produces a not well-formed HTML document. The element /html/head/meta is not terminated with a closing tag.

I am running Saxon-EE 9.9.1.7 in Oxygen XML Editor 23.1

Actions #1

Updated by Michael Kay 30 days ago

In HTML (as distinct from XHTML), no closing tag is required for meta elements. See https://stackoverflow.com/questions/19506028/do-you-need-to-close-meta-and-link-tags-in-html

Unfortunately the TimingTraceListener isn't really designed to be customised, except by taking a copy of the source code and adapting it to produce your own version. I'll look at making some methods overridable, or providing some other way to capture the results into a user-supplied stylesheet.

Actions #2

Updated by Oliver Budke 29 days ago

Thank you for your explanation.

Is there any other way to obtain a trace listener output that is readable by an XSL transformation, i.e. producing a well-formed XML document? I need a list of all templates that have been called and use this information for another transformation.

Regards
Oliver Budke
]init[ AG für digitale Kommunikation

Actions #3

Updated by Michael Kay 29 days ago

I would suggest writing your own TraceListener to capture this information; you could do this by modifying the source code of TimingTraceListener, which can be found at

https://saxonica.plan.io/projects/saxonmirrorhe/repository/he/entry/src/main/java/net/sf/saxon/trace/TimingTraceListener.java?utf8=✓&rev=saxon11

Alternatively, you can read HTML in a transformation by using the saxon:parse-html() extension function, or by setting up a SAXSource that uses TagSoup or validator.nu as the XMLReader. But this is a "screen-scraping" approach in which you become dependent on the detailed format of the HTML output, which is not stable or documented.

Actions #4

Updated by Oliver Budke 26 days ago

Thank you. I will try to implement the first approach then.

Actions #5

Updated by Oliver Budke 17 days ago

I tried a couple of things with the TimingTraceListener. However, I cannot find the stylesheet profile.xsl which is called on line 242. Could you provide me the file that I can make my necessary changes there? It seems easiest for my production environment to just output an xhtml file.

Actions #6

Updated by Michael Kay 17 days ago

You can find it at

https://saxonica.plan.io/projects/saxonmirrorhe/repository/he/revisions/saxon11/entry/src/main/resources/net/sf/saxon/data/profile.xsl

Incidentally, next to it there is a profile-json.xsl, which I suspect was an attempt to allow the timing data to be output in JSON, but I don't know if this was ever tested.

Please register to edit this issue

Also available in: Atom PDF