XQuery UDL

  • Thank you MC,

    This proves that the UDL works fine - but still not for me !
    File extension hiding is turned off.
    Here is the debug info:
    Notepad++ v7.6.6 (64-bit)
    Build time : Apr 3 2019 - 23:52:32
    Path : C:\Program Files\Notepad++\notepad++.exe
    Admin mode : OFF
    Local Conf mode : OFF
    OS : Windows 10 (64-bit)
    Plugins : mimeTools.dll NppConverter.dll

    May be should local conf mode be ON ?

  • @Robert-Kirkpatrick

    thank you for your detailed debug information.

    May be should local conf mode be ON ?

    no, local conf mode is just for the portable versions of notepad++.
    it just serves to confine all configuration files to the notepad++ folder, instead of %AppData% for every specific user.
    this mode is not possible, if notepad++ is installed in C:\Program Files\Notepad++.
    your installation looks good to me as it is.

    please try the following:

    • right click and save https://github.com/robwhitby/NotepadPlusPlus-XQuery/raw/master/userDefineLang.xml
    • make sure the saved file is called userDefineLang.xml, if it is called userDefineLang.xml.txt or anything else, rename it to userDefineLang.xml.
    • open up notepad++.
      go to language > define your language > import, select the userDefineLang.xml you have just downloaded and press open, as seen at the screenshot below:


    • it should now say import successful.
    • close notepad++ and reopen it, for the changes to take effect.
    • open up an .xqy file or paste your example into a new tab.
    • go to the language menu and select XQuery, as seen at the next screenshot:
    • your xquery code should now be highlighted.

    hope this helps.

    note: the other file at https://github.com/robwhitby/NotepadPlusPlus-XQuery , called XQuery.xml is just for the autocompletion and not needed for the highlighting. we can deal with that later.

  • I tried it many times, but I always get Fail to import

  • @Robert-Kirkpatrick

    very intriguing indeed.

    please test the following, to verify, if a clean, portable notepad++ would work on your system.

    • download the notepad++ 7.6.6. 64 bit portable version from >>> here <<<.
      (the portable version does not require any installation and runs completely independent and isolated from your installed version. all custom settings, as well as any stuff you might want to try at the portable version, will not modify your installed version)

    • extract npp.7.6.6.bin.x64.zip to a folder, which is automatically called npp.7.6.6.bin.x64 and copy this folder to your desktop.

    • important note: make sure to close all instances of notepad++ that might be running, before starting the portable version at the next steps, to be sure you are using the portable version for this test.

    • open the userDefineLangs folder within the extracted npp.7.6.6.bin.x64 folder on your desktop.
      (the path %HomePath%\Desktop\npp.7.6.6.bin.x64\userDefineLangs will lead you there)

    • copy userDefineLang.xml you have downloaded from >>> here <<< into userDefineLangs.

    • start this portable version by double-clicking on notepad++.exe inside the npp.7.6.6.bin.x64 folder.

    • go to the language menu and check if XQuery is present.

    let’s hope this works for you.
    if it does, we can search for the differences and eventually find the culprit on your system.

    best regards.

  • Makes no difference, no new language, fail to import again.

    Seem to get worse…:(

  • @Robert-Kirkpatrick

    this is very strange, as the portable, stand alone notepad++ version always works for such cases.

    last things you could try:

    • copy userDefineLang.xml you have downloaded, without renaming, into %AppData%\Notepad++ and start your installed notepad++.

    • check if perhaps your browser or any anti malware tool has altered the content of userDefineLang.xml while downloading.

    the contents of userDefineLang.xml should begin with:
    (due to allowed size limitations, i can’t post the whole file)

        <UserLang name="XQuery" ext="xqy">
                <Global caseIgnored="no" />
                <TreatAsSymbol comment="no" commentLine="no" />
                <Prefix words1="no" words2="yes" words3="no" words4="no" />
                <Keywords name="Delimiters">&apos;&lt;0&apos;&gt;0</Keywords>
                <Keywords name="Folder+">{</Keywords>
                <Keywords name="Folder-">}</Keywords>
                <Keywords name="Operators">&apos; ! &quot; ( ) * , . / ; @ [ ] &lt; = &gt;</Keywords>
                <Keywords name="Comment">1(: 2:) 0</Keywords>
                <Keywords name="Words1">after ancestor ancestor-or-self as ascending assert attribute before case cast child comment declare default descendant descendant-or-self descending element else every except following following-sibling follows for function if import in instance intersect item let module namespace node of only option parent precedes preceding preceding-sibling processing-instruction ref return returns satisfies schema self some sortby stable text then to treat typeswitch union variable version where xquery</Keywords>
                <Keywords name="Words2">$</Keywords>

    other than than, i’m sorry, i am out of ideas :(

    best regards.

  • @Robert-Kirkpatrick said:

    Makes no difference, no new language, fail to import again.

    Following @Meta-Chuh’s detailed instructions should work. You will need to give us more information if you want us to be able to help you.

    It would help if you would take screenshots along the way, post them to imgur, and then link them using the syntax ![](http://i.imgur.com/QTHZysa.png). Or, even better, use a utility like ScreenToGif to take a “video” (animated gif) of the whole process, upload to imgur, and embed the animated gif the same way (![](https://i.imgur.com/Q36FaoJ.gif) – make sure you use the .gif link, not the .gifv link) so we can see exactly what you’re doing

    For example, I followed the download/import/restart/apply instructions to your sample .xqy file, and it highlighted properly. I recorded my process:

  • I might suspect an interference with an older installation of npp, which coexists on another drive used by older Windows versions (though currently disabled).
    Is there some Registry setting that need cleanup?

  • @Robert-Kirkpatrick said:

    Is there some Registry setting that need cleanup?

    Only if you didn’t follow @Meta-Chuh’s instructions.

    He asked that you download the portable (zip or 7z) version of Notepad++, and extract that to your desktop. That portable copy doesn’t use any of the registry settings or the %AppData%\Notepad++ saved settings; it uses a completely clean edition. You’ll notice in my animation, the Debug Info shows Local Conf Mode: ON, because I was using a portable edition.

    To follow his instructions correctly, you should have run notepad++ from your portable download; looking at ? > Debug Info should show local configuration mode is on, and the notepad++.exe path should be relative to your desktop (or wherever you unzipped your portable). When you loaded your .xqy file, you should have used the File > Open menu of the portable Notepad++ rather than double-clicking or right-clicking on the .xqy in Explorer and running your installed version.

    (To clarify: under an installed condition, there may be a mixup in registry settings given your old-vs-new installations; but Meta asked you to do the portable/zip/7z version of Notepad++, so that registry settings and %AppData%\Notepad++ settings would not get in the way.)

    Until you start providing details, rather than giving one-to-two-sentence replies to our detailed posts, we won’t be able to help you any further, because we have run out of guesses as to what might be going wrong for you. If you follow these sequences we’ve described, it should work – we have shown in multiple ways that it does work. If it’s not working for you, you will have to do a better job of giving a step-by-step recounting of exactly what you did, with screenshots and/or animated gifs.

  • I did follow the instructions about the portable version strictly.
    I will continue the investigation myself.

Log in to reply