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

  • Home
  • SEARCH
  • 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 687807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:09:54+00:00 2026-05-14T02:09:54+00:00

I am trying to load a xml document I created using PHP and DOM

  • 0

I am trying to load a xml document I created using PHP and DOM into a xslt sheet, but having no luck.

$xml_string = $doc->saveXML();
//echo $xml_string;

$xml = new DOMDocument;
$xml->load($xml_string);

$xsl = new DOMDocument;
$xsl->load('musicInformation.xslt');

// Configure the transformer
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl); // attach the xsl rules

echo $proc->transformToXML($xml);

I created a xml file based off some data extracted from a database and instead of saving it as an actual document I saved it as a string, I put the string into the xslt sheet and this error occurred

Warning: I/O warning : failed to load
external entity Warning: xpath.c:11079
Internal error: document without root
in
/home/dd615/public_html/webservice.php
on line 73

Any help would be much appreciated.

  • 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-05-14T02:09:55+00:00Added an answer on May 14, 2026 at 2:09 am

    A string is not XML.

    Valid XML needs a root element (that is, a single element that wraps all other elements in the document, apart from the XML declaration).

    Such as this:

    <?xml version="1.0" ?>
    <root>
      <element></element>
      <element></element>
      ...
    </root>
    

    If you have multiple such roots, the XML is not valid and will fail to load.

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

Sidebar

Related Questions

I'm trying to load some xml and xslt stuff into this following html file:
I'm trying to get a list of elements out of an XML document where
I am trying to add a comment to an existing XML document. The document,
I'm trying to retrieve N number of items from an XML file using simpleXML
I am trying to connect to the SalesForce.com bulk API so I can do
I have created a basic project in to which i have added a really
What I'm trying to do here is see whether the element exists in the
I get a NullReferenceException when trying to append element to its parent to element,
I'm having what must be a VERY SILLY issue with the Data Contract Serializer.
Hi I’m trying to use a DataGridView for the first time and with LINQ.

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.