Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a keyboard shortcut in Visual Studio to jump up to the parent XML/XHTML node in XML code view?

Not too sure how to elaborate on this over what the title already states, but it would be super great if when I was hovering my carat on a node in the XML/XHTML source view, that I could press a key to jump up to the parent node.

If not in Visual Studio, is it in any addons like ReSharper or [can't remember the name of any others..!]?

like image 605
joshcomley Avatar asked Sep 02 '10 12:09

joshcomley


1 Answers

With ReSharper you can navigate to "Containing Declaration" (default key is Ctrl + 8, customize by changing ReSharper.ReSharper_GotoContainingDeclaration). From the Visual Studio menu you can use ReSharper - Navigate - Containing Declaration. This works in XML, XHTML and C#.

Given the following XML:

<?xml version="1.0" encoding="utf-8" ?>
<persons>
  <person>
    <name>Mikael</name>
  </person>
</persons>

If you're cursor is inside "Mikael", first command of "navigate to containing declaration" will take you to the "name", then the next one will move you up to "person" and after the third command you will end up in "persons".

like image 105
Mikael Koskinen Avatar answered Sep 25 '22 20:09

Mikael Koskinen