Jump to content

Search the Community

Showing results for tags 'xml'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • 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


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

  1. Hi Gang, New forum user here... I'm using a wordpress build which has broken and I'm getting an error log of "String could not be parsed as XML" on the twitter.php doc that comes with the theme. Here is the error log: And here is the code section in question: The "$xml = new SimpleXMLElement($data);" line is line 86 referenced in the error log. I don't care about having twitter embedded on my site, so disabling anything is fine, but I need help! Thanks! Greg
  2. Can anyone give me an idea on how I will count the table column and table row and get the id, attribute and the content of a each cell (the cell is contenteditable). What tools i have to use. e.g. <table id='sheet'> <tbody> <tr> <td id='1A' rowspan=2>Rowspan 2</td> <td id='1B'>22222</td> <td id='1C'>33333</td> </tr> <tr> <td id='2B' colspan='2'> Colspan2</td> </tr> <tr> <td id='3A' style='color:red'>Whaterver</td> <td id='3B' style='font-weight:bold'>Askyourmother</td> <td id='3C'>sigh</td> </tr> </tbody> </table> I'm using PHP and Jquery(Javascript). Thanks. .
  3. Hi I have this document <?xml version="1.0" encoding="UTF-8"?> <users> <user><name>Skuilnaam</name><score>8</score></user><user><name>Skuilnaam1</name><score>10</score></user><user><name>cobus</name><score>5</score></user></users> I need help to make a php script that will delete the records inside this page for me can anyone help me to construct such a page please?
  4. I have a table that has a row and column with different style and colspan etc. Does anyone know how to convert it HTML to XML file with the designated style Using PHP. Cause I going to convert it the xml to xls also. <table> <tbody> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> </tr> <tr> <td>1</td> <td>2</td> <td colspan='2'>34</td> <td>5</td> </tr> <tr> <td stye='font-weight:bold'>BOLD</td> <td stye='font-style:underline'>underline</td> <td stye='font-stye:arial'>Italic</td> <td stye='font-familty:aria'>Arial</td> <td stye='background-color:Blue'>Arial</td> </tr> </tbody> </table>
  5. This is an example of my code: $status = $entry->title; echo substr(strstr($status," "), 1) . substr($status, 0, -18); Below is the outcome: I'm feeling cold in this room. #emotionalclothingPants: I'm feeling cold in this room. I want the oucome to look like this: I'm feeling cold in this room. Thus removing the "#emotionalclothing" part of the string How can this be achieved? Thanks Stuart
  6. I am trying to include the latest post from a tumblr blog in my website, which works fine. I can't figure out how to choose a specific size of photo from the API, such as the 500px photo. <?php $numPosts = 3; $feedURL = "http://jeffhui.tumblr.com/api/read/?num=$numPosts"; $xml = simplexml_load_file($feedURL); foreach($xml->posts->post as $post){ $title = (string) $post->{'regular-title'}; $posts = (string) $post->{'regular-body'}; $photo = (string) $post->{'photo-url'}; $caption = (string) $post->{'photo-caption'}; echo"<h2>".$title."</h2> <p>".$posts."</p> <p><img src=".$photo."></p> <p>".$caption."</p>"; } ?> Some one posted this online and say it has to loop through them like this, but I dont know how to apply the bellow script into my. <?php $xmlResult = file_get_contents($tumblr_url_aktuell); $xml = simplexml_load_file($tumblr_url_aktuell); foreach($xml->posts->post->{'photo-url'} as $photoURL){ if((string)$photoURL['max-width'] == '500'){ $image = $photoURL; } } ?>
  7. Hello! I was wondering if anyone can help me with attempting to load information on the following XML feed: http://www.tfl.gov.uk/tfl/syndication/feeds/cycle-hire/livecyclehireupdates.xml Into PHP. I only need information displayed for station ids 51,123 and 344. Any advice or help would be much appreciated. I've attached the code I've used to load up RSS feeds. I'm using iwebkit to develop an iPhone friendly website. Many thanks rss.php
  8. I am having issue on my PHP photo gallery. The album name is generate by the folder name as below: '. $_GET['album' So what I am trying to do is to show some external xml date in the gallery base on different albums name, I now tested with 3 different albums with the folder name Adriana, Alicia and Eva. Once again the album name is generate by the folder name. $folder_name = $_GET['album']; echo $folder_name; The above code is working to get the title on specific folder name of that album. Next I have a external xml file with different info for each album. Which I would like to show different info for each album. my xml file as below: <?xml version="1.0" encoding="UTF-8"?> <library> <models> <Adriana>This is the model info of Adriana</Adriana> <Alicia>This is the model info of Alicia</Alicia> <Eva>This is the model info of Eva</Eva> </models> </library> I first tested with this code to make sure it can read the "info": <?php $url = 'albums/Adriana/info.xml'; $xml = simplexml_load_file($url); $info=$xml->models->Adriana; echo $info; ?> Above code works fine, but what I really need to do is something like this, and this is the part that I got an error. $info=$xml->models->$folder_name; Please let me know what am i missing on the above line.
  9. First, thanks in advance for any help. Here's my issue. I've read through tons of similar problems here but I don't think I'm understanding this enough to make this work. I have an XML file such as: <unitlist> <unit> <iterator>0</iterator> <route>2</route> <rt_name>'Riverfront Streetcar'</rt_name> <name>457</name> <lat>2956.21014</lat> <lng>-9004.62839</lng> <bearing>2.14501</bearing> <car_type>'RTA Street Cars'</car_type> <speed>16.57122</speed> <GMT>043432</GMT>[/indent] </unit> <unit> <iterator>1</iterator> <route>10</route> <rt_name>'Tchoupitoulas'</rt_name> <name>250</name> <lat>2958.0927</lat> <lng>-9005.28724</lng> <bearing>1.532399</bearing> <car_type>'RTA Buses'</car_type> <speed>0.6904677</speed> <GMT>104620</GMT>[/indent] </unit> </unitlist> What I want to do is, for each <unit>, import all attributes of that unit (iterator,route,rt_name, etc, etc, etc) into my mySQL database. My problem is that, all it's doing is importing the same attributes of the first <unit> the number of times that <unit> exists. In this example, it's importing the same information from the first <unit> twice, as two records/rows. If I had 90 <unit>s, it would import 90 identical records. Here's my code: foreach($unitlist->unit as $unit) { //insert into database mysql_query("INSERT INTO businfo (iterator,route,rt_name,name,lat,lng,bearing,car_type,speed,GMT)VALUES (\"$iterator\",\"$route\", \"$rt_name\", \"$name\", \"$lat\", \"$lng\", \"$bearing\", \"$car_type\", \"$speed\", \"$GMT\")") or die(mysql_error()); } Can anyone explain what I'm doing wrong? Thanks again for the help! - dan -
  10. Hi PHP expert, I am trying to read the post date from my tumblr api with the following code. $date = $xml->posts->post ['date']; echo '<p>'.$date.'</p>'; This is what I get from the above code "Wed, 21 Nov 2012 13:32:00" My question is, are there anyways I can get the date with out the hour, min and seconds? for example "Wed,21 Nov 2012"?
  11. Hi Chaps, I have been given an invalid XML file, which when run through 3rd party software, gives me the line & column numbers of the error. Instead of opening the file and manually searching for the line/column numbers (which can take a whie, as the file is vast!), is there a way to parse the XML file and locate the error, using the line/column numbers? And maybe display/highlight the error in a browser? e.g.: 1: open bad-file.xml 2: read bad-file.xml 3. go-to line 50 4. go-to column 3620 5. open in browser 6. highlight error Cheers S
  12. Hi, Firstly as a disclaimer, I am not requesting any code to be supplied, this is to be used in a University project and I am aware of the relevant regulations and would like to create the code myself, I am only trying to get help pointing me in the right direction. I am using PHP to display the contents of a MySQL database, as part of the product I would like to display the database in a format similar to a directory browser. I am reading in from an XML file of the database which is created using MySQL dump, I would then like to be able to iterate through this and display the Databases and tables in a list almost, but one that is dynamic and possibly interactive to the point of being able to select tables and fields to be able to view in more detail in another part of the program. Is this possible to achieve using PHP or any other languages that can be incorporated into this program. As an example, below is how I would like to display the contents to the user, with the + and - representing the default standard or showing more or less sub content. +ROOT -MySQL -Schema -Table 1 -File 1 +Table 2 +User Table 1 Thanks in advance for any help. Regards, Tom
  13. Hey All, I am using a web service and am getting the response formatted like: http://pastebin.com/raw.php?i=AjDXXf66 e.g. [[["test","test","",""]],[["noun",["test","essai","épreuve","examen","contrôle","analyse","interrogation","épreuve pratique","épreuve de force"],[["test",["test"],,0.23752081],["essai",["test","trial","testing","essay","assay","try"],,0.12913783],["épreuve",["test","proof","trial","examination","print","crucible"],,0.028814545],["examen",["review","examination","test","investigation","inspection","testing"],,0.010767208] ... ... ... To my knowledge it is some kind of expression of a multidimentional array however I've never seen a response like this. Is there a way I can convert this format to clean XML?
  14. 3. Given a function specialSum(x,y,z) that: a. Returns the sum of (x, the absolute value of y, z) e.g. x+|y|+z b. All parameters are optional c. Always returns an integer. What values of x, y, z, and return value are necessary to verify that this function performs as specified in PHP? To start you out specialSum(2+2+2)=>6 and specialSum()=>0 are two of the tests I’m looking for. Are there any differences in Javascript? 5. Identify potential problems and inefficiencies with the following Javascript, explain each problem and how you would fix it. Not all problems are syntactic. <script type="text/javascript"> function newObject(objectName) { ex = "ret = new " + objectName + "();"; eval(ex); return ret; } startUp = newObject('PSUtil'); if ( startUp.message != undefined ) { document.getElementById('startMessage').value = startup.message; } startUp.engine = newObject(startUp.workingClass); startUp.specialElements = givenSelectionFunction(); function wireFunction(elements ) { for ( i=0; i < elements.length ; i ++ ) { el = document.getElementById(elements); for ( i=0; i < startUp.specialElements.elements.ids.length ; i++ ) { if ( elements == startUp.specialElements.elements.ids ) { el.onchange = startUp.specialElements.specialFunction; } } for ( f in funcs ) { el.attachEvent(f,funcs[f]); } } }; wireFunctions ( startUp.engine.veryLargeArrayOfElementIDs); function givenSelectionFunction() { var elementArray = new Array(); working = document.getElementsByTagName('special'); for ( i=0; i<working.length; i++ ) { var myTestFunction = function(el) { if ( /* some complex test of el that must be in a function */) { return true; } else { return false; } }; if (myTestFunction([working) ) { elementArray.push(working); } } return
  15. I'm having a problem putting together a XML file with the right format required by the webservice I want to use. I'm using the nusoap class to do it. The error I'm getting: Array ( [Reservation_Data] => Array ( [Reservation_Value] => 0 [status] => ERROR_Create_Internacional_Reservation: Object reference not set to an instance of an object. - 0 ) ) My request is: POST /Rentway_Internacional_Reservations_WS/Create_Reservation.asmx HTTP/1.0 Host: www.xxxxxxx.pt User-Agent: NuSOAP/0.9.5 (1.123) Content-Type: text/xml; charset=UTF-8 SOAPAction: http://www.xxxxxxx.pt/Rentway_Internacional_Reservations_WS/Create_Internacional_Reservation/Create_Internacional_Reservation Content-Length: 714 <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns3785="http://tempuri.org"> <SOAP-ENV:Body><Create_Internacional_Reservation xmlns="http://www.xxxxxxxxx.pt/Rentway_Internacional_Reservations_WS/Create_Internacional_Reservation"> <Reservation_Request> <MessageType>N</MessageType> <Group>01</Group> ........................... </Reservation_Request> </Create_Internacional_Reservation> </SOAP-ENV:Body> </SOAP-ENV:Envelope> My code is: require_once('nu-soap/nusoap.php'); require_once('config.php'); $client = new nusoap_client('http://www.xxxxxxxxxx.pt/Rentway_Internacional_Reservations_WS/Create_Reservation.asmx?wsdl', true); $param = array('Username'=>'xxx','Password'=>'xxx','MessageType'=>'N','Group'=>'01'); $result = $client->call('Create_Internacional_Reservation', array('Reservation_Request' => $param)); When getting information about the request on the webservice's manual which I was advised to use, the only difference I can find is: Where's: Code (XML): <Reservation_Request> <MessageType>N</MessageType> <Group>01</Group> ........................... </Reservation_Request> Should be: <Reservation_Request xmlns="http://www.xxxxxx.pt/Rentway_Internacional_Reservations_WS/Reservation_Request.xsd" > <MessageType>N</MessageType> <Group>01</Group> ........................... </Reservation_Request> How can I send (xmlns="http://www.xxxxxx.pt/Rentway_Internacional_Reservations_WS/Reservation_Request.xsd" ) inside Reservation_Request ?
  16. cmb


    In searching how to wright cdata tags into my xml document using simpleXML i came across this example and when i try and use it Dreamweaver shows that lines 4-7 are wrong i try and run the code anyway and i get this error syntax error, unexpected T_VARIABLE on line 4 <?php class SimpleXMLExtended extends SimpleXMLElement{ public function addCData($cdata_text){ $node= dom_import_simplexml($this); $no = $node->ownerDocument; $node->appendChild($no->createCDATASection($cdata_text)); } } $xml_doc = new SimpleXMLExtended('save.xml',NULL,TRUE); $email = $xml_doc->addChild('email'); $email->addAttribute('id',$id); $email->from = NULL; $email->from->addCData($from); $xml_doc->asXML('save.xml'); ?>
  17. Hi! I have a webservice in asp.net that return Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/20...chema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/20...soap-envelope"> <soap12:Body> <CalculadoraResponse xmlns="http://tempuri.org/"> <CalculadoraResult> <xsd:schema>schema</xsd:schema>xml</CalculadoraResult> </CalculadoraResponse> </soap12:Body> </soap12:Envelope> I call the webservice: <?php $client = new SoapClient("webserviceaddress"); $result = $client->Calculadora(array('Param1'=>'1')); $simpleresult = $result->CalculadoraResult; ?> How can i read the result? I have another function in that webservice that return a string and everything its ok, but with this function i dont know how to read the result
  18. Hi guys, I'm trying to write a php page that will function as an xml sitemap. I'm getting the following error, however: This page contains the following errors: error on line 1 at column 94: Extra content at the end of the document My code is below. Any ideas? <?php header("Content-Type: text/xml;charset=iso-8859-1"); echo '<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.google.com/schemas/sitemap/0.84">'; echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">'; include 'includes/db_connect.php'; $sitemap = generateSitemap(); foreach ($sitemap as $key => $value) { ?> <url> <loc>http://failauthority.com/<?php echo $value['id']; ?></loc> <lastmod><?php echo date("Y-m-d"); ?></lastmod> <changefreq>weekly</changefreq> <priority>.5</priority> </url> <?php } ?> </urlset>
  • 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.