Community
    • Login

    XML-Tools - Validation problem

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    5 Posts 4 Posters 266 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.
    • Thorsten KreutzT
      Thorsten Kreutz
      last edited by

      Hi,

      I’m facing a problem with the validation of xml files against Style Sheets, which occured this year for the first time, while I’m using the same process for several years now. The basic context of what I’m doing is, that I have to report tax information to the German tax offices twice a year and as mentioned before it failed. The error message however is confusing:

      92a90082-4670-4b05-a7df-c262d4e4c5cb-image.png

      The regex behind the according rule is:
      [A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[1-5][A-Fa-f0-9]{3}-[ABab89][A-Fa-f0-9]{3}-[A-Fa-f0-9]{12}

      The string that is validated is (as shown):
      02c2af01-5d0e-1eef-bdb8-d2d5ad5dd1cb

      If I test the regex and the string on a testing website like regex101, it is a valid expression - but in Notepad++ using the path to the XSD in the attribute SchemaLocation, it fails as shown.

      Am I wrong or is this a real bug? I’m not sure and help would be appreciated.

      Best regards,
      Thorsten

      mkupperM Terry RT 2 Replies Last reply Reply Quote 0
      • mkupperM
        mkupper @Thorsten Kreutz
        last edited by

        @Thorsten-Kreutz said in XML-Tools - Validation problem:

        The regex behind the according rule is:
        [A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[1-5][A-Fa-f0-9]{3}-[ABab89][A-Fa-f0-9]{3}-[A-Fa-f0-9]{12}

        The string that is validated is (as shown):
        02c2af01-5d0e-1eef-bdb8-d2d5ad5dd1cb

        If I copy paste what you posted into Notepad++ then searching for [A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[1-5][A-Fa-f0-9]{3}-[ABab89][A-Fa-f0-9]{3}-[A-Fa-f0-9]{12} matches 02c2af01-5d0e-1eef-bdb8-d2d5ad5dd1cb as expected.

        You did not post enough information about the error message itself nor what you are attempting to do with XML Tools that lead up to the error for any of us to replicate the error.

        1 Reply Last reply Reply Quote 3
        • Terry RT
          Terry R @Thorsten Kreutz
          last edited by

          @Thorsten-Kreutz said in XML-Tools - Validation problem:

          Am I wrong or is this a real bug? I’m not sure and help would be appreciated.

          As this is mostly an english “speaking” forum translating your error message would have been helpful to the readers.

          So if Google translate is to be believed (it does an amazing job of interpreting my english o, b and a to the german equivalent characters) the message reads:

          ‘02c2af01-5d0e-1eef-bdb8-d2d5ad5dd1cb’ violates pattern constraint of ‘.*[^ ]’
          attribute analysis ‘UUID’ with the value ‘02c2af01-5d0e-1eef-bdb8-d2d5ad5dd1cb’ failed

          As @mkupper says and you also alluded to, pasting that string into other sites and testing didn’t produce a reason for the error. So I then looked at the whole error message. The “pattern constraint of ‘.*[^ ]’” is maybe where you need to look instead since we all confirm the actual regex pattern you showed successfully tests the string as provided. When you tested the string did you just copy that into regex101 (from the source) or did you type it out again?

          Although it seems stupid to do so, maybe count the length of several of these strings in your XML file. Since your pattern suggests the string should be a fixed length, maybe this string isn’t the same length as the others. It may contain something you/we cannot see.

          Terry

          Mark OlsonM 1 Reply Last reply Reply Quote 3
          • Mark OlsonM
            Mark Olson @Terry R
            last edited by Mark Olson

            @Terry-R said in XML-Tools - Validation problem:

            It may contain something you/we cannot see.

            @Thorsten-Kreutz

            Yeah, my first thought was that maybe one of the strings contains a non-printing character that’s causing the issue. Turning on the Show Non-Printing characters or Show All Characters setting would reveal whether this is the case.

            Thorsten KreutzT 1 Reply Last reply Reply Quote 3
            • Thorsten KreutzT
              Thorsten Kreutz @Mark Olson
              last edited by

              @Mark-Olson and @Terry-R

              Thank you for your answers and sorry for the late response.
              I checked if there are unseen characters but there are none.

              I’m sorry for not translating the error text - I just made the screenshot and never thought about it. The google translation offered by @Terry-R is correct though.

              As for the mentioned lack of information:

              I’m using Notepadd++ 8.7.9 with XML tools 3.1.1.13.

              The XSD files are from the german tax offices and can be downloaded here:
              https://www.bzst.de/SharedDocs/Downloads/DE/Handbuecher/fs_XSDs_ab_20240401.zip?__blob=publicationFile&v=3

              A valid xml file which produces the mentioned error is:

              <?xml version="1.0" encoding="utf-8"?>
              <n1:ELMA xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.itzbund.de/elan ./XSD/ELMA_FSAK_FS-6.1.0.xsd" xmlns:n1="http://www.itzbund.de/elan" xmlns:elan="http://www.itzbund.de/elan/elemente" xmlns:verf="http://www.itzbund.de/FSAK/FS/02.00" xmlns:std="http://www.itzbund.de/FSAK/FSStd/02.00" elmaVersion="2" verfVersion="6.1.0">   
              	<elan:ELMAHeader>
                      <elan:BenutzerkontoID>1006870761</elan:BenutzerkontoID>
              		<elan:Transportweg>
              			<elan:Datenart>FSAK_FS</elan:Datenart>
              			<elan:Umgebung>PRODUKTION</elan:Umgebung>
              	   </elan:Transportweg>
              	   <elan:Identifizierung>
              			<elan:EingangsID>1e6bb852-e445-47fc-965e-cdd2dc7f251c</elan:EingangsID>
              	   </elan:Identifizierung>
              	   <elan:Zeitpunkte>
              			<elan:Erstellung>2025-02-28T12:20:25Z</elan:Erstellung>
              	   </elan:Zeitpunkte> 
              	</elan:ELMAHeader> 
                 <verf:FSAKFSRoot>
                  <verf:FSAK_FS UUID="02c2af01-5d0e-1eef-bdb8-d2d5ad5dd1cb">
              	<verf:Melder>
                    <verf:Daten Bezeichnung="Monster Inc." Zulassungsnummer="12345678" Steuernummer="9120012345678" eMail="mike@monster.inc" Telefon="555-1234567"/>
                    <verf:Adresse PLZ="12345" Strasse="Monsterroad" HausNr="47" HausNrZu="a" Ort="Monsterville" />
                  </verf:Melder>
                   <verf:MeldungListe>
                    <verf:Meldung freigestellterBetrag="75" OrdBegriff="98765432" Zeitstempel="2025-02-28T12:20:25Z" Meldejahr="2024" UUID="02c2af01-5d0e-1eef-bdb8-d2d5ad5e11cb" xsi:type="verf:Meldeart1">
                     <verf:Glaeubiger>
                      <verf:Daten Geburtsdatum="1970-06-19" Name="Sullivan" Vorname="James" IdNr="12345678901"/>
                      <verf:Adresse xsi:type="std:AdresseInlandType" HausNr="11" Strasse="Homelandway" Ort="Home" PLZ="23456"/>
                     </verf:Glaeubiger>
                     <verf:Ehegatte>
                      <verf:Daten Geburtsdatum="1979-11-24" Name="Sullivan" Vorname="Jane" IdNr="98765432109"/>
                      <verf:Adresse xsi:type="std:AdresseInlandType" HausNr="11" Strasse="Homelandway" Ort="Home" PLZ="23456"/>
                     </verf:Ehegatte>
                    </verf:Meldung>
                   </verf:MeldungListe>
                  </verf:FSAK_FS>
                 </verf:FSAKFSRoot>
              </n1:ELMA>
              

              The schemaLocation points to the a directory “XSD” in the same directory as the xml file with the content of the downloaded XSD extracted to “XSD”.

              Thanks again and still glad for any help!
              Thorsten

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