Quick Reference Card for XML (and related) technologies
Introduction
This quick reference lists all important XML technologies along with the associated namespace URIs and either a short summary of the syntax, or a link to a more comprehensive reference. For most of the summaries, it is expected that you have read the relevant standards or documentation and still roughly recall how it works. If you don't, there is also a link to the relevant standard or a good tutorial to get you started. Be aware, though, that the Author of this page is a hardcore W3C standards reader, don't expect easy lecture :-)
This page also contains non-XML, but related technologies (HTTP, REST, URI).
Table of Contents
Meta
Core Technologies
- XML : Overview (with reference) , Standard , Namespace , Reference
- XML Base : Overview (with reference) , Standard , Namespace
- XInclude : Overview (with reference) , Standard , Namespace
- DOM : Overview , Standard , Reference
Common Applications of XML
- XHTML : Overview , Standard , Namespace , Reference
- XSLT : Overview , Standard , Namespace , Reference
- EXSLT : Overview (with reference) , Standard , Namespace
- SVG : Overview , Standard , Namespace , Reference
- MathML : Overview , Standard , Namespace , Reference
- XForms : Overview , Standard , Namespace , Reference
- RDF/RSS : Overview (with reference) , Standard , Namespace , Reference
Links and Queries
- XLink : Overview (with reference) , Standard , Namespace , Reference
- XPointer : Overview (with reference) , Standard , Reference
- XUpdate : Overview (with reference) , Standard , Namespace
- XQuery : Overview , Standard , Namespace
Schemas and Validation
- Relax NG : Overview , Standard , Namespace , Reference
- Schematron : Overview , Standard , Namespace , Reference
- XML Schema : Overview , Standard , Namespace , Reference
Networking
Related Technologies
- HTTP : Overview , Standard
- URI/URL/URN : Overview , Standard
- Apache : Overview , Reference
- JavaScript : Overview , Standard , Reference
Call for Participation
Please, help out by sending tutorials or references you find to info@syntax-k.de (though it will be hard to find better references that zvon.org's). If a particular standard is small, consider writing a quick reference. You should look at "XUpdate" for a medium-sized example of what the original author considers "enough information".
If you plan to add more standards, please think about the practical usability: This page is aimed at real-world developers who do not neccessarily follow the latest hyped standard. In particular, many distrust XML Schema and like the KISS (Keep it simple, stupid) principle. Having REST and Schematron listed here is a tribute to that attitude, while SOAP and XML Schema are listed more for the sake of completeness.
Syntactical Conventions
Each entry lists several URIs. These have the following meaning:
- Standard: The authoritative standards document
- Tutorial: A tutorial for the unintiated, usually not going too much in depth
- Namespace URI: The namespace URI, if applicable
- Reference: A link to an online reference, for the larger standards
After this section, the actual reference follows. It usually lists the possible elements/functions/attributes/whatever in some pseudo-document-fragments. Optional stuff is set in
italics
, stuff you must fill in is written like
{$this}
. If there are multiple exclusive choices, they are written like
{'this'|'that'}
, while multiple cumulative choices are written like
{'this'/'that'}
. Attributes that have been mentioned before are not repeated but just listed, separated with commas.
XML
- Standard: XML 1.0 W3C Recommendation (Second Edition), 2002-10-06
- Tutorial: XML Tutorial at w3schools.com , DTD Tutorial at w3schools.com
-
Namespace:
http://www.w3.org/XML/1998/namespace
- Reference: Mulberry Technologies' XML Quick Reference (PDF)
Attributes
xml:space="
{'default'|'preserve'}
"
xml:lang="
{$iso-2-letter-language-code}
"
XML Base
- Standard: XML Base W3C Recommendation, 2001-06-27
- Tutorial: none available
-
Namespace:
http://www.w3.org/XML/1998/namespace
- Reference: none available
Attributes
xml:base="
{$url}
"
XInclude
- Standard: XInclude 1.0 W3C Candidate Recommendation, 2002-10-17
- Tutorial: none available
-
Namespace:
http://www.w3.org/2001/XInclude
- Reference: none available
Elements
<xi:include href="
{$url-with-optional-fragment-in-xpointer-syntax}
"
parse="
{'xml'|'text'}
"
encoding="
{$encoding-name}
"
>
<xi:fallback>
{$content-for-when-url-cant-be-retrieved}
</xi:fallback>
</xi:include>
XHTML
- Standard: XHTML 1.0 W3C Recommendation (Second Edition), 2002-08-01 , HTML 4.01 W3C Recommendation 1999-12-24 , CSS 2.1 W3C Working Draft 2003-01-28
- Tutorial: XHTML Tutorial at w3schools.com
-
Namespace:
http://www.w3.org/1999/xhtml
- Reference: XHTML Reference at zvon.org , CSS2 Reference at zvon.org
XSLT
- Standard: XSLT 1.0 W3C Recommendation, 1999-11-16 , XPath 1.0 W3C Recommendation 1999-11-16
- Tutorial: XSLT Tutorial at w3schools.com
-
Namespace:
http://www.w3.org/1999/XSL/Transform
- Reference: XSLT Reference at zvon.org , Mulberry Technologies' XSLT and XPath Quick Reference (PDF)
EXSLT
- Standard: EXSLT Website
- Tutorial: none available
- Namespace: various, see below
- Reference: EXSLT Website
Note: Functions and elements in bold face are declared stable and available on all EXSLT processors supporting the associated group. Functions not supported by libxslt are noted as such, as are functions available through extension stylesheets.
Common -
http://exslt.org/common
Functions:
-
$nodeset
= exsl:node-set($anything
) -
$string
= exsl:object-type($anything
)
Elements:
-
<exsl:document href="
{$uri}
" method="{'xml'|'html'|'text'|$others}
" version="{$version}
" encoding="{$encoding}
" omit-xml-declaration="{'yes'|'no'}
" standalone="{'yes'|'no'}
" doctype-public="{$publicid}
" doctype-system="{$systemid}
" cdata-section-elements="{$list}
" indent="{'yes'|'no'}
" media-type="{$type}
" >{$content-of-document}
</exsl:document>
Dates And Times -
http://exslt.org/dates-and-times
Notes:
$datetime
is an ISO 8601 Date/Time string, or one of the XML Schema xs:dateTime strings. These forms are possible:
CCYY
-
MM
-
DD
T
hh
:
mm
:
ss
,
CCYY
-
MM
-
DD
,
CCYY
-
MM
,
CCYY
,
hh
:
mm
:
ss
.
$duration
is an xs:duration string, which is basically
P
n
Y
n
M
n
DT
n
H
n
M
n
S
, for example:
P1M
,
-P1D
,
PT30S
,
P1Y0M1DT0M0H0S
.
$template
is like in Java 1.1:
y
=year,
M
=month,
d
=day of month,
H
=hour(0-23),
m
=minute,
s
=second,
S
=millisecond,
z
=timezone,
E
=weekday,
a
=am/pm,
h
=hour(1-12),
G
=AD/BC; more letters == longer format:
MM
=08,
MMM
=Aug,
MMMM
=August.
Functions:
-
$datetime
= date:date-time() -
$date
= date:date($datetime
) -
$time
= date:time($datetime
) -
$year
= date:year($datetime
) -
$boolean
= date:leap-year($datetime
) -
$number
= date:month-in-year($datetime
) -
$name
= date:month-name($datetime
) -
$name
= date:month-abbreviation($datetime
) -
$number
= date:week-in-year($datetime
) -
$number
= date:week-in-month($datetime
) -
$number
= date:day-in-year($datetime
) -
$number
= date:day-in-month($datetime
) -
$number
= date:day-of-week-in-month($datetime
) -
$number
= date:day-in-week($datetime
) -
$name
= date:day-name($datetime
) -
$name
= date:day-abbreviation($datetime
) -
$number
= date:hour-in-day($datetime
) -
$number
= date:minute-in-hour($datetime
) -
$number
= date:second-in-minute($datetime
) -
$number
= date:seconds($datetime-or-duration
) -
$datetime
= date:add($datetime
,$duration
) -
$duration
= date:add-duration($duration
,$duration
) -
$duration
= date:duration($seconds
) -
$string
= date:format-date($datetime
,$template
) not in libxslt, available as extension stylesheet -
$datetime
= date:parse-date($datetime
,$template
) not in libxslt -
$duration
= date:sum($nodeset-of-durations
) not in libxslt
Elements:
-
<date:date-format
name="
{$name}
" calendar="{'gregorian'|$calendarname}
" lang="{$iso-2letter-language}
" first-day-of-week="{'monday'|'tuesday'|...|'sunday'}
" /> not in libxslt
Dynamic -
http://exslt.org/dynamic
Functions:
-
$anything
= dyn:evaluate($xpath-expression
) -
$number
= dyn:min($nodeset
,$xpath-expression
) not in libxslt -
$number
= dyn:max($nodeset
,$xpath-expression
) not in libxslt -
$number
= dyn:map($nodeset
,$xpath-expression
) not in libxslt -
$nodeset
= dyn:map($nodeset
,$xpath-expression
) not in libxslt -
$transitive-closure-nodeset
= dyn:closure($nodeset
,$xpath-expression
) not in libxslt
Functions -
http://exslt.org/functions
Elements:
-
<func:function name="
{$qname}
"{$param-declarations}
{$content-with-result}
</func:function>> -
<func:result
select="
{$xpath-expression}
" >{$content}
</func:function> -
<func:script implements-prefix="
{$bound-prefix}
" language="{$lang-name}
" src="{$uri}
" archive="{$uri}
" /> not in libxslt
Math -
http://exslt.org/math
Functions:
-
$number
= math:min($nodeset
) -
$number
= math:max($nodeset
) -
$nodeset
= math:highest($nodeset
) -
$nodeset
= math:lowest($nodeset
) -
$number
= math:constant({'PI'|'E'|'SQRRT2'|'LN2'|'LN10'|'LOG2E'|'SQRT1_2'}
,$precision
) -
$number
= math:random() -
$number
= math:abs($number
) -
$number
= math:sqrt($number
) -
$number
= math:power($number
) -
$number
= math:log($number
) -
$number
= math:exp($number
) -
$number
= math:sin($number
) -
$number
= math:cos($number
) -
$number
= math:tan($number
) -
$number
= math:asin($number
) -
$number
= math:acos($number
) -
$number
= math:atan($number
) -
$number
= math:atan2($number
)
Regular Expressions -
http://exslt.org/regular-expressions
Functions:
-
$boolean
= regexp:test($string
,$pcre
,{'g'/'i'}
) not in libxslt -
$nodeset
= regexp:match($string
,$pcre
,{'g'/'i'}
) not in libxslt -
$result
= regexp:replace($string
,$pcre
,{'g'/'i'}
,$replacement
) not in libxslt
Sets - http://exslt.org/sets
Functions:
-
$nodeset
= set:difference($base-nodeset
,$subtraced-nodeset
) -
$nodeset
= set:intersection($nodeset
,$nodeset
) -
$nodeset
= set:distinct($nodeset
) -
$boolean
= set:has-same-node($nodeset
,$nodeset
) -
$prefix-nodeset
= set:leading($nodeset
,$contained-node
) -
$postfix-nodeset
= set:trailing($nodeset
,$contained-node
)
Strings - http://exslt.org/strings
Functions:
-
$nodeset
= str:tokenize($string
,$separator-chars
) -
$result
= str:replace($string
,$list-of-matches
,$list-of-replacements
) not in libxslt, available as extension stylesheet -
$string
= str:padding($char-length
,$string-to-repeat
) -
$string
= str:align($string-to-be-aligned
,$padding-string
,{'left'|'center'|'right'}
) -
$string
= str:encode-uri($string
,$do-escape-everything
,$encoding
) -
$string
= str:decode-uri($string
,$encoding
) -
$string
= str:concat($nodeset
) -
$nodeset
= str:split($string
,$separator-string
) not in libxslt, available as extension stylesheet
XLink
- Standard: XLink W3C Recommendation, 2001-06-27
- Tutorial: none available
-
Namespace:
http://www.w3.org/1999/xlink
- Reference: XLink Reference at zvon.org
Elements
Simple
<foo xlink:type="simple" xlink:href="
{$uri}
"
xlink:role="
{$role-uri}
" xlink:title="
{$human-title}
" xlink:show="
{'replace'|'new'|'embed'|'other'|'none'}
" xlink:actuate="
{'onRequest'|'onLoad'|'other'|'none'}
" xlink:arcrole="
{$role-uri}
"
>
{$content}
</foo>
Extended
<outerfoo xlink:type="extended" xlink:role, xlink:title >
<foo xlink:type="locator" xlink:href="
{$uri}
"
xlink:label="{$unique-id}" xlink:role,xlink:title
>
{$displayable-link-content}
</foo>
<foo xlink:type="arc" xlink:href="
{$uri}
" xlink:from="
{$idref}
" xlink:to="
{$idref}
"
xlink:arcrole,xlink:title,xlink:show,xlink:actuate
/>
<foo xlink:type="resource" xlink:href="
{$uri}
"
xlink:role,xlink:title,xlink:label
>
$inline-link-target
</foo>
<foo xlink:type="title">
{$human-title}</foo
</outerfoo>
XPointer
- Standard: XPointer Framework W3C Proposed Recommendation, 2002-11-13 , XPointer element() Scheme W3C Proposed Recommendation, 2002-11-13 , XPointer xmlns() Schene W3C Proposed Recommendation, 2002-11-13 , XPointer xpointer() Schene W3C Proposed Recommendation, 2002-11-13
- Tutorial: none available
-
Namespace:
not applicable
- Reference: XPointer Reference at zvon.org
General Syntax:
{$uri}
#
{
{$idref}
/xmlns(
{$prefix}
=
{$uri}
)/element(
{$selector}
)/xpointer(
{$selector}
)}
Shorthand Pointer
{$idref}
== xpointer(id('
{$idref}
'))
xmlns() Scheme
Syntax: xmlns(
$prefix
=
$namespace-uri
)
element() Scheme
element(
{$idref}
) == xpointer(id('
{$idref}
'))
element(/
{$n}
/
{$n}
/...) == xpointer(/*[
{$n}
]/*[
{$n}
]/...)
element(
{$idref}
/
{$n}
/
{$n}
/...) == xpointer(id('
{$idref}
')/*[
{$n}
]/*[
{$n}
]/...)
xpointer() Scheme
Syntax: xpointer(
{$xpath}
)
XPath extensions:
-
{$xpath-selector}
/range-to({$xpath}
) -
string-range(
{$xpath}
,{$searchstring}
,{$startpos-relative-to-match}
,{$endpos-relative-to-match}
-
range(
{$xpath-to-be-converted}
) -
range-inside(
{$xpath}
) -
start-point(
{$xpath}
) -
end-point(
{$xpath})
- here()
- origin()
Quoting: xpointer("foo)") => xpointer("foo^)")
XUpdate
- Standard: XUpdate XML:DB Working Draft, 2000-09-14
- Tutorial: none available
-
Namespace:
http://www.xmldb.org/xupdate
- Reference: none available
Elements
General Syntax
<xu:modifications version="1.0">
<xu:variable name="
{$name}
" select="
{$xpath}
"/>
<xu:insert-before select="
{$xpath-selecting-sibling}
">
{$content}
</xu:insert-before>
<xu:insert-after select="
{$xpath-selecting-sibling
}">
{$content}
</xu:insert-after>
<xu:append select="
{$xpath-selecting-parent}
"
child="
{$pos}
"
>
{$content}
</xu:append>
<xu:update select="
{$xpath-selecting-parent}
">
{$content}
</xu:update>
<xu:remove select="
{$xpath-selecting-nodes}
"/>
<xu:rename select="
{$xpath-selecting-element-or-attrib}
">
{$new-name}
</xu:rename>
</xu:modifications>
Content Elements
<xu:element name="
{$name}
">
{$content}
</xu:element>
<xu:attribute name="
{$name}
">
{$content}
</xu:attribute>
<xu:text>
{$content}
</xu:text>
<xu:processing-instruction name="
{$name}
">
{$content}
</xu:processing-instruction>
<xu:comment>
{$content}
</xu:comment>
<xu:value-of select="
{$xpath}
"/>
XQuery
- Standard: XQuery 1.0 W3C Working Draft, 2002-11-15 , XPath 2.0 W3C Working Draft, 2002-11-15
- Tutorial: none available
- Namespace: http://www.w3.org/2002/11/xquery-functions
- Reference: none available
XML Schema
- Standard: XML Schema Part 0: Primer W3C Recommendation, 2001-05-01 , XML Schema Part 1: Structures W3C Recommendation, 2001-05-01 , XML Schema Part 2: Datatypes W3C Recommendation, 2001-05-01
- Tutorial: XML Schema Tutorial at w3schools.com
-
Namespace:
http://www.w3.org/2001/XMLSchema
- Reference: XML Schema Reference at zvon.org
RDF
- Standard: RDF W3C Recommendation, 1999-02-22 , Dublin Core Website
- Tutorial: none available
-
Namespace:
http://www.w3.org/1999/02/22-rdf-syntax-ns#
- Reference: RSS 1.0 Reference at zvon.org , DC Reference at zvon.org
RDF-XML Serialization Syntax
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:NS="{Namespace of properties}"> <rdf:Description rdf:about="{URI of Subject}" NS:property_1="{Literal Value}"> <NS:property_2>{Literal Value}</NS:property_2> <NS:property_3 rdf:resource="{URI of Resource Value}" /> <NS:property_4 rdf:parseType="Resource"> {Properties of Anonymous Resource} </NS:property_4> <!-- Containers: --> <NS:property_5> <rdf:Bag> <!-- Bag=unordered, Seq=ordered, Alt=alternate values --> <rdf:li>{Value 1}</rdf:li> <rdf:li>{Value 2}</rdf:li> </rdf:Bag> <!-- alternate syntax: <rdf:Bag rdf:_1="{Value 1}" rdf:_2="{Value 2}" /> --> </NS:property_5> </rdf:Description> <rdf:Description rdf:ID="{Unique ID of this resource}">...</rdf:Description> </rdf:RDF>
XForms
- Standard: XForms W3C Candidate Recommendation, 2002-11-12
- Tutorial: XForms Tutorial at w3schools.com
-
Namespace:
http://www.w3.org/2001/08/xforms
- Reference: XForms Reference at zvon.org
SOAP
- Standard: SOAP 1.2 Part 1 W3C Candidate Recommendation, 2002-12-19 , SOAP 1.2 Part 2 W3C Candidate Recommendation, 2002-12-19
- Tutorial: SOAP Tutorial at w3schools.com
-
Namespace:
http://www.w3.org/2002/12/soap-envelope
,http://www.w3.org/2002/12/soap-encoding
- Reference: SOAP 1.1 Reference at zvon.org
XML-RPC
- Standard: XML-RPC Specification, 1999-06-15
- Tutorial: XML-RPC Howto
- Namespace: not applicable
- Reference: none available
REST
- Standard: Original dissertation about REST, 2000
- Tutorial: REST Pseudocode
- Namespace: not applicable
- Reference: REST Wiki
SVG
- Standard: SVG 1.1 W3C Recommendation, 2003-01-14 , SMIL 1.0 W3C Recommendation, 1998-06-15
- Tutorial: none available
-
Namespace:
http://www.w3.org/2000/svg
- Reference: SVG Reference at zvon.org , http://www.svg.org/wiki/
MathML
- Standard: MathML 2.0 W3C Recommendation, 2001-02-21
- Tutorial: none available
-
Namespace:
http://www.w3.org/1998/Math/MathML
- Reference: MathML Reference at zvon.org
HTTP
- Standard: RFC 2616: HTTP/1.1, 1999-06
- Tutorial: none available
- Namespace: not applicable
- Reference: none available
Schematron
- Standard: Schematron 1.5 ASCC Specification, 2002-10-01
- Tutorial: xml.com article by Kip Hampton
-
Namespace:
http://www.ascc.net/xml/schematron
- Reference: Schematron Reference at zvon.org
Relax NG
- Standard: RELAX NG OASIS Specification, 2001-12-03
- Tutorial: Official Tutorial at OASIS
-
Namespace:
http://relaxng.org/ns/structure/1.0
- Reference: Relax NG Reference at zvon.org
DOM
- Standard: Various DOM Standards at W3C
- Tutorial: DOM Tutorial at w3schools.com
- Namespace: not applicable
- Reference: DOM Level 2 Reference at zvon.org
URI/URL/URN
- Standard: RFC 2396: URI Generic Syntax, 1998-08 , RFC 2141: URN Syntax, 1997-05 , RFC 1738: URLs, 1994-12
- Tutorial: A Beginners Guide to URLs
- Namespace: not applicable
- Reference: none available
Apache
- Standard: not available
- Tutorial: not available
- Namespace: not applicable
- Reference: Apache HTTP Server Version 1.3 Documentation , Apache HTTP Server Version 2.0 Documentation
JavaScript
- Standard: ECMAScript,ECMA-262
- Tutorial: JavaScript tutorial at W3Schools
- Namespace: not applicable
-
Reference:
DevGuru JavaScript reference
Be sure to check "DOM" as well!
ChangeLog
This section is intended to make coordination between modifications easier. Please describe any changes you did here.
2004-10-07 | jwalt at cpan.org | added JavaScript 2003-05-15 | jwalt at cpan.org | added Apache server docs 2003-05-02 | sbwoodside at yahoo.com | fixed page-width probs in mozilla 2003-03-18 | jwalt at cpan.org | added Table Of Contents 2003-02-19 | jj at lojjic.net | added RDF syntax examples, | | fixed POD errors in XUpdate 2003-02-19 | jj at lojjic.net | added Mulberry quick ref links to XML and XSLT 2003-02-19 | jwalt at cpan.org | added #contents fragments to W3C links 2003-02-19 | jwalt at cpan.org | ChangeLog created 2003-02-18 | jwalt at cpan.org | Initial revision