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

XML files and layout

Expand Messages
  • Roman Rytov
    Is there a way to layout an XML doc also on the verticall direction. Something like Ddd Becomes
    Message 1 of 2 , Sep 10 3:02 AM
    • 0 Attachment
      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
    • 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 2 of 2 , Sep 10 6:19 AM
      • 0 Attachment
        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.