Project

Profile

Help

Bug #5001

open

saxon-js xsl:output method "xml" with indent "yes" eats whitespace

Added by Jamie Peabody almost 3 years ago. Updated almost 2 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
-
Sprint/Milestone:
Start date:
2021-05-25
Due date:
% Done:

0%

Estimated time:
Applies to JS Branch:
Fix Committed on JS Branch:
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

Using saxon-js 2.2.0, and given XSLT:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
				exclude-result-prefixes="xs"
				xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xsl:output method="xml" indent="yes"/>
	<xsl:template match="/">
		<login>
			<xsl:value-of select="/data/text()"/>
		</login>
	</xsl:template>
</xsl:stylesheet>

And XML:

<?xml version="1.0" encoding="UTF-8"?>
<data>   </data>

saxon-js produces:

<?xml version="1.0" encoding="UTF-8"?>
<login/>

If indent="no", then it outputs:

<?xml version="1.0" encoding="UTF-8"?>
<login>   </login>

It is unexpected that changing indentation would cause whitespace to be consumed and for elements to collapse.

Please register to edit this issue

Also available in: Atom PDF Tracking page