Professional Web Applications Themes

entities in xml file - PHP Development

Hello all, I'm using the xml pr functions of php based on the expat extention. When an entity i.e. & is encountered the pr stops but it doesn't give me an error. How do I catch an entity in my xml file? If it is possible can you give me an example? thanks in advance Rob....

  1. #1

    Default entities in xml file

    Hello all,

    I'm using the xml pr functions of php based on the expat extention. When
    an entity i.e. & is encountered the pr stops but it doesn't give me
    an error. How do I catch an entity in my xml file?

    If it is possible can you give me an example?

    thanks in advance Rob.


    somebody Guest

  2. #2

    Default Re: entities in xml file

    somebody wrote: 

    The & entity is completely valid in XML and shouldn't stop processing.
    Check your error logs or enable the display_errors directive in your php.ini
    file to see what the real problem is.


    JW



    Janwillem Guest

  3. #3

    Default Re: entities in xml file

    Ok, wrong example. I used the & because it is a well known entity.
    But I ment any entity. How do I catch these ?

    Rob


    "Janwillem Borleffs" <com> schreef in bericht
    news:42d830f9$0$21829$euronet.nl... 
    >
    > The &amp; entity is completely valid in XML and shouldn't stop processing.
    > Check your error logs or enable the display_errors directive in your
    > php.ini file to see what the real problem is.
    >
    >
    > JW
    >
    >
    >[/ref]


    Rob Guest

  4. #4

    Default Re: entities in xml file



    somebody wrote: 

    May not be the same problem, but there was a bug in an older version of
    PHP that really messed up the entities.

    So.. Just a guess, but make sure that you have the newest version of
    PHP.

    www.douglassdavis.com Guest

  5. #5

    Default Re: entities in xml file

    Rob wrote: 

    Either by using a DTD (see: http://www.w3schools.com/dtd/dtd_entities.asp)
    or by replacing entities prior to processing.

    Example (Note: replaces more entities then required):

    $trans = array_flip(get_html_translation_table(HTML_ENTITIE S));
    array_walk($trans, create_function('&$a','$a = "&#" . ord($a) . ";";'));

    $xml_source_as_string = str_replace(
    $trans,
    $xml_source_as_string
    );


    JW



    Janwillem Guest

Similar Threads

  1. HTML entities: alternatives?
    By sredniVashtar in forum Coldfusion Database Access
    Replies: 2
    Last Post: July 13th, 06:19 PM
  2. REXML - external entities
    By Tobias in forum Ruby
    Replies: 0
    Last Post: September 4th, 11:07 AM
  3. Decoding HTML entities
    By Anuj in forum ASP
    Replies: 1
    Last Post: July 24th, 10:16 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139