-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xsl:template
transformation packs text nodes to the beginning
#109
Comments
@jrutila Thanks again for this new test. I added to our unit tests as well. This test fails with the following:
But the online transformer returns something else: <span>XY</span> This happens because the resulting XML doesn't necessarily retain text from the input, if not explicitly mentioned in the template. Can you please validate if I should implement the behavior from the online transformer? It utilizes XSL implementation in Java. |
Change the
|
@jrutila This problem happens due to this project still not having template precedence implemented. We have a unit test that describes the problem very well. So far, the logic to resolve this works good with one child text node, but not with multiple nodes: https://github.com/DesignLiquido/xslt-processor/blob/main/src/xslt/xslt.ts#L943 Besides the template precedence (which resolves an issue when a more restricted template comes before a least restricted template), I need to think about a logic that writes text nodes differently when they are in a template. One of my initial ideas was to pass a fragment node to write the children of that node, separating As time is being scarce on my end, I would need some time to think about a good solution on this. |
This test case will show the problem. The output is now
XYtest1
even though it should beXtest1Y
. I think it is because the text nodes getsiblingPosition
of -1 and thexsl:value-of
gets bigger than 0. Then, when it is rendering, it sorts the siblings bysiblingPosition
.The text was updated successfully, but these errors were encountered: