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 3349100
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:37:23+00:00 2026-05-18T01:37:23+00:00

Now, thanks to community, one problem was fixed ( Delete all elements of a

  • 0

Now, thanks to community, one problem was fixed ( Delete all elements of a certain type from an XML doc using PHP ). Now I luckily hit other 🙂

So, I have XML file:

<piletilve_info>
   <shows>
      <show>
        <description>
          <lat>
        <![CDATA[ 
LA CENERENTOLA  <BR><BR>

("Cinderella")<BR><BR>

Opera buffo by Gioachino Rossini<BR><BR>


Music Director and Conductor: Arvo Volmer<BR>
Stage Director and Set Designer: Michiel Dijkema (Amsterdam)<BR>
Costumes: Claudia Damm (Berlin)<BR><BR>



Premiere on November 10, 2006<BR>
Approx running time: 3 h 20 min<BR>
Sung in Italian with subtitles in Estonian and English<BR><BR>

Who hasn’t heard the fairy-tale of Cinderella who crouched in the ashes, danced to the tune of her step-sisters but finally found the man of her dreams and a happy life. Why should this fairy-tale be told today?<BR>
An exciting and unexpected solution of the story of Cinderella with striking scenery and fantastic-modern costumes is presented by the Dutch stage director Michiel Dijkema and the German designer Claudia Damm.<BR>
In this story, an unhappy soul dreams of a prince on a white horse and of a better life, and women following the last trends chase the prince, and a man who considers himself very wise, is only interested in himself.<BR>
"Cinderella" is not just a fairy-tale, it includes reality as well as dreams, a lot of fantasies, comedy and grotesque. And all of this is expressed by the brilliant and virtuous music of Rossini!<BR>

  ]]> 
          </lat>
        </description>
      </show>
   </shows>
   <other node>
      ...
   </other node>
</piletilve_info>

I navigate to my needed node using this code:

$books = $xpath->query('shows/show/description');
        foreach($books as $description)
        {
            $description->removeChild($eng_lang);
            $lat_lang = $description->getElementsByTagName('lat')->item(0);
            }

I want to output modified $lat_lang elements , which is <[[CDATA ]]> parent, content using this mixed function:

$lat_lang->nodeValue = mb_convert_encoding(print_r(strip_tags_only($lat_lang->item(0)->nodeValue, TRUE),'<html><head><body>'), 'UTF-8' ,$encoding);

, but I fail and when I execute script on apache server, I get this error:

The XML page cannot be displayed
Cannot view XML input using XSL style
sheet. Please correct the error and
then click the Refresh button, or try
again later.


Only one top level element is allowed
in an XML document. Error processing
resource
‘http://www.bilesuserviss.lv/lv_filtrs_…

Catchable fatal error: Object
of class DOMElement could not be
converted to string in /var/www/…

Could you help me finding solution?

Maybe the fact I do develop on delphi makes me this whole PHP<->XML coding more difficult that for normal people would .. 🙁

  • 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-18T01:37:24+00:00Added an answer on May 18, 2026 at 1:37 am

    It was spelling problem.
    Function name was strip_only_tags(), but I called it with strip_tags_only();

    I am working on delphi and php<>xml project whole day .. Kinda feel tired already 🙁
    Sorry all.

    Also thansk to Gordon for commept. Kinda woke me up 😀

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

Sidebar

Related Questions

Now that I can make useful user controls in WPF (thanks to this stackoverflow
Thanks for a solution in C , now I would like to achieve this
I've been a fan of EasyMock for many years now, and thanks to SO
now i need to insert some data from the sqlserver into a word,i know
Now, before you say it: I did Google and my hbm.xml file is an
I now have it set up so that when people go to a thank
Now that most of the major browsers support full page zoom (at present, the
Now that I know C++ I want to get into desktop application that have
Now that LINQ to SQL is a little more mature, I'd like to know
Now that .NET v3.5 SP1 has been released (along with VS2008 SP1), we now

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.