XML Technologies

PHP Snippets

roland.christen@hslu.ch

XML I/O

Read and write XML Files.

simplexml_load_file(), addChild(), addAttribute(), file_put_contents()...

Demo »

XSLT server-side

Perform XSL-Transformation on server side.

file_get_contents(), DOMDocument, XSLTProcessor, importStylesheet(), transformToDoc(), saveXML()...

Demo »

Postback

Gather user input, send to server and process.

http post, php arrays, conditional branching, for loop...

Demo »

XPATH (query)

Run XPATH Queries against XML file.

simplexml_load_file(), xpath(), simplexmlelement.xpath....

Demo »

XPATH (modify)

Select XML nodes with XPATH and modify content.

file_get_contents(), DOMDocument, loadXML(), DOMXPath(), query(), nodeValue, saveXML()...

Demo »

Schema Validation

Validate XML file against XML Schema.

simplexml_load_file(), xpath(), simplexmlelement.xpath....

Demo »