SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast JoeRags's Avatar
    Join Date
    Jan 2004
    Location
    Delete Account
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP 5 DOM module cannot load XML documents containing DTD

    Using the following files I get the following errors "Entity 'test1' not defined in..." and "Entity 'test2' not defined in...".

    test.php

    PHP Code:
    <?php
    DomDocument
    ::load('/Users/josephragsdale/Sites/joerags/development/test.xml');
    ?>
    test.xml

    Code:
    <?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
    <!DOCTYPE test SYSTEM "/Users/josephragsdale/Sites/joerags/development/test.dtd">
    <test>
      <example>&test1; &test2;</example>
    </test>
    test.dtd

    Code:
    <!DOCTYPE test [
    <!ENTITY test1 "Test 1">
    <!ENTITY test2 "Test 2">
    
    <!ELEMENT test (example)>
    <!ELEMENT example (#PCDATA)>
    ]>
    I've researched a bit with Google and stumbled across bug 17779 and bug 17390 at bugs.php.net which might be somewhat related to my problem but I'm unsure. From what I can tell the above should work.

    I'm using Apache 1.3.31, PHP 5 RC3, libxml2 2.6.9, and libxslt 1.1.7.
    Last edited by JoeRags; Jun 15, 2004 at 00:26.

  2. #2
    SitePoint Enthusiast JoeRags's Avatar
    Join Date
    Jan 2004
    Location
    Delete Account
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know PHP 5 isn't used by many yet but if someone could at least inform me whether or not the above 3 files are valid, I'd appreciate it.

  3. #3
    Resident OCD goofball! bronze trophy Serenarules's Avatar
    Join Date
    Dec 2002
    Posts
    1,911
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    Try removing the following from the dtd:

    <!DOCTYPE test [

    and

    ]>

    If I recall, those are only for inline doctypes, where it's defined IN the xml doc itself. None of the w3c dtd's I've looked at have that.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •