This blog uses responsible cookies for functionality and user preferences.
Google Analytics is used for collecting general public information to understand how my blog is used.
Learn moreScript Title: XML API
Programming Language: JavaScript
Date Created: 2020-03-31
Purpose: An easy to use interface to navigate XML documents.
Description: A XML application programming interface to load and navigate XML documents. Provides many useful functions.
Methods
xml.loader ( {
url: String
method: String [GET | POST], default GET
async: Boolean, default true
exec: Function} );
Functions
xml.node(element).hasAttribute(string);
// Checks if element has an attribute, returns a Boolean
xml.node(element).getAttribute(string);
// Returns the value of an attribute as a string
xml.node(element).hasByTagName(string);
// Checks if a parent node contents an element with a given tag name, returns a Boolean
xml.node(element).getByTagName(string);
// Returns a DOM of elements with a given tag name within an element
xml.doc(string).getID(string);
// Returns an element with a given ID from an XML document
xml.read(xml);
// Manually select and process an XML document into the API
xml.getList();
// Lists the XML documents in the API, returns a one dimensional array
xml.getRoots(string);
// Lists the parent elements in an XML document, returns a two dimensional array [ Element Name, node ]
xml.count();
// Returns the number of XML documents in the API
xml.remove(string);
// Removes an XML document from the API
xml.getValue(element);
// Returns the value of an element, value data type is set by the data-type attribute or by a definitions table
xml.scan(element);
// Scans an element and returns a two dimensional array [ Element Name, node ]
xml.keys(element);
// Scans an elements and returns the nodes as objects { name: node }
xml.stringToXML(string);
// Converts an XML string into an XML document, returns an XML document
Example Usage
xml.loader ( {
url: “cuesheet.xml”,
exec: helloworld
} );
function helloworld () {
alert ( “Hello world the document was loaded!” );
}
Terms of Use, Cookies, Privacy, and more, see Terms and Privacy
Third-party copyrights and trademarks featured on this site are owned by their respected holders.
Website written and designed by Patcoola 2019, some rights reserved.
This blog uses responsible cookies for functionality and user preferences.
Google Analytics is used for collecting general public information to understand how my blog is used.
Learn moreDear EU visitor, I am required to ask you consent for the following.