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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:54:03+00:00 2026-05-10T15:54:03+00:00

I have the following XML structure: <?xml version=1.0 ?> <course xml:lang=nl> <body> <item id=787900813228567

  • 0

I have the following XML structure:

<?xml version='1.0' ?> <course xml:lang='nl'>   <body>     <item id='787900813228567' view='12000' title='0x|Beschrijving' engtitle='0x|Description'><![CDATA[Dit college leert studenten hoe ze een onderzoek kunn$     <item id='5453116633894965' view='12000' title='0x|Onderwijsvorm' engtitle='0x|Method of instruction'><![CDATA[instructiecollege]]></item>     <item id='7433550075448316' view='12000' title='0x|Toetsing' engtitle='0x|Examination'><![CDATA[Opdrachten/werkstuk]]></item>     <item id='015071401858970545' view='12000' title='0x|Literatuur' engtitle='0x|Required reading'><![CDATA[Wayne C. Booth, Gregory G. Colomb, Joseph M. Wi$     <item id='5960589172957031' view='12000' title='0x|Uitbreiding' engtitle='0x|Expansion'><![CDATA[]]></item>     <item id='3610066867901779' view='12000' title='0x|Aansluiting' engtitle='0x|Place in study program'><![CDATA[]]></item>     <item id='19232369892482925' view='12000' title='0x|Toegangseisen' engtitle='0x|Course requirements'><![CDATA[]]></item>     <item id='3332396346891524' view='12000' title='0x|Doelgroep' engtitle='0x|Target audience'><![CDATA[]]></item>     <item id='6606851872934866' view='12000' title='0x|Aanmelden bij' engtitle='0x|Enrollment at'><![CDATA[]]></item>     <item id='1478643580820973' view='12000' title='0x|Informatie bij' engtitle='0x|Information at'><![CDATA[Docent]]></item>     <item id='9710608434763993' view='12000' title='0x|Rooster' engtitle='0x|Schedule'><![CDATA[1e semester, maandag 15.00-17.00, zaal 1175/030]]></item>   </body> </course> 

I want to get the data from one of the item tags. To get to this tag, I use the following xpath:

$description = $xml->xpath('//item[@title='0x|Beschrijving']'); 

This does indeed return an array in the form of:

Array (     [0] => SimpleXMLElement Object         (             [@attributes] => Array                 (                     [id] => 787900813228567                     [view] => 12000                     [title] => 0x|Beschrijving                     [engtitle] => 0x|Description                 )         ) ) 

But where is the actual information (that is stored between the item tags) located? I must be doing something wrong, but I can’t figure out what that might be… Probably something really simple… Help would be 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. 2026-05-10T15:54:04+00:00Added an answer on May 10, 2026 at 3:54 pm

    When you load the XML file, you’ll need to handle the CDATA.. This example works:

    <?php $xml = simplexml_load_file('file.xml', NULL, LIBXML_NOCDATA); $description = $xml->xpath('//item[@title='0x|Beschrijving']'); var_dump($description); ?> 

    Here’s the output:

    array(1) {   [0]=>   object(SimpleXMLElement)#2 (2) {     ['@attributes']=>     array(4) {       ['id']=>       string(15) '787900813228567'       ['view']=>       string(5) '12000'       ['title']=>       string(15) '0x|Beschrijving'       ['engtitle']=>       string(14) '0x|Description'     }     [0]=>     string(41) 'Dit college leert studenten hoe ze een on'   } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 66k
  • Answers 66k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer It's not handled at all: rsync opens the file, reads… May 11, 2026 at 11:26 am
  • added an answer A common mistake. unary_function and binary_function are just two structs… May 11, 2026 at 11:26 am
  • added an answer Not that I'm aware of - but one thing you… May 11, 2026 at 11:26 am

Related Questions

I have the following XML structure: <?xml version=1.0 ?> <course xml:lang=nl> <body> <item id=787900813228567
I have the following sample XML structure: <SavingAccounts> <SavingAccount> <ServiceOnline>yes</ServiceOnline> <ServiceViaPhone>no</ServiceViaPhone> </SavingAccount> <SavingAccount> <ServiceOnline>no</ServiceOnline>
I have a huge bunch of XML files with the following structure: <Stuff1> <Content>someContent</name>
If i have the following directory structure: Project1/bin/debug Project2/xml/file.xml I am trying to refer
I have the following xml I'd like to deserialize into a class <?xml version=1.0
I have the following XML document: <projects> <project> <name>Shockwave</name> <language>Ruby</language> <owner>Brian May</owner> <state>New</state> <startDate>31/10/2008
I have the following xml that's sent to me from a web service. I'm
Is it possible to merge elements using XSLT. If I have the following XML
I basically have the following flow: XML -> JSON -> Spring MVC -> jsp
I have the following Python code: import xml.dom.minidom import xml.parsers.expat try: domTree = ml.dom.minidom.parse(myXMLFileName)

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.