Skip to content

Tag: xml

XML PHP Format Setup

Is there a why to do this? I’m new on create DomDocument. Thank you <!DOCTYPE Data SYSTEM “http://data.data.org/schemas/data/1.234.1/data.dtd”> <Data payloadID = “123123123131231232323” timestamp = “2015-06-10T12:59:09-07:00”> Answer Here are two ways in D…

Convert xml string to json in php

I have the fokllowing xml string that i’d like to convert to a json string. Here is the xml in a variable: Then I’m using this regex to convert it but it returns blank. What am i missing? Answer You’ll find it a lot easier if you also process the outer SOAP document with SimpleXML, rather th…

PHP simpleXMLelment xpath returns unexpected results

I have executed the following code on the the sample XML at the bottom of the question and I am getting unexpected results. I would expect this to return only the two record nodes that are children of the current addresses node. But, it actually returns all 5 of the record nodes of the original $xml element. …

How to insert data in a XML sub tag

let’s suppose that i have this tag with this html form if I want to insert data I do it work nicely without any problem now if we want to insert a data in the sub tag I thought we should do something like let’s suppose that we have “hello” in $_POST[‘something’] variable I …