Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7957113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:11:58+00:00 2026-06-04T04:11:58+00:00

I have an xml file with a header like the following: <!ENTITY nbsp &#160;><!–

  • 0

I have an xml file with a header like the following:

<!ENTITY nbsp   "&#160;"><!-- no-break space = non-breaking space,
                                   U+00A0 ISOnum -->
 <!ENTITY iexcl  "&#161;"><!-- inverted exclamation mark, U+00A1 ISOnum -->
 <!ENTITY cent   "&#162;"><!-- cent sign, U+00A2 ISOnum -->
 <!ENTITY pound  "&#163;"><!-- pound sign, U+00A3 ISOnum -->
 <!ENTITY curren "&#164;"><!-- currency sign, U+00A4 ISOnum -->
 <!ENTITY yen    "&#165;"><!-- yen sign = yuan sign, U+00A5 ISOnum -->
 <!ENTITY brvbar "&#166;"><!-- broken bar = broken vertical bar,
                                   U+00A6 ISOnum -->
 <!ENTITY sect   "&#167;"><!-- section sign, U+00A7 ISOnum -->
 <!ENTITY uml    "&#168;"><!-- diaeresis = spacing diaeresis,
                                   U+00A8 ISOdia -->
 <!ENTITY copy   "&#169;"><!-- copyright sign, U+00A9 ISOnum -->
 <!ENTITY ordf   "&#170;"><!-- feminine ordinal indicator, U+00AA ISOnum -->
 <!ENTITY laquo  "&#171;"><!-- left-pointing double angle quotation mark
                                   = left pointing guillemet, U+00AB ISOnum -->
 <!ENTITY not    "&#172;"><!-- not sign, U+00AC ISOnum -->
 <!ENTITY shy    "&#173;"><!-- soft hyphen = discretionary hyphen,
                                   U+00AD ISOnum -->
 <!ENTITY reg    "&#174;"><!-- registered sign = registered trade mark sign,
                                   U+00AE ISOnum -->
 <!ENTITY macr   "&#175;"><!-- macron = spacing macron = overline
                                   = APL overbar, U+00AF ISOdia -->
 <!ENTITY deg    "&#176;"><!-- degree sign, U+00B0 ISOnum -->
 <!ENTITY plusmn "&#177;"><!-- plus-minus sign = plus-or-minus sign,
                                   U+00B1 ISOnum -->

When I try to load it into a dom document, it doesn’t seem to save it to file. I think the above code may be causing parsing erros. Is there a way to remove these headers?

This is my php code:

$xml = curl_exec($ch);
$srcDom = new DOMDocument;
$srcDom->load($xml);
$xPath = new DOMXPath($srcDom);
foreach ($srcDom->getElementsByTagName('Venue') as $venue) {
    $dstDom = new DOMDocument('1.0', 'utf-8');
    $dstDom->appendChild($dstDom->createElement('EventsPricePoints'));
    $dstDom->documentElement->appendChild($dstDom->importNode($venue, true));

    $allEventsForVenue = $xPath->query(
        sprintf(
            '/Store/EventsPricePoints/Event[VenueID/@ID=%d]',
            $venue->getAttribute('ID')
        )
    );

    foreach ($allEventsForVenue as $event) {
        $dstDom->documentElement->appendChild($dstDom->importNode($event, true));
    }

    $dstDom->formatOutput = true;
    $dstDom->saveXml(sprintf('/var/www/html/venuexml/%d.xml', $venue->getAttribute('ID')));
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:11:59+00:00Added an answer on June 4, 2026 at 4:11 am

    Your code is not causing parsing errors (most likely not, if you enable error logging or reporting, you might have seen a warning, but I don’t think it’s the case).

    Instead, your code loads and as XML per default is UTF-8 encoded, all those entities you use do not have to be transported as the XML can contain the characters of those entities without the need of these.

    Therefore both the definition as well as the entities itself inside the XML are superfluous. I guess DOMDocument will just remove those.

    Additionally if you would have given an example XML chunk for testing purposes, you would have gotten a more concrete answer for your clarification needs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a XML template file like so <?xml version=1.0 encoding=us-ascii?> <AutomatedDispenseResponse> <header shipmentNumber=></header>
I have an XML file like the following : <?xml version=1.0 encoding=ISO-8859-1 ?> <mylist
I have a .out file which has xml content like this. <header stub> <article
I have a XML structure like the following: <Root> <Node Name=File System> <Node Name=C:\Windows\System32\drivers\etc\hosts>
I have a xml file roughly like this: <batch> <header> <headerStuff /> </header> <contents>
I have an XML Template file. This file contains a header and some predefined
I have a XML file with the following data format: <net NetName=abc attr1=123 attr2=234
I have an XML file that looks like <?xml version='1.0' encoding='UTF-8'?> <root> <node name=foo1
I have an xml file that looks like this; <Employee> <EmployeeName>Burt Reynolds</EmployeeName> <EmployeeTitle>Bad Ass</EmployeeTitle>
I have an xml file like this. On vertical orietation everything is looking perfect.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.