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

Preserve leading whitespace (indents) in Azure Data Studio XML output #25647

Open
OneEyedSi opened this issue May 18, 2024 · 0 comments
Open

Comments

@OneEyedSi
Copy link

OneEyedSi commented May 18, 2024

By default Azure Data Studio seems to remove leading whitespace from the inner text in XML columns in the results of a query. In contrast SQL Server Management Studio (SSMS) retains leading whitespace in the inner text when displaying XML. Could Azure Data Studio be updated to retain the leading whitespace, like SSMS does, or include an option to do so?

Example:

declare @xml xml = 
'<root>
    <text>
Unindented text.
    Single indented text.
        Double-indented text.
    </text>
</root>';

select @xml;

Result in Azure Data Studio, after clicking on the XML output column in the result pane to open the XML in a separate window:

<root>
	<text>
		Unindented text.
		Single indented text.
		Double-indented text.
	</text>
</root>

Desired result:

<root>
	<text>
Unindented text.
	Single indented text.
		Double-indented text.
	</text>
</root>

I've tried unchecking setting Query Editor > Results > Save as Xml: Formatted but that doesn't make any difference so I assume it's for saving the results to a file.

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

No branches or pull requests

1 participant