/
JSMA dom
JSMA dom
Overview
What can JSMA dom do for me?
The JSMA dom allows you to read and write the header field in requests and responses.
Index
Methods
The JSMA dom provides the following methods:
dom.create(tag_name)
Returns a JSMA nodeCollection.
Example
//create container root node var container = dom.parse("<container></container>", false).find("container"); //create item and add to container var item = container.create("item"); item.attr("name", "Test"); item.text("Ein Testinhalt"); container.append(item); //return string result return container.stringify(true, 2);
Parameter tag_name (required)
dom.parse(input, [strict])
Parses the given input as HTML. Use parameter 'strict' to raise parsing errors if present.
Example
//create container root node var container = dom.parse("<container></container>", false).find("container"); //create item and add to container var item = container.create("item"); item.attr("name", "Test"); item.text("Ein Testinhalt"); container.append(item); //return string result return container.stringify(true, 2);
Parameter input (required)
Parameter strict (optional)
dom.parseXML(input)
# TODO Description schreiben
Example
... dom.parseXML(input) ...
Parameter input (required)
Parameter strict (optional)
dom.stringify(document, [pretty], [indentationStep])
Returns a JSMA dom as string result
Example
//create container root node var container = dom.parse("<container></container>", false).find("container"); //create item and add to container var item = container.create("item"); item.attr("name", "Test"); item.text("Ein Testinhalt"); container.append(item); //return string result return container.stringify(true, 2);
Parameter document (required)
Parameter pretty (optional)
Parameter indentationStep (optional)
Related content
JSMA header
JSMA header
More like this
JSMA contents
JSMA contents
More like this
JSMA response
JSMA response
More like this
JSMA nodeCollection
JSMA nodeCollection
More like this
JSMA request
JSMA request
More like this
JSMA system
JSMA system
More like this