DesignLiquido / xslt-processor

A JavaScript XSLT processor without native library dependencies
GNU Lesser General Public License v3.0
95 stars 30 forks source link

Template should be able to match on any element not just / #34

Closed berenddeboer closed 1 year ago

berenddeboer commented 4 years ago

The first matching template must be "/" in this processor. That is incorrect. Any root element can be selected. So this works:

<xsl:template match="/">

but this doesn't:

<xsl:template match="/root">

I have added a failing test, but I don't know how to fix this unfortunately.

linde12 commented 3 years ago

Will this be merged & then fixed? Want to avoid /deeply/nested/paths and instead use templates. match="myroot" should work, but doesnt as the test shows.

johanneswilm commented 3 years ago

@linde12 You are welcome to try to fix it. I will then merge it.

leonelsanchesdasilva commented 1 year ago

This will be merged now as something to be fixed in a future version.