The standalone declaration is a way of telling the parser to ignore any markup declarations in the DTD. The DTD is thereafter used for validation only.
- The standalone directive is an optional attribute on the XML declaration.
- Valid values are yes and no, where no is the default value.
- The attribute is only relevant when a DTD is used. (The attribute is irrelevant when using a schema instead of a DTD.)
- standalone=”yes” means that the XML processor must use the DTD for validation only. In that case it will not be used for default values for attributes , entity declarations and normalization
- Note that standalone=”yes” may add validity constraints if the document uses an external DTD. When the document contains things that would require modification of the XML, such as default values for attributes, and standalone=”yes” is used then the document is invalid.
- Standalone=”yes” may help to optimize performance of document processing.
• Conducted at time of parsing
• Cannot be changed during parser lifetime
- UTF-8 (php uses this type for internal document representation; bytes up to 21)
- US-ASCII (single byte)
- ISO-8859-1 (single byte; default)
• Conducted at time of php passing data to xml handlers
• Target encoding initially set to same as source encoding
• Can be changed at any time
Characters not capable of source encoding cause an error
Characters not capable of target encoding are demoted (to “?”)
XML stands for eXtensible Markup Language.
XML was designed to store and transport data.
XML was designed to be both human- and machine-readable.
Data format (“UNIVERSAL”) used for structured document exchange.
XML plays an important role in many different IT systems.
XML is often used for distributing data over the Internet.
It is important (for all types of software developers!) to have a good understanding of XML
<?xml version="1.0" encoding="UTF-8"?>
SimpleXML is an extension that allows us to easily manipulate and get XML data.
SimpleXML provides the ability to iterate over items in an XML document, as well as
access items within it as if they were object properties
SimpleXML provides an easy way of getting an element’s name, attributes and textual content if you know the XML document’s structure or layout.
SimpleXML turns an XML document into a data structure you can iterate through like a collection of arrays and objects.
- SimpleXML allows removal of attributes.
- SimpleXML allows addition of new attributes.
- SimpleXML allows removal of nodes.
- SimpleXML allows addition of new nodes.
This function takes the node node of class SimpleXML and makes it into a DOMElement node. This new object can then be used as a native DOMElement node.
XML File – test.xml
<?xml version=”1.0″ encoding=”UTF-8″?>
$xmlFIle = “test.xml”;
$xmlString = file_get_contents($xmlFIle);
$content->Update->Time = date(“Y-M-d h:i:s”);
It disable libxml errors and allow user to fetch error information as needed
It set the streams context for the next libxml document load or write
It changes the default external entity loader
It returns last error from libxml