views:

55

answers:

2

I'd like to organize my XML data to be collapsable and expandable using a preprocessor command like the #region/#endregion command in C#/.NET. I'm editing this file Visual Studio 2008.

Does any such ability exist? I've googled to no avail. The closest I can come to so far is to expand and collapse the tags themselves, so I can collapse between

<Data> 
(this is collapsed)
</Data>
+2  A: 

Using such commands would change the XML file itself, so I can't see a real use case for this and as you said, you can collapse the tags themselves, so you already have a close to perfect solution to your problem. Why do you need more then that?

Oded
The reason why I need this is because we are using XML to create a domain specific language, and there are over ten 15-line structures I'd like to "group" together in one section of a file like a region. I cannot merely add an additional XML tag for this without having the domain specific language changed (I do not have control over this)
CrimsonX
@CrimsonX - You can always add visual separation in the form of white space. If it is between elements you can add new lines.
Oded
@Oded... thats effectively what I ended up doing. Just adding `<!--START [enter description]-->` and `<!--END [enter description]-->` to show clear descriptions of data. Not collapsable, but good enough.
CrimsonX
+1  A: 

There does not appear to be any Visual Studio supported ability to do what I'm looking to do. As discussed in Oded's answer, the best solution was to add XML comments like

<!--START [enter description]--> 
<myDataHere .../>
<!--END [enter description]--> 

with Whitespace to organize the code.

CrimsonX