Find XML Tags : Locate tags with out of order attributes
| script karma
Downloaded by 1035
Comments, bugs, improvements
script versions (upload new version)
|I was editing an HTML file written by several developers over the course of a
few years. They contained tags like (yes, literally!)
<table cellpadding=0 cellspacing="0" border='0'>
<table cellspacing="0" cellpadding=0 border='0'>
<table cellspacing=0 cellpadding=0 border=0>
They're all basically the same table definition, but the attributes are
switched around and the attribute values are formatted differently each time.
(Thank the multiple developers, each with their own style.) Running HTML Tidy
wasn't an option because I didn't want to create a huge diff in version
control that indicated a lot of changes where I didn't actually change
anything. Thus, this plugin.
The commands and functions defined in this script will match any XML/HTML
element/tag with the specified attributes and values.
|Source the Vimball and try :help Findxmltag.
Use :help FindXmlTag_History to find out what's changed.
Click on the package to download.
ip used for rating: 220.127.116.11
||Bug fixes, mostly (thanks entirely to Ingo Karkat). Also, renamed the commands to camel-case: FindXmlTagExact and FindXmlTagFlexible.
Uploaded again; had accidentally left out an enhancement to highlight search results if 'hlsearch' is set.
||Added options to easily add attributes with any value or no value.