I'm having trouble with an XSL translation in Chrome. I was wondering if there any tools that would allow me to step through the style sheet to see where the problem is.
Debugging XSLT in Chrome
4.2k Views Asked by Bryan AtThere are 2 best solutions below
On
On linux there is a tool called xsltproc which takes an XSL and XML and outputs the transform.
It also shows context around errors.
I've found this most useful when I'm developing as I can test the result of my changes without the need to have a development server up and running. It just works.
However, I've noticed that the results of the transform can differ from that of Chrome for example. I don't know why this is, whether my transform was non-conforming, if Chrome is non-conforming, or if xsltproc is non-conforming.
EDIT My comment about differences between Chrome and xsltproc rendering the transform slightly differently is likely invalid.
- I had modified the XML schema somewhat, and since then, xsltproc was generating tags (based on type name of types in the schema) correctly, but Chrome was not.
- I was doing hard reloads to avoid Chrome reusing the cache.
- I could tell Chrome was using the new xsl as there was other changes included that were being rendered.
- Only the schema related tests were not working in Chrome for some reason.
- I've since found that now it is magically working, with no changes to the xsl, just on a different day.
So I guess some part of the xsl was being cached somehow (perhaps just the schema bit - totally guessing here)... hence why some debugging in Chrome would be super nice.
xsl:includeto eliminate path issuesxsl:includestatements referencing buggy templatesinputtags to printxsl:variablevalues.