Collapsing XML tags

Display customization and font issues

Collapsing XML tags

Postby makins » Wed Dec 14, 2005 4:16 pm

Is there any way to collapse/expand specific XML tags without having to click each individual one?

I have a large file that contains <person> and <group> and <membership> tags. I'd like to collapse just the person tags (several thousand) and see the details in the remaining <group> and <membership> tags. Since there are SO many person tags, I don't want to collapse each manually. :roll:

If there isn't a menu command that will do it, how can I create a macro that will find and collapse the <person> tags? :?:
User avatar
makins
Newbie
 
Posts: 1
Joined: Wed Dec 14, 2005 12:00 am

Re: Collapsing XML tags

Postby Mofi » Wed Dec 14, 2005 4:35 pm

Not possible neither via a menu function nor a macro.

But you could do following:

Open your wordfile and copy the language settings for XML to a second, higher language number. In the second language definition for XML remove the open and close fold strings for group and membership and save the wordfile. You have to close and restart UltraEdit now.

/L6"XML - All tags" XML_LANG Noquote Block Comment On = <!-- Block Comment Off = --> File Extensions = XML XUL XSD XSL XSLT
:
:

/L12"XML - Person tags" XML_LANG Noquote Block Comment On = <!-- Block Comment Off = --> File Extensions = XML XUL XSD XSL XSLT
:
:

After opening the XML file again it will be highlighted by default with the first language definition "XML - All tags". Select now from the "View - View As" menu the second highlighting definition for XML - "XML - Person tags".

Finally use the "Collapse All" function from the "View - Hide/Show Lines" menu to fold all person tags.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4066
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Editor Display