12

Simple XML - Processing columns in nodes

 4 years ago
source link: https://www.codesd.com/item/simple-xml-processing-columns-in-nodes.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Simple XML - Processing columns in nodes

advertisements

I'm trying to read an RSS feed from Flickr but it has some nodes which are not readable by Simple XML (media:thumbnail, flickr:profile, and so on).

How do I get round this? My head hurts when I look at the documentation for the DOM. So I'd like to avoid it as I don't want to learn.

I'm trying to get the thumbnail by the way.


The solution is explained in this nice article. You need the children() method for accessing XML elements which contain a namespace. This code snippet is quoted from the article:

$feed = simplexml_load_file('http://www.sitepoint.com/recent.rdf');
foreach ($feed->item as $item) {
    $ns_dc = $item->children('http://purl.org/dc/elements/1.1/');
    echo $ns_dc->date;
}

Related Articles

PHP - Duplicate an XML node using Simple XML

I need to load an XML source using Simple XML, duplicate an existing node with all his children, then customize an attribute of this new node before rendering XML. Any suggestion?SimpleXML can't do this, so you'll have to use DOM. The good news is th

Selecting attributes as rows from the xml data column

I have an xml column with simple xml like <Data att1="test1" att123="test123" /> I need them in a form like this: IdRow attributeName attributeValue 1 att1 test1 1 att123 test123 Tried with both node and query functions but it wo

Retrieving data from xml sql column

I have a table with an xml type column (column name is Before) here is a sample of the data <row ID="47" By="Test User" Date="2006-07-26T00:00:00" Status="Closed" Closed_Date="2012-06-22T11:14:35.237" C

Simple XML parser in bison / flex

I would like to create simple xml parser using bison/flex. I don't need validation, comments, arguments, only <tag>value</tag>, where value can be number, string or other <tag>value</tag>. So for example: <div> <mul> &l

Simple XML framework - strange error

Im using the Simple XML Framework within a Jersey REST Application and I am getting suddenly a lot of weird exceptions: at org.simpleframework.xml.stream.PrefixResolver.getPrefix(PrefixResolver.java:123) at org.simpleframework.xml.stream.PrefixResolv

Application of the Muenchian grouping for a simple XML with XSLT

How does Muenchian grouping work in details? I have a simple XML document generated from a database: <CLIENTS> <CLIENT> <NAME>John</NAME> <ACCOUNT_NUMBER>1424763562761</ACCOUNT_NUMBER> <LAST_USED>2012-10-03</LA

Obtain an XML top-level attribute, node values, and a file name from a database R.

I have been fighting with this for quite a long time and cannot get it to work, so I am posting here. I'm not an advanced R user, but I'm learning and slowly getting onward. I have not found an example from Stackoverflow that I could adapt to this, t

Returning an old simple XML with WCF

How can this be so difficult and why? Returning simple XML with no Name Spaces and an XML decaration. Creating the XML using XML Writer is easily done and if I output it to a file then great. How on earth can you return the contents via WCF. Using an

Studio Android - Importing the Simple-Xml Library

I am going crazy with my Android Studio IDE. I am willing to add the Maven library simple-xml from Central (v2.7.1) The project compiles well Gradle has the lib dependency in its build.gradle: dependencies { compile 'com.android.support:appcompat-v7:

How to delete an element from an XML tree where the attribute is a specific string in Simple XML PHP

So I want to delete a child from an XML string where an attribute is a specific value. For Example: <xml> <note url="http://google.com"> Values </note> <note url="http://yahoo.com"> Yahoo Values </note> &l

ORA-19202: An error occurred in XML processing LPX-00210: expected '& lt;' instead of 'M' Error at line 1

I had this query working properly for years until recently where i changed another query in the collector and saved. I didnt change this xml query at all, but now its failing on the xml part. Im and definitely not versed well in xml so im looking for

XML processing in Python

I am about to build a piece of a project that will need to construct and post an XML document to a web service and I'd like to do it in Python, as a means to expand my skills in it. Unfortunately, whilst I know the XML model fairly well in .NET, I'm

Simple XML Framework Parser Issue - XML ​​Analysis in Android

I'm having a problem with parsing XML in Android app, a question here implies that there are 4 types of XML parsing mechanism advised: - SAX - DOM - XmlPullParser - Simple XML Framework While Simple Framework is amazing and I was already working with

Linq to Xml analysis with attribute nodes

I am having xml with following structure <ruleDefinition appId="3" customerId = "acf"> <node alias="element1" id="1" name="department"> <node alias="element2" id="101" na

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK