PEReference error with XML external ENTITY DTD











up vote
0
down vote

favorite












I have this XML code declaring an external DTD ENTITY:



<!DOCTYPE customers [
<!ENTITY % itemCodes SYSTEM "codes.dtd">
%itemCodes;
]>


This is simply to call up some pre-written codes from codes.dtd:



<!ENTITY DCT5Z "Tapan Digital Camera 5 Mpx - zoom">
<!ENTITY SM128 "SmartMedia 128MB Card">
<!-- etc. -->


But I get this error:



This page contains the following errors:

error on line 53 at column 8: PEReference: %itemCodes; not found


Why would that be?










share|improve this question




























    up vote
    0
    down vote

    favorite












    I have this XML code declaring an external DTD ENTITY:



    <!DOCTYPE customers [
    <!ENTITY % itemCodes SYSTEM "codes.dtd">
    %itemCodes;
    ]>


    This is simply to call up some pre-written codes from codes.dtd:



    <!ENTITY DCT5Z "Tapan Digital Camera 5 Mpx - zoom">
    <!ENTITY SM128 "SmartMedia 128MB Card">
    <!-- etc. -->


    But I get this error:



    This page contains the following errors:

    error on line 53 at column 8: PEReference: %itemCodes; not found


    Why would that be?










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have this XML code declaring an external DTD ENTITY:



      <!DOCTYPE customers [
      <!ENTITY % itemCodes SYSTEM "codes.dtd">
      %itemCodes;
      ]>


      This is simply to call up some pre-written codes from codes.dtd:



      <!ENTITY DCT5Z "Tapan Digital Camera 5 Mpx - zoom">
      <!ENTITY SM128 "SmartMedia 128MB Card">
      <!-- etc. -->


      But I get this error:



      This page contains the following errors:

      error on line 53 at column 8: PEReference: %itemCodes; not found


      Why would that be?










      share|improve this question















      I have this XML code declaring an external DTD ENTITY:



      <!DOCTYPE customers [
      <!ENTITY % itemCodes SYSTEM "codes.dtd">
      %itemCodes;
      ]>


      This is simply to call up some pre-written codes from codes.dtd:



      <!ENTITY DCT5Z "Tapan Digital Camera 5 Mpx - zoom">
      <!ENTITY SM128 "SmartMedia 128MB Card">
      <!-- etc. -->


      But I get this error:



      This page contains the following errors:

      error on line 53 at column 8: PEReference: %itemCodes; not found


      Why would that be?







      xml import entity external doctype






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 18 at 14:22









      Cœur

      17k9102140




      17k9102140










      asked Jan 12 '13 at 21:59









      Pori

      3262416




      3262416
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          Why would that be?



          Because it can't find the codes.dtd file. If you aren't using some sort of catalog based resolution mechanism, then the codes.dtd would have to be in the working directory of the program you're running.



          But an error on line 53 seems odd. That's too far into a file for a DTD. What does line 53 look like?



          UPDATE: On reconsideration, the problem may not be that codes.dtd couldn't be found, but that the XML parser being used doesn't process external entities. (After all, it said that the PE reference itself, and not its referent, couldn't be found.) This is a quite common limitation of non-validating parsers, but the error diagnostic could have been more helpful ("Sorry, external entity references are not supported".)






          share|improve this answer























          • If what you're say is true, then why would the DTD file not be found within the same directory as the XML file? I have everything placed together and am simply trying to open the file in Chrome. Also, The reason line 53 shows up is because the DOCTYPE has some internal declarations that I excluded.
            – Pori
            Jan 13 '13 at 2:00












          • In that case, I may have misunderstood the error message. I'll add an update.
            – arayq2
            Jan 13 '13 at 2:07










          • Isn't Chrome's XML support quite limited? If you put the entire internal subset in another dtd file and just have <!DOCTYPE customers SYSTEM "external.dtd">, you may find out whether external entities are supported.
            – arayq2
            Jan 13 '13 at 2:14












          • It seems to work fine on Firefox. However, Firefox can't seem to import the codes I saved in the DTD.
            – Pori
            Jan 14 '13 at 1:32











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f14298366%2fpereference-error-with-xml-external-entity-dtd%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          Why would that be?



          Because it can't find the codes.dtd file. If you aren't using some sort of catalog based resolution mechanism, then the codes.dtd would have to be in the working directory of the program you're running.



          But an error on line 53 seems odd. That's too far into a file for a DTD. What does line 53 look like?



          UPDATE: On reconsideration, the problem may not be that codes.dtd couldn't be found, but that the XML parser being used doesn't process external entities. (After all, it said that the PE reference itself, and not its referent, couldn't be found.) This is a quite common limitation of non-validating parsers, but the error diagnostic could have been more helpful ("Sorry, external entity references are not supported".)






          share|improve this answer























          • If what you're say is true, then why would the DTD file not be found within the same directory as the XML file? I have everything placed together and am simply trying to open the file in Chrome. Also, The reason line 53 shows up is because the DOCTYPE has some internal declarations that I excluded.
            – Pori
            Jan 13 '13 at 2:00












          • In that case, I may have misunderstood the error message. I'll add an update.
            – arayq2
            Jan 13 '13 at 2:07










          • Isn't Chrome's XML support quite limited? If you put the entire internal subset in another dtd file and just have <!DOCTYPE customers SYSTEM "external.dtd">, you may find out whether external entities are supported.
            – arayq2
            Jan 13 '13 at 2:14












          • It seems to work fine on Firefox. However, Firefox can't seem to import the codes I saved in the DTD.
            – Pori
            Jan 14 '13 at 1:32















          up vote
          0
          down vote













          Why would that be?



          Because it can't find the codes.dtd file. If you aren't using some sort of catalog based resolution mechanism, then the codes.dtd would have to be in the working directory of the program you're running.



          But an error on line 53 seems odd. That's too far into a file for a DTD. What does line 53 look like?



          UPDATE: On reconsideration, the problem may not be that codes.dtd couldn't be found, but that the XML parser being used doesn't process external entities. (After all, it said that the PE reference itself, and not its referent, couldn't be found.) This is a quite common limitation of non-validating parsers, but the error diagnostic could have been more helpful ("Sorry, external entity references are not supported".)






          share|improve this answer























          • If what you're say is true, then why would the DTD file not be found within the same directory as the XML file? I have everything placed together and am simply trying to open the file in Chrome. Also, The reason line 53 shows up is because the DOCTYPE has some internal declarations that I excluded.
            – Pori
            Jan 13 '13 at 2:00












          • In that case, I may have misunderstood the error message. I'll add an update.
            – arayq2
            Jan 13 '13 at 2:07










          • Isn't Chrome's XML support quite limited? If you put the entire internal subset in another dtd file and just have <!DOCTYPE customers SYSTEM "external.dtd">, you may find out whether external entities are supported.
            – arayq2
            Jan 13 '13 at 2:14












          • It seems to work fine on Firefox. However, Firefox can't seem to import the codes I saved in the DTD.
            – Pori
            Jan 14 '13 at 1:32













          up vote
          0
          down vote










          up vote
          0
          down vote









          Why would that be?



          Because it can't find the codes.dtd file. If you aren't using some sort of catalog based resolution mechanism, then the codes.dtd would have to be in the working directory of the program you're running.



          But an error on line 53 seems odd. That's too far into a file for a DTD. What does line 53 look like?



          UPDATE: On reconsideration, the problem may not be that codes.dtd couldn't be found, but that the XML parser being used doesn't process external entities. (After all, it said that the PE reference itself, and not its referent, couldn't be found.) This is a quite common limitation of non-validating parsers, but the error diagnostic could have been more helpful ("Sorry, external entity references are not supported".)






          share|improve this answer














          Why would that be?



          Because it can't find the codes.dtd file. If you aren't using some sort of catalog based resolution mechanism, then the codes.dtd would have to be in the working directory of the program you're running.



          But an error on line 53 seems odd. That's too far into a file for a DTD. What does line 53 look like?



          UPDATE: On reconsideration, the problem may not be that codes.dtd couldn't be found, but that the XML parser being used doesn't process external entities. (After all, it said that the PE reference itself, and not its referent, couldn't be found.) This is a quite common limitation of non-validating parsers, but the error diagnostic could have been more helpful ("Sorry, external entity references are not supported".)







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 13 '13 at 2:13

























          answered Jan 13 '13 at 1:33









          arayq2

          1,903816




          1,903816












          • If what you're say is true, then why would the DTD file not be found within the same directory as the XML file? I have everything placed together and am simply trying to open the file in Chrome. Also, The reason line 53 shows up is because the DOCTYPE has some internal declarations that I excluded.
            – Pori
            Jan 13 '13 at 2:00












          • In that case, I may have misunderstood the error message. I'll add an update.
            – arayq2
            Jan 13 '13 at 2:07










          • Isn't Chrome's XML support quite limited? If you put the entire internal subset in another dtd file and just have <!DOCTYPE customers SYSTEM "external.dtd">, you may find out whether external entities are supported.
            – arayq2
            Jan 13 '13 at 2:14












          • It seems to work fine on Firefox. However, Firefox can't seem to import the codes I saved in the DTD.
            – Pori
            Jan 14 '13 at 1:32


















          • If what you're say is true, then why would the DTD file not be found within the same directory as the XML file? I have everything placed together and am simply trying to open the file in Chrome. Also, The reason line 53 shows up is because the DOCTYPE has some internal declarations that I excluded.
            – Pori
            Jan 13 '13 at 2:00












          • In that case, I may have misunderstood the error message. I'll add an update.
            – arayq2
            Jan 13 '13 at 2:07










          • Isn't Chrome's XML support quite limited? If you put the entire internal subset in another dtd file and just have <!DOCTYPE customers SYSTEM "external.dtd">, you may find out whether external entities are supported.
            – arayq2
            Jan 13 '13 at 2:14












          • It seems to work fine on Firefox. However, Firefox can't seem to import the codes I saved in the DTD.
            – Pori
            Jan 14 '13 at 1:32
















          If what you're say is true, then why would the DTD file not be found within the same directory as the XML file? I have everything placed together and am simply trying to open the file in Chrome. Also, The reason line 53 shows up is because the DOCTYPE has some internal declarations that I excluded.
          – Pori
          Jan 13 '13 at 2:00






          If what you're say is true, then why would the DTD file not be found within the same directory as the XML file? I have everything placed together and am simply trying to open the file in Chrome. Also, The reason line 53 shows up is because the DOCTYPE has some internal declarations that I excluded.
          – Pori
          Jan 13 '13 at 2:00














          In that case, I may have misunderstood the error message. I'll add an update.
          – arayq2
          Jan 13 '13 at 2:07




          In that case, I may have misunderstood the error message. I'll add an update.
          – arayq2
          Jan 13 '13 at 2:07












          Isn't Chrome's XML support quite limited? If you put the entire internal subset in another dtd file and just have <!DOCTYPE customers SYSTEM "external.dtd">, you may find out whether external entities are supported.
          – arayq2
          Jan 13 '13 at 2:14






          Isn't Chrome's XML support quite limited? If you put the entire internal subset in another dtd file and just have <!DOCTYPE customers SYSTEM "external.dtd">, you may find out whether external entities are supported.
          – arayq2
          Jan 13 '13 at 2:14














          It seems to work fine on Firefox. However, Firefox can't seem to import the codes I saved in the DTD.
          – Pori
          Jan 14 '13 at 1:32




          It seems to work fine on Firefox. However, Firefox can't seem to import the codes I saved in the DTD.
          – Pori
          Jan 14 '13 at 1:32


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f14298366%2fpereference-error-with-xml-external-entity-dtd%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Create new schema in PostgreSQL using DBeaver

          Deepest pit of an array with Javascript: test on Codility

          Costa Masnaga