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

The Archive Base Latest Questions

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

I have the following XML code that I’m trying to parse, but I’m sure

  • 0

I have the following XML code that I’m trying to parse, but I’m sure of how to traverse some of the data in PHP:

  <entry>
    <id>http://data.treasury.gov:8001/Feed.svc/DailyTreasuryYieldCurveRateData(5360)</id>
    <title type="text"></title>
    <updated>2011-06-09T20:15:18Z</updated>
    <author>
      <name />
    </author>
    <link rel="edit" title="DailyTreasuryYieldCurveRateDatum" href="DailyTreasuryYieldCurveRateData(5360)" />
    <category term="TreasuryDataWarehouseModel.DailyTreasuryYieldCurveRateDatum" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <content type="application/xml">
      <m:properties>
        <d:Id m:type="Edm.Int32">5360</d:Id>
        <d:NEW_DATE m:type="Edm.DateTime">2011-06-01T00:00:00</d:NEW_DATE>
        <d:BC_1MONTH m:type="Edm.Double">0.04</d:BC_1MONTH>
        <d:BC_3MONTH m:type="Edm.Double">0.05</d:BC_3MONTH>
        <d:BC_6MONTH m:type="Edm.Double">0.11</d:BC_6MONTH>
        <d:BC_1YEAR m:type="Edm.Double">0.18</d:BC_1YEAR>
        <d:BC_2YEAR m:type="Edm.Double">0.44</d:BC_2YEAR>
        <d:BC_3YEAR m:type="Edm.Double">0.74</d:BC_3YEAR>
        <d:BC_5YEAR m:type="Edm.Double">1.6</d:BC_5YEAR>
        <d:BC_7YEAR m:type="Edm.Double">2.28</d:BC_7YEAR>
        <d:BC_10YEAR m:type="Edm.Double">2.96</d:BC_10YEAR>
        <d:BC_20YEAR m:type="Edm.Double">3.83</d:BC_20YEAR>
        <d:BC_30YEAR m:type="Edm.Double">4.15</d:BC_30YEAR>
        <d:BC_30YEARDISPLAY m:type="Edm.Double">4.15</d:BC_30YEARDISPLAY>
      </m:properties>
    </content>
  </entry>

I can only get so far as

entry->content

As the following throws an error for having a colon:

entry->content->m:properties 

How do I access what’s inside content such as d:NEW_DATE?

  • 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-23T01:13:20+00:00Added an answer on May 23, 2026 at 1:13 am

    In SimpleXML you can use the children(‘prefix’, true) and attributes(‘prefix’, true) functions to access namespaced content.

    entry->content->children('m', true)->properties
    

    or to access d:NEW_DATE

    entry->content->children('m', true)->properties->children('d', true)->NEW_DATE
    

    or one step further to access the m:type attribute

    entry->content->children('m', true)->properties->children('d', true)->NEW_DATE->attributes('m', true)->type
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code that is using the following xml file. Can someone tell
I have the following Python code: import xml.dom.minidom import xml.parsers.expat try: domTree = ml.dom.minidom.parse(myXMLFileName)
I have an application web.xml with the following entry: <error-page> <error-code>404</error-code> <location>/system_files/error/p_notfound.jsp</location> </error-page> However,
I have the following XML Parsing code in my application: public static XElement Parse(string
I have the following XML document that I have to parse using python's minidom:
I have the following XML structure, and I would like to have code that:
I have the following AJAX and XML code. You can see the values that
I have the following code that creates an xml doc self.errorlist.append( '<testcase classname=%(cls)s name=%(name)s
I have the following xml that's sent to me from a web service. I'm
If i have the following directory structure: Project1/bin/debug Project2/xml/file.xml I am trying to refer

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.