• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Easy Digital Downloads a2z

Easy Digital Downloads a2z

Easy Digital Downloads a2z

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / ArrayToXML::buildXML() – Build an XML Data Set

You appear to be a bot. Output may be restricted

Description

Build an XML Data Set

Usage

$string = ArrayToXML::buildXML( $data, $startElement );

Parameters

$data
( array ) required – Associative Array containing values to be parsed into an XML Data Set(s)
$startElement
( string ) optional default: data – Root Opening Tag, default data

Returns

string XML String containing values

Source

File name: easy-digital-downloads/includes/libraries/class-ArrayToXML.php
Lines:

1 to 19 of 19
  public function buildXML($data, $startElement = 'data')
  {
    if (!is_array($data)) {
      $err = 'Invalid variable type supplied, expected array not found on line ' . __LINE__ . ' in Class: ' . __CLASS__ . ' Method: ' . __METHOD__;
      trigger_error($err);
      return false; //return false error occurred
    }
    $xml = new XmlWriter();
    $xml->openMemory();
    $xml->startDocument($this->version, $this->encoding);
    $xml->startElement($startElement);

    $data = $this->writeAttr($xml, $data);
    $this->writeEl($xml, $data);

    $xml->endElement(); //write end element
    //returns the XML results
    return $xml->outputMemory(true);
  }
 

 View on GitHub View on Trac

Published: 26th November 2019 | Last updated: 26th November 2019

Primary Sidebar

Information

Function name: ArrayToXML::buildXML
Class ref: ArrayToXML
Plugin ref: Easy Digital Downloads
Version: 2.10.1
Sourcefile: includes/libraries/class-ArrayToXML.php
File ref: includes/libraries/class-ArrayToXML.php
Deprecated?: No
API Letters: A,B

Footer

Easy Digital Downloads a2z
Easy Digital Downloads a2z
Easy Digital Downloads a2z
WordPress 5.7
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  edd.wp-a2z.org
© Copyright Easy Digital Downloads a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites