Re: Feature Request: XPath searching

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Feature Request: XPath searching

Raymond Bennett
 I would like the ability to have an XML document open in VIM and type
in an XPath query and have it evaluate and move me to the right node.
So if i had the following document open:
 
  <?xml version='1.0'?>
  <documents>
      <document>
          <name>My Document</name>
          <location>/home/raymond/documents/my.txt</location>
          <version>1.0</version>
      </document>
      <document>
           <name>My Document 2</name>
           <location>/home/raymond/documents/my2.txt</location>
           <version>0.3</version>
       </document>
      <document>
           <name>My Document 3</name>
           <location>/home/raymond/documents/my3.txt</location>
           <version>0.5</version>
       </document>
  </documents>
 
  And inside VIM I typed something like
":xpath:/documents/document[name='My Document 2']/location" then VIM
would evaluate that and move it to the appropriate node.
 
  Thanks
  Raymond
Reply | Threaded
Open this post in threaded view
|

vim (6.3.85) accepts overlong UTF-8 sequences

Ron Aaron
Loading the 'UTF-8 Stress test' file:

http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt

I can see all the "unsafe" UTF-8 sequences.  Probably it would be a good idea
to at least have a flag to say whether or not to be 'unsafe'.


--
Reva Forth for Linux and Windows --  http://ronware.org/reva/

GPG key fingerprint: 8130 734C 69A3 6542 0853 CB42 3ECF 9259 AD29 415D


Reply | Threaded
Open this post in threaded view
|

Re: vim (6.3.85) accepts overlong UTF-8 sequences

Bram Moolenaar

Ron Aaron wrote:

> Loading the 'UTF-8 Stress test' file:
>
> http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
>
> I can see all the "unsafe" UTF-8 sequences.  Probably it would be a
> good idea to at least have a flag to say whether or not to be
> 'unsafe'.

What do you suggest, reject to edit the file?

--
The most powerful force in the universe is gossip.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\     Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html   ///
Reply | Threaded
Open this post in threaded view
|

Re: vim (6.3.85) accepts overlong UTF-8 sequences

A.J.Mechelynck
In reply to this post by Ron Aaron
----- Original Message -----
From: "Ron Aaron" <[hidden email]>
To: <[hidden email]>
Sent: Wednesday, July 27, 2005 9:34 PM
Subject: vim (6.3.85) accepts overlong UTF-8 sequences


> Loading the 'UTF-8 Stress test' file:
>
> http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
>
> I can see all the "unsafe" UTF-8 sequences.  Probably it would be a good
> idea
> to at least have a flag to say whether or not to be 'unsafe'.
>
>
> --
> Reva Forth for Linux and Windows --  http://ronware.org/reva/
>
> GPG key fingerprint: 8130 734C 69A3 6542 0853 CB42 3ECF 9259 AD29 415D

From mbyte.txt, not far below ":help Unicode":

Overlong sequences are not handled specially and displayed like a valid
character.  However, search patterns may not match on an overlong sequence.
(an overlong sequence is where more bytes are used than required for the
character.)  An exception is NUL (zero) which is displayed as "<00>".

IOW, Vim accepts overlong sequences in file data, but you can't enter them
from the keyboard. IIUC, "forbidden" codepoints (such as all those ending in
FFFE or FFFF in any plane) are not rejected by Vim either. Neither are, of
course, those left out "for future use".


Best regards,
Tony.


Reply | Threaded
Open this post in threaded view
|

Re: vim (6.3.85) accepts overlong UTF-8 sequences

A.J.Mechelynck
In reply to this post by Bram Moolenaar
----- Original Message -----
From: "Bram Moolenaar" <[hidden email]>
To: "Ron Aaron" <[hidden email]>
Cc: <[hidden email]>
Sent: Wednesday, July 27, 2005 11:29 PM
Subject: Re: vim (6.3.85) accepts overlong UTF-8 sequences


>
> Ron Aaron wrote:
>
>> Loading the 'UTF-8 Stress test' file:
>>
>> http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
>>
>> I can see all the "unsafe" UTF-8 sequences.  Probably it would be a
>> good idea to at least have a flag to say whether or not to be
>> 'unsafe'.
>
> What do you suggest, reject to edit the file?

I guess the todo.txt line 1352 applies here:
8   Detect overlong UTF-8 sequences and handle them like illegal bytes.

Best regards,
Tony.