|
|
This work is licensed under a Creative Commons |
XML's three most important companions are XML Namespaces for combining XML names from different vocabularies; XML Schema for defining XML vocabularies; and XSL Transformations (XSLT) for transforming XML data into other structures, either another XML vocabulary, or something else entirely. These technologies are the basic toolbox for any Web-based technology today.
Clark notationis useful:
{http://www.w3.org/1999/xhtml}html)<neurotic> <prefix:elem xmlns:prefix="http://ns1.com/"> <prefix:child>content</prefix:child> </prefix:elem> <prefix:elem xmlns:prefix="http://ns2.com/"> <prefix:child>content</prefix:child> </prefix:elem> </neurotic>
<borderline> <prefix1:elem xmlns:prefix1="http://ns1.com/"> <prefix1:child>content</prefix1:child> </prefix1:elem> <prefix2:elem xmlns:prefix2="http://ns1.com/"> <prefix2:child>content</prefix2:child> </prefix2:elem> </borderline>
<psychotic xmlns:prefix1="http://ns1.com/" xmlns:prefix2="http://ns1.com/"> <prefix1:elem> <prefix2:child>content</prefix2:child> </prefix1:elem> <prefix2:elem> <prefix1:child>content</prefix1:child> </prefix2:elem> </psychotic>
<xsl:template match="section" xmlns:mathml="http://www.w3.org/1998/Math/MathML/"> <xsl:if test="exists(.//mathml:*)">
I use an XML (pause) schema to validate my XML documents
I use an XML (no pause) Schema to validate my XML documents
| DTD | XML Schema | |
|---|---|---|
| Concepts | some conceptual model (formal/informal) | |
| Types | ID/IDREF and (#P)CDATA | Hierarchy of Simple and Complex Types |
| Markup Constructs | Element Type Declarations <!ELEMENT order … |
Element Definitions <xs:element name="order"> … |
| Instances (Documents) | <order date=""> [ order content ] </order> | |
somewhere
<?xml-stylesheet type="text/xsl" href="book.xsl"?> <book> <author>Erik Wilde</author> <author>David Lowe</author> <title>XPath, XLink, XPointer, and XML: A Practical Guide to Web Hyperlinking and Transclusion</title> <date>July 2002</date> <publisher>Addison Wesley</publisher> <isbn>0201703440</isbn> </book>
<xsl:template match="/">
<html>
<body>
<xsl:for-each select="/book/author">
<xsl:value-of select="."/>
<xsl:choose>
<xsl:when test="position() = last() - 1"> and </xsl:when>
<xsl:otherwise>, </xsl:otherwise>
</xsl:choose>
<html> <body>Erik Wilde and David Lowe, <em>"XPath, XLink, XPointer, and XML: A Practical Guide to Web Hyperlinking and Transclusion",</em> Addison Wesley, July 2002, ISBN: 0201703440. </body> </html>