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 · 0 comments

Comments

Projects
None yet
1 participant
@AirQuick
Copy link
Member

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 AirQuick added the bug label Sep 8, 2018

@AirQuick AirQuick closed this in #353 Mar 4, 2019

AirQuick added a commit that referenced this issue Mar 4, 2019

@AirQuick AirQuick referenced this issue Apr 30, 2019

Closed

Release v1.3.0 #563

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.