Jump to content

Search the Community

Showing results for tags 'xml namespaces'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hello, I am going crazy trying to get the element values from XML file which contains elements with namespaces. Here is the XML file (test.xml) <?xml version = "1.0" encoding = "UTF-8"?> <ipdr:IPDRDoc xmlns:ipdr="http://www.ipdr.org/namespaces/ipdr" xmlns="urn:broadband-forum-org:ipdr:tr-232-1-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:broadband-forum-org:ipdr:tr-232-1-0 tr-232-1-0-0-serviceSpec.xsd http://www.ipdr.org/namespaces/ipdr http://www.ipdr.org/public/IPDRDoc3.5.1.xsd" docId="74697373-6f74-7878-7878-746973736f74" creationTime="2013-06-11T05:52:55.153Z" IPDRRecorderInfo="IPDR Collector" version="3.5.1"> <ipdr:IPDR xsi:type="BulkDataReport"> <OUI>124BEB</OUI> <ProductClass>BGW</ProductClass> <SerialNumber>1234567890</SerialNumber> <Suspect>1</Suspect> <BulkData> <Name>InternetGatewayDevice.DeviceInfo.UpTime</Name> <Value>1449</Value> </BulkData> <BulkData> <Name>InternetGatewayDevice.ManagementServer.URL</Name> <Value>www.somesite.com</Value> </BulkData> </ipdr:IPDR > <ipdr:IPDRDoc.End count="1" endTime="2013-06-11T05:52:55.207Z"></ipdr:IPDRDoc.End> </ipdr:IPDRDoc> I am trying to get element values for BulkData Here is the code I am using and having problem with: $cpe = simplexml_load_file('test.xml'); $sxe=new SimpleXMLElement($cpe); $sxe->registerXPathNamespace('ipdr','http://www.ipdr.org/namespaces/ipdr'); $result0=$sxe->xpath('ipdr:IPDR->BulkData[0]')->Value; $result1=$sxe->xpath('ipdr:IPDR->BulkData[1]')->Value; echo $result0 ' <br> ' $result1; The result I am looking for should be : 1449 www.somesite.com Thanks for any help you can offer.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.