Closed leonelsanchesdasilva closed 11 months ago
St.:grey_question: |
Category | Percentage | Covered / Total |
---|---|---|---|
π‘ | Statements | 69.75% (-1.1% π») |
1393/1997 |
π‘ | Branches | 61.46% (-2.14% π») |
622/1012 |
π‘ | Functions | 68.62% (-1.55% π») |
199/290 |
π‘ | Lines | 70.06% (-0.97% π») |
1308/1867 |
51 tests passing in 14 suites.
Report generated by π§ͺjest coverage report action from 12fd8e8aa46ebbc92e42201531efb792039f484c
Special thanks to Marco Balestra on this one.
First of all, XPath became a big pain when using
<xsl:template>
with<xsl:apply-templates>
because:<xsl:apply-templates>
, since there's not a good way to select the current nesting level appropriately;To resolve the issues with
<xsl:apply-templates>
and relative paths, I created this special axis,self-and-siblings
. It seems to solve the problems very well so far, but nothing prevents me to remove it if I find a better approach using pure XPath.At versions 1.1.x, I was using the input to map the output nodes. It was very convenient, but it doesn't work well in occasions that one match needs to revisit a node that already generated the output. For this reason, I decided to expand the Expression Context to accommodate the input and the output, with input nodes holding a reference to its direct output node.
Some tests are skipped because they are incorrect, considering tests in other XSLT libraries. They should be revisited in the future.
Finally, the
<xslt:sort>
needs to be called explicitly, and it is not executed by default during<xslt:apply-templates>
as before. To solve the output positioning, I created a property calledsiblingPosition
, which it is copied to output nodes, preserving the order while writing the output XML.