Skip to content
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

Comparison always discards whitespace-only text nodes #346

Closed
AirQuick opened this issue Sep 8, 2018 · 1 comment · Fixed by #353
Closed

Comparison always discards whitespace-only text nodes #346

AirQuick opened this issue Sep 8, 2018 · 1 comment · Fixed by #353
Labels

Comments

@AirQuick
Copy link
Member

AirQuick commented Sep 8, 2018

test.xsl (does nothing)

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" />

test.xml (contains a whitespace-only text node between <span>)

<?xml version="1.0" encoding="UTF-8"?>
<p><span>foo</span>&#x20;<span>bar</span></p>

test.xspec (expects no space between <span>)

<?xml version="1.0" encoding="UTF-8"?>
<x:description stylesheet="test.xsl" xmlns:x="http://www.jenitennison.com/xslt/xspec">
	<x:scenario label="When a function returns a node containing a space">
		<x:call function="exactly-one">
			<x:param href="test.xml" select="element(p)" />
		</x:call>
		<x:expect label="Expecting no space should be Failure">
			<p><span>foo</span><span>bar</span></p>
		</x:expect>
	</x:scenario>
</x:description>

x:expect should be Failure, but it is Success.
This is critical when testing mixed content such as HTML, DITA.

@AirQuick
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant