<?xml version="1.0" encoding="ISO-8859-1"?><book><name>Effective JavaScript</name><category>Program Language</category><author>Bowen</author><description>This book is about JavaScript Language.</description></book>
<root><ns1:bookxmlns:ns1="http://www.huangbowen.net/ns1"><ns1:name>Effective JavaScript</ns1:name><ns1:category>Program Language</ns1:category><ns1:author>Bowen</ns1:author><ns1:description>This book is about JavaScript Language.</ns1:description></ns1:book><ns2:bookxmlns:ns2="http://www.huangbowen.net/ns2"><ns2:name>Rework</ns2:name><ns2:page>120</ns2:page><ns2:publishDate>2013-10-08</ns2:publishDate></ns2:book></root>
<?xml version="1.0" encoding="ISO-8859-1"?><ns1:bookxmlns:ns1="http://www.huangbowen.net/ns1"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:targetLocation="http://www.huangbowen.net/book.xsd"><ns1:name>Effective JavaScript</ns1:name><ns1:category>Program Language</ns1:category><ns1:author>Bowen</ns1:author><ns1:description>This book is about JavaScript Language.</ns1:description></ns1:book>
在IDE中,如果你的XML节点没有遵守你引用的Schema中的定义,就会给出错误提醒。
XSLT
XSLT全称为EXtensible Stylesheet Language Transformations。 XSLT用于将XML文档转换为XHTML或其他XML文档。
<?xml version="1.0" encoding="ISO-8859-1"?><?xml-stylesheet type="text/xsl" href="book.xsl"?><book><name>Effective JavaScript</name><category>Program Language</category><author>Bowen</author><description>This book is about JavaScript Language.</description></book>