Jump to content

letoii

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

letoii's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. OK, I see my mistake. xop:include is actually a node. I can't write it in like regular text. Correct way to do this is: $xop = new DOMElement("xop:Include","","http://www.w3.org/2004/08/xop/include"); $xopNode = $Data->appendChild($xop); $xopNode->setAttribute("href","cid:".$URN_UUID_ATTACHMENT);
  2. The code that reads the XML is this: $doc = new DOMDocument(); $doc->load('../../_xml/callxml/uploadFile.xml'); $DataNodes = $doc->getElementsByTagName('Data'); $Data = $DataNodes->item(0); Where should the formatting be altered?
  3. I am trying to assign a text value to an XML node. $Data->nodeValue = '<xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:'.$URN_UUID_ATTACHMENT.'" />' The resulting xml is: <Data><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:urn:uuid:1294192877" /></Data> is there a way to generate this instead: <Data><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:urn:uuid:1294192877" /></Data>
  4. createElement then appendChild $ShipToLocation = $doc->createElement('ShipToLocation',$countryRow["ebay_code"]); $doc->documentElement->appendChild($ShipToLocation);
  5. I am constructing an XML file with PHP. I read information from a template XML file and then add elements and save it. The line breaks from the template are preserved in the saved file, but all the new elements are on one line. Is there a way to break them up so it is easier to read the file? Here is the original template: <InternationalShippingServiceOption> <ShippingService> token </ShippingService> <ShippingServiceAdditionalCost currencyID="CurrencyCodeType"> AmountType (double) </ShippingServiceAdditionalCost> <ShippingServiceCost currencyID="CurrencyCodeType"> AmountType (double) </ShippingServiceCost> <ShippingServicePriority> int </ShippingServicePriority> </InternationalShippingServiceOption> Here is the saved information (all the ShipToLocation elements on one line): <InternationalShippingServiceOption> <ShippingService>StandardInternational</ShippingService> <ShippingServiceAdditionalCost currencyID="CurrencyCodeType">26.994</ShippingServiceAdditionalCost> <ShippingServiceCost currencyID="CurrencyCodeType">44.99</ShippingServiceCost> <ShippingServicePriority>2</ShippingServicePriority> <ShipToLocation>BE</ShipToLocation><ShipToLocation>FR</ShipToLocation><ShipToLocation>IE</ShipToLocation><ShipToLocation>LU</ShipToLocation><ShipToLocation>MC</ShipToLocation><ShipToLocation>NL</ShipToLocation><ShipToLocation>GB</ShipToLocation><ShipToLocation>DE</ShipToLocation><ShipToLocation>IT</ShipToLocation></InternationalShippingServiceOption> I am using the $doc->formatOutput = true; option.
×
×
  • 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.