• Login
Community
  • Login

XML Tools syntax check

Scheduled Pinned Locked Moved Notepad++ & Plugin Development
4 Posts 3 Posters 7.1k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    Mats Køber
    last edited by Jun 24, 2022, 12:09 AM

    Dear Community,
    I was hoping somebody was able to help me with some difficulties I have with using the “Check XML syntax now”-feature in the XML Tools plugin. I am working on a xml-file that, eventually, will be in a xml format called DTBook. Not sure if it is considered “big” in this community, with 16000 lines. When I hit the “Check XML syntax now”-button, this is what I get:

    Skjermbilde 2022-06-24 012533.png
    There is no “End tag strong” in the referred line (and if there was, why would it be better to close a level4 in the middel of a level5?)
    I realize that this check is about well formed xml, and not a validation against the DTD, but if it is too loose accepting nesting of tags, it seems a bit of a waste of time. Is there a way of skiping the syntax check, and go straight to the validation? Or is this a bug or some combability issue?

    Skjermbilde 2022-06-24 020632.png
    Notepad++ v8.4.2 (64-bit)
    Build time : May 29 2022 - 16:47:30
    Path : C:\Program Files\Notepad++\notepad++.exe
    Command Line : $COMMAND_LINE_PLACEHOLDER$
    Admin mode : OFF
    Local Conf mode : OFF
    Cloud Config : OFF
    OS Name : Windows 11 (64-bit)
    OS Version : 21H2
    OS Build : 22000.739
    Current ANSI codepage : 1252
    Plugins :
    mimeTools (2.8)
    NppConverter (4.4)
    NppExport (0.4)
    XMLTools (3.1.1.13)

    E 1 Reply Last reply Jun 24, 2022, 7:39 AM Reply Quote 0
    • E
      Ekopalypse @Mats Køber
      last edited by Jun 24, 2022, 7:39 AM

      @mats-køber

      I can’t answer your question about validation without prior error checking, but from a programmer’s point of view it doesn’t make much sense. If the MSXML engine reports an error, it is likely that there is an error. I would imagine that the plugin is not displaying the correct line because you are using word wrapping. If you disable word wrapping, does it still point to a non-existent strong tag? Can you provide the xml file?

      M 1 Reply Last reply Jun 24, 2022, 12:58 PM Reply Quote 2
      • M
        Mats Køber @Ekopalypse
        last edited by Jun 24, 2022, 12:58 PM

        @ekopalypse
        Thanks for your response!
        I’m not a programmer, so I’ll have to accept that a validation without a prior syntax check makes no sense from a programmer’s point of view. It is just that from a tech novice’s understanding, when a document may be well formed but not valid, but not the other way around (not with the DTD I use, at least), the validation would also include syntax check. I have most of my xml experience from Oxygen, and there a validation prosess can be started on a not well-formed xml document - the upside is that the validation points to elements not allowed according to the DTD, not just “corresponding tags opening and closing”. But how this is solved, under the hood, I don’t know.

        There is without doubt errors in my document, and I eventually found the incident the error message referenced to, it was a strong closing tag misplaced, immediately after a level4 opening tag. Only it was not line 1820, but on line 1788.

        Disabling word wrapping did not make any difference: the error below I found to be on line 3521.

        Skjermbilde 2022-06-24 145456.png

        L 1 Reply Last reply Jun 25, 2022, 6:50 AM Reply Quote 0
        • L
          Lycan Thrope @Mats Køber
          last edited by Lycan Thrope Jun 25, 2022, 6:50 AM Jun 25, 2022, 6:50 AM

          @mats-køber ,
          That’s the first thing to suspect when you get a message like that, that the line number noted isn’t necessarily the problem line. It usually means, that the line that the checker shows, is where it finally realized there was an error somewhere prior and choked trying to figure it out. :-)
          Good job finding it. In your case, it sounds like it did a prescan and then choked later down the file when trying to implement it.

          1 Reply Last reply Reply Quote 2
          2 out of 4
          • First post
            2/4
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors