Tag Archives: xml

PHP Submit Wrong codes to XML

i have an xml file (scores.xml) which im using a php codes to add new Tags to it.
i have a tag called Header which contain some html code

<![CDATA[<tr><td colspan='7' id='headertd'>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<img border='0' src='images/euro.png' />
&nbsp;&nbsp;&nbsp;&nbsp;
UEFA Euro 

Continue lendo

Tagged , | Deixe um comentário

Cannot display XML ,error at the end of document

Este é meu código

<?php
$allBots = require_once 'botsPath.php';

$method = $_SERVER['REQUEST_METHOD'];
$request = explode("/", substr(@$_SERVER['PATH_INFO'], 1));
//var_dump($allBots);die;
$botName = array_shift($request);
$res = '';
$botJid = '';
$returnMessageTo = '';
if(isset($allBots[$botName])){
    require_once $allBots[$botName]['path'];
    $botObject = new $allBots[$botName]['class'];
    $botJid = $allBots[$botName]['jid'];
    

Continue lendo

Tagged , , | Deixe um comentário

XML get value php

I have this link: http://www.geomojo.org/cgi-bin/reversegeocoder.cgi?long=9.013185&lat=46.189539
and i would like to get woeid with php.
Obrigado!!… Continue lendo

Tagged , , , , | Deixe um comentário

Remove text outside xml tags – PHP

Some times I receive text outside the xml tags in XML like this:

Bad command error. XYZ. Some more text<?xml version="1.0" encoding="utf-8"?><xml></xml>

This returns error in php. Because I am using this function to read the xml:

simplexml_load_string($xml);

Existe Continue lendo

Tagged , , | Deixe um comentário

Curl e htmlentities tirando tags XML

So i’m working on a php script which passes information to a server using Curl and the POST method and then takes back information from that server in the form of XML.I then want to take this information and parseContinue lendo

Tagged , , , | Deixe um comentário

Iphone XML data accentuation?

I’m developing a project which fetch data from a php file(como XML).To be more clearly the app works like this:
1-Send an HTTP Request to a PHP file,which select data from a mysql database and display it as XML,usando o… Continue lendo

Tagged , , , , | Deixe um comentário

Convert XML file to CSV with Header in PHP

Need help to convert this xml file to csv….

<DATA>
  <CONTENT data="123456" data1="0"/>
  <CONTENT data="123456" data1="1"/>
  <CONTENT data="123456" data1="0"/>
</DATA>

The structure of csv:

data,data1
123456,0
123456,1
123456,0

Continue lendo

Tagged , , , , | Deixe um comentário

quickly extract the contents of an xml tag in php

Scribd’s API returns XML, por exemplo:

<?xml version="1.0" encoding="UTF-8"?><rsp stat="ok"><thumbnail_url>http://imgv2-4.scribdassets.com/img/word_document/60906103/111x142/79c5e6bab7/1327030759</thumbnail_url></rsp>

is there a way to quickly, say in one or two lines, get the contents of thumbnail_url, que é http://imgv2-4.scribdassets.com/img/word_document/60906103/111x142/79c5e6bab7/1327030759…? Continue lendo

Tagged , , | Deixe um comentário

Accessing tags inside CDATA in XML using PHP

I am confused. How can I access tags inside CDATA?
XML Code:

<body>
<block>
<![CDATA[
     <font color="#FFCC53" size="+6"><b>Latest News Updates</b></font>
     <font color="#AAAAAA">HTML Formatted Text Fields</font>
]]>
</block>
</body>

Código PHP:

<?php
     $xml = simplexml_load_file("main.xml");
     print (  $xml->smallTextList[0]->item[0]->textBody[0]->font[0] ) ;
?>

Continue lendo

Tagged , , | Deixe um comentário

Get value XML with php [fechado]

Duplicate possível:

SimpleXML parse Child of a Child
I would like to get the woeid in PHP from this xml.

<place>
<woeid>12892767</woeid>
<name>6500</name>
<type>Postal Code</type>
</place>

Obrigado! Continue lendo

Tagged , , , | Deixe um comentário
31 páginas