0

l am writing XML to a file.

Everything works fine, however if l view the XML source the first line is always indented.

Cant seem to figure out the cause.

Thankx in advance for the help

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by iceandrews
0

If you're writing an XSLT, whitespace typically either comes directly from the input document or while you're building the output tree. If you want to remove unwanted input whitespace from the input document and you want to make sure your output tree doesn't have any insignificant whitespace, use the strip-space and output instructions.

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:strip-space elements="*" />
	<xsl:output method="xml" indent="no" />
	
	<!-- Your code -->
</xsl:stylesheet>

Edited by iceandrews: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.