Collapse All Nodes in XML file including children

Last post 08-06-2008 7:58 AM by iys. 6 replies.

Sort Posts:

  • Collapse All Nodes in XML file including children

    06-04-2008, 10:12 AM
    • Loading...
    • VBMan
    • Joined on 09-21-2006, 9:22 PM
    • Posts 23

    Is there a keyboard shortcut that will collapse all nodes and child nodes within an xml document that you are editing.

    I have a xml file that is several layers deep and has thousands of childnodes off of the root node.

    I can get the root node to collapse but it doesn't collapse all the children.

    Viewing and editing is a pain with everything expanded.

    Thanks in advance! 

     

  • Re: Collapse All Nodes in XML file including children

    06-04-2008, 11:06 AM
    • Loading...
    • Pandiya
    • Joined on 06-03-2008, 4:40 PM
    • Posts 30

    Hi,

    Press Ctrl + m + m in front of root node.

    This will help u...

    Please mark if this answer is correct.

     

    Please remember to click "Mark as Answer" on this post if it helped you.
    Happy Coding Yes
    Pandiya
  • Re: Collapse All Nodes in XML file including children

    06-04-2008, 1:25 PM
    • Loading...
    • VBMan
    • Joined on 09-21-2006, 9:22 PM
    • Posts 23

    Hi,

    Thanks for the reply.

    It does collapse the root.

    It doesn't collapse all the children in the root.

    Collapsing every child recursively of every root so I can open just what I need is very time consuming to do manually.

     

  • Re: Collapse All Nodes in XML file including children

    06-04-2008, 11:10 PM
    • Loading...
    • corkwatchr
    • Joined on 06-04-2008, 4:58 PM
    • Saint Paul, MN
    • Posts 112

    No easy answer for this. If you have the time and ability... 

    Perhaps you could create yourself a new Visual Studio Macro. Click View - Other Windows - Macro Explorer.

    In the Sample project, look in the VSEditor file. There are two methods that you can use/borrow code from to create your own macro:

    • Sub OutlineCode()
    • Sub CollapseElt(ByVal elt As EnvDTE.CodeElement, ByVal elts As EnvDTE.CodeElements, ByVal loc As Integer)

    The code is in your language, VBMan!

    Good luck!

  • Re: Collapse All Nodes in XML file including children

    07-02-2008, 3:35 PM
    • Loading...
    • iys
    • Joined on 07-02-2008, 3:33 PM
    • Washington, DC
    • Posts 2

    CTRL+A, then CTRL+M+M

    Alternatively, if there is just a specific section of nodes you wish to collapse/expand, you can highlight just that section then do CTRL+M+M

  • Re: Collapse All Nodes in XML file including children

    08-06-2008, 7:33 AM
    • Loading...
    • jbeechii
    • Joined on 04-30-2006, 2:18 AM
    • Dayton, OH
    • Posts 2

    does anyone know if there is a keyboard cheetsheet anywhere. the CTRL+M+M trick will save me hours editing a confif thats 44k lines.

Page 1 of 1 (7 items)
Microsoft Communities
Page view counter