Groups | Blog | Home
all groups > dotnet xml > june 2006 >

dotnet xml : Why does VS not format an XML document?



Stan Kitsis [MSFT]
6/23/2006 11:00:30 AM
If there are no linebreaks in the file, you will not get auto-formatting.
If this is the case, just hit "Format the whole document" button on the
toolbar (or use Edit | Advanced | Format Document menu ooption or Ctrl+K,
Ctrl+D).

Also, some XML documents contain instructions to preserve whitespace. In
this case, VS will not format the portions of the document to which these
instructions apply.

--
Stan Kitsis
Program Manager, XML Tools & Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.


[quoted text, click to view]

Randolph Neall
6/23/2006 11:55:22 AM
I'm new to XML. I'm noticing that certain XML documents, when viewing XML
text, do not format in VS 2005. Instead, everything is rendered on one long
line. In Internet Explorer, the text formats fine. What do I need to do to
get VS to format XML text for me?

Thanks,

Randy Neall

Randolph Neall
6/23/2006 2:25:47 PM
Just what I needed. Thanks very much Stan.

Randy


[quoted text, click to view]

Randolph Neall
6/23/2006 2:55:33 PM
Thank you very much!

Randy


[quoted text, click to view]

Martin Honnen
6/23/2006 6:59:12 PM


[quoted text, click to view]

Internet Explorer applies an XSL stylesheet to render a collapsible tree
of the document.
If VS shows everything on one line then I assume the XML source document
has no line breaks so you need to run indentation on it.

--

Martin Honnen --- MVP XML
AddThis Social Bookmark Button