*xml_autons.txt* auto :XMLns by the current content
Version 0.0.1
Script ID: 2099
Copyright (C) 2007 kana <http://whileimautomaton.net/>
License: MIT license {{{
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
}}}
CONTENTS *xml_autons-contents*
Introduction |xml_autons-introduction|
Interface |xml_autons-interface|
Commands |xml_autons-commands|
Customizing |xml_autons-customizing|
Bugs |xml_autons-bugs|
Changelog |xml_autons-changelog|
==============================================================================
INTRODUCTION *xml_autons-introduction*
*xml_autons* is an additional Vim filetype plugin for XML to execute |:XMLns|
according to the content of the current buffer. This supports to use omni
completion for XML (|ft-xml-omni|), because it requires to execute |:XMLns|.
Requirements:
- Vim 7.0 or later
Latest version:
http://github.com/kana/config/commits/vim-xml_autons
Document in HTML format:
http://kana.github.com/config/vim/xml_autons.html
==============================================================================
INTERFACE *xml_autons-interface*
------------------------------------------------------------------------------
COMMANDS *xml_autons-commands*
:AutoXMLns *:AutoXMLns*
Do |:XMLns| according to the content of the current
buffer. For example, if the current buffer has the
following content: >
<
:AutoXMLns will execute the following commands: >
<
:AutoXMLns will be automatically executed for each
time you begin to edit an XML document, so that you
don't have to do it manually.
See also |g:AutoXMLns_Dict|.
==============================================================================
CUSTOMIZING *xml_autons-customizing*
g:AutoXMLns_Dict *g:AutoXMLns_Dict*
|Dictionary| to translate a namespace URI to the
corresponding name for |:XMLns|. For example, If you
prefer XHTML 1.0 Strict to XHTML 1.1, set as follows:
>
<
As the default, XHTML 1.1 and XSLT are supported.
==============================================================================
BUGS *xml_autons-bugs*
- |:AutoXMLns| checks only namespace declarations in the root tag. So that
declarations in other tags are ignored. Because namespaces may be locally
overriden and |ft-xml-omni| cannot deal with such XML documents correctly.
- |:AutoXMLns| checks only namespace URIs and doesn't check DTD decralations.
This may cause some accidents, for example, the namespace URI of XHTML 1.1
and the one of XHTML 1.0 Strict (and other variants) are same. So that
:AutoXMLns may treat the current buffer as XHTML 1.1 even if the proper
version is XHTML 1.0 Strict.
- |:AutoXMLns| uses |:XMLns|, so that this filetype plugin must be placed
|after-directory| to load it after the default filetype plugin.
- When new |xml-omni-datafile| is added, you have to add the entry for it to
|g:AutoXMLns_Dict| manually. It is convenient to compute the default values
of |g:AutoXMLns_Dict| from |xml-omni-datafile| in 'runtimepath', but
|xml-omni-datafile| doesn't contain the corresponding namespace URI.
==============================================================================
CHANGELOG *xml_autons-changelog*
0.0.1 2007-05-10 *xml_autons-changelog-0.0.1*
- |:AutoXMLns|: Suppress messages when the root tag is written in
more than 'report' lines.
- |g:AutoXMLns_Dict|: Don't override user settings that were done
before this filetype plugin is first loaded.
0.0 2007-04-28 *xml_autons-changelog-0.0*
- First release.
==============================================================================
vim:tw=78:ts=8:ft=help:norl:fen:fdl=0:fdm=marker: