Loading ...
Sorry, an error occurred while loading the content.
 

RE: XML files and layout

Expand Messages
  • David Fishburn
    From my post yesterday: Use the open source tool to reformat the document Double quote the filename if on windows if has( win32 ) vnoremap
    Message 1 of 2 , Sep 10, 2003
      From my post yesterday:
      " Use the open source tool to reformat the document
      " Double quote the filename if on windows
      if has('win32')
      vnoremap <buffer> <Leader>xf :!xmllint --format "-"<CR>
      else
      vnoremap <buffer> <Leader>xf :!xmllint --format -<CR>
      endif


      The above turned this:
      <dave> <bob> <jim> <simon> <setf> <ky> <hhh> <gggg>

      some text
      </gggg> </hhh> </ky>
      </setf> </simon> </jim> </bob> </dave>

      Into this:
      <?xml version="1.0"?>
      <dave>
      <bob>
      <jim>
      <simon>
      <setf>
      <ky>
      <hhh>
      <gggg>

      some text
      </gggg>
      </hhh>
      </ky>
      </setf>
      </simon>
      </jim>
      </bob>
      </dave>


      Which does most of what you want. I would write an additional sub to
      get rid of the extra spaces, xmllint appears to consider those
      significant.

      Dave



      -----Original Message-----
      From: Roman Rytov [mailto:rrytov@...]
      Sent: Wednesday, September 10, 2003 6:03 AM
      To: vim@...
      Subject: XML files and layout


      Is there a way to layout an XML doc also on the verticall direction.
      Something like

      <?xml version="1.0" encoding="UTF-8"?><a><b>
      <x>

      Ddd</x>
      </b></a>

      Becomes

      <?xml version="1.0" encoding="UTF-8"?>
      <a>
      <b>
      <x>Ddd</x>
      </b>
      </a>

      ___________
      RomanR
    Your message has been successfully submitted and would be delivered to recipients shortly.