Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML Indenting

Status
Not open for further replies.

jfrost10

Programmer
Jun 3, 2001
2,004
CA
Hey guys,

withing visual studio's xml editor, does anyone know how to set it so any child nodes are automatically indented within the parent node?

thanks

D
 
Mine automatically indented without doing anything special. Besides adding them to as a child of whichever parent node you want. I can upload some code if you need it jack. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Weird. The new programmer we hired mentioned that her xml doc's weren't indenting, and when I checked mine didn't either.

Could you check something for me Mark? In vs.net, under Tools>Options>TextEditor>HTML/XML>Tabs

Do you have Smart selected for indenting? for some reason, mine (and her's) is greyed out, and I'm guessing that thats the answer there (or I'm hoping anyway)

thanks man

D
 
Hmm I may have misunderstood your question. I check and that option is greyed out in my VS as well.

I had thought you meant programmatically manipulating xml. The class that I made for that does the indenting automatically with no extra code required.

Guess we'll just have to get used to the tab button for manual editing. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Well the really weird (and possibly buggy) thing is that:

if you write an xml document with the following nodes
<parent>
<child></child>
<child></child>
</parent>

then select data view, then go back to the designer view, it changes to
<parent>
<child></child>
<child></child>
</parent>

so it CAN do the indenting, but I'm not sure if it requires the dataview to load it first so it can transform it, or if its truly just a bug.

ah well.

thanks for checking that out for me buddy
:)

D
 
np
That is a little odd how that works. meh I amn't going to lose sleep over it. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top