pnedev / nppgtags

GTags plugin for Notepad++
GNU General Public License v2.0
39 stars 12 forks source link

Parsing of XML files #20

Closed pidgeon777 closed 5 years ago

pidgeon777 commented 5 years ago

I'm not sure this would be actually doable in NppGTags, but here I go. I was trying to index this XML file:

<?xml version = "1.0" encoding = "utf-8"?>

<!-- planes.xml - A document that lists ads for 
                  used airplanes -->

<!DOCTYPE planes_for_sale SYSTEM "planes.dtd">
<planes_for_sale>
   <ad>
      <year> 1977 </year>
      <make> &c; </make>
      <model> Skyhawk </model>
      <color> Light blue and white </color>
      <description> New paint, nearly new interior,
            685 hours SMOH, full IFR King avionics </description>
      <price> 23,495 </price>
      <seller phone = "555-222-3333"> Skyway Aircraft </seller>
      <location>
         <city> Rapid City, </city>
         <state> South Dakota </state>
      </location>
   </ad>
   <ad>
      <year> 1965 </year>
      <make> &p; </make>
      <model> Cherokee </model>
      <color> Gold </color>
      <description> 240 hours SMOH, dual NAVCOMs, DME, 
                new Cleveland brakes, great shape </description>
      <seller phone = "555-333-2222"  
              email = "jseller@www.axl.com">
              John Seller </seller>
      <location>
         <city> St. Joseph, </city>
         <state> Missouri </state>
      </location>
   </ad>
</planes_for_sale>

but it seems that NppGTags doesn't detect any tag (the same applies to tag values, and so on). I don't know if this classifies as an issue or not, I was just curious to know if there was a way to index the nodes, id's, and values of an XML file with NppGTags, given that Pygments allegedly seems to support that:

http://pygments.org/docs/lexers/

pnedev commented 5 years ago

I'll have a look when I find the time, thanks

pnedev commented 5 years ago

Hello @pidgeon777 ,

I haven't been working on NppGTags for some time now but did a small change recently and decided to test this long-standing issue.

It appears the current parsers versions doesn't support XML. Perhaps a new versions are available, I don't know for sure but I'm not planning to update those soon.

You can open your NppGTags plugin location - in Notepad++ plugins folder locate NppGTags.dll. There should be a subfolder NppGTags and inside it there is a file named gtags.conf. Open it with some text editor and there you will find the currently supported languages by the different parsers. Only the listed files extensions will be parsed by the corresponding parser. All other files will be treated as Other files meaning that you can search those with the plugin command Search in Other Files. Please have in mind that using Pygments parser actually uses both Universal Ctags + Pygments. The later is used only for references search.

BR