From bd923b204a8fbef563b7f75d10e42da6858419b9 Mon Sep 17 00:00:00 2001 From: Martin Goik <goik@hdm-stuttgart.de> Date: Tue, 15 Sep 2015 22:31:48 +0200 Subject: [PATCH] sda1 language attrib --- Doc/Sda1/dom.xml | 54 ++++++++++----------- Doc/Sda1/fo.xml | 32 ++++++------- Doc/Sda1/jdbc.xml | 82 ++++++++++++++++---------------- Doc/Sda1/jpaintro.xml | 2 +- Doc/Sda1/sax.xml | 62 ++++++++++++------------ Doc/Sda1/vaadin.xml | 4 +- Doc/Sda1/xmlintro.xml | 12 ++--- Doc/Sda1/xmlschema.xml | 46 +++++++++--------- Doc/Sda1/xslt.xml | 104 ++++++++++++++++++++--------------------- 9 files changed, 199 insertions(+), 199 deletions(-) diff --git a/Doc/Sda1/dom.xml b/Doc/Sda1/dom.xml index 5f31d93fb..f91d7a5d5 100644 --- a/Doc/Sda1/dom.xml +++ b/Doc/Sda1/dom.xml @@ -139,7 +139,7 @@ the <xref linkend="glo_Java"/> <classname>org.w3c.dom.Node</classname> interface by:</para> - <programlisting language="none">package org.w3c.dom; + <programlisting language="java">package org.w3c.dom; public interface Node { public static final short ELEMENT_NODE = 1; // Node Types @@ -289,7 +289,7 @@ public interface Node { <figure xml:id="simpleDomCreate"> <title>Creation of a XML document instance from scratch.</title> - <programlisting language="none">package dom; + <programlisting language="java">package dom; ... public class CreateDoc { public static void main(String[] args) throws Exception { @@ -316,7 +316,7 @@ public class CreateDoc { <para>We get the following result:</para> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <titel date="23.02.2000">Versuch 1</titel></programlisting> </section> @@ -343,14 +343,14 @@ public class CreateDoc { <xref linkend="simpleDomCreate"/> to produce an extended XML document:</para> - <programlisting language="none"><title> + <programlisting language="xml"><title> <long>The long version of this title</long> <short>Short version</short> </title></programlisting> </question> <answer> - <programlisting language="none">package dom; + <programlisting language="java">package dom; ... public class CreateExtended { /** @@ -418,7 +418,7 @@ public class CreateExtended { <title>Accessing a XML Tree purely by <acronym xlink:href="http://www.w3.org/DOM">DOM</acronym> methods.</title> - <programlisting language="none">package dom; + <programlisting language="java">package dom; ... public class ArticleOrder { @@ -463,7 +463,7 @@ public class ArticleOrder { <para>Executing this method needs a driver instance providing an input XML filename:</para> - <programlisting language="none">package dom; + <programlisting language="java">package dom; ... public class ArticleOrderDriver { public static void main(String[] argv) throws Exception { @@ -498,7 +498,7 @@ Article: 200W Stereo Amplifier, order number: 9921</programlisting> linkend="domTreeTraversal"/> we may also create HTML pages like:</para> - <programlisting language="none"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + <programlisting language="xml"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Available articles</title> @@ -541,7 +541,7 @@ Article: 200W Stereo Amplifier, order number: 9921</programlisting> <para>We introduce a class <classname>solve.dom.HtmlTree</classname>:</para> - <programlisting language="none">package solve.dom; + <programlisting language="java">package solve.dom; ... package solve.dom; @@ -639,7 +639,7 @@ public class HtmlTree { xml:id="programlisting_catalog2html_htmlskel_co"> <para>A basic HTML skeleton is is being created:</para> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> @@ -664,7 +664,7 @@ public class HtmlTree { <para>The table's header is appended but the actual data from our two products is still missing:</para> - <programlisting language="none">... <h1>Available articles</h1> + <programlisting language="xml">... <h1>Available articles</h1> <table> <tbody> <tr> @@ -682,7 +682,7 @@ public class HtmlTree { once per product completes the creation of our HTML DOM tree:</para> - <programlisting language="none">... </tr> + <programlisting language="xml">... </tr> <tr> <td>Swinging headset</td> <td>3218</td> @@ -698,7 +698,7 @@ public class HtmlTree { <para>The class <classname>solve.dom.Article2Html</classname> reads the catalog data:</para> - <programlisting language="none">package solve.dom; + <programlisting language="java">package solve.dom; ... public class Article2Html { @@ -843,7 +843,7 @@ public class Article2Html { <figure xml:id="htmlGallery"> <title>A HTML document containing <code>IMG</code> tags.</title> - <programlisting language="none"><?xml version="1.0"?> + <programlisting language="xml"><?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> @@ -881,7 +881,7 @@ public class Article2Html { <title>A <abbrev xlink:href="http://www.w3.org/Style/XSL">XSL</abbrev> script for image name extraction.</title> - <programlisting language="none"><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + <programlisting language="xml"><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:html="http://www.w3.org/1999/xhtml"> <xsl:output method="text"/> @@ -923,7 +923,7 @@ public class Article2Html { <title>Extracting <tag class="emptytag">img</tag> element image references from a HTML document.</title> - <programlisting language="none">package dom.xpath; + <programlisting language="java">package dom.xpath; ... public class DomXpath { private final SAXBuilder builder = new SAXBuilder(); @@ -1074,7 +1074,7 @@ public class DomXpath { for readability of referenced images. The following HTML document contains <quote>dead</quote> image references:</para> - <programlisting language="none" + <programlisting language="xml" xml:id="domCheckImageAccessibility"><!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> ... </head> @@ -1124,7 +1124,7 @@ Unable to open 'http://www.hdm-stuttgart.de/rotfl.gif'</programlisting> xlink:href="http://www.ietf.org/rfc/rfc1738.txt">URL</abbrev>'s and accessibility of referenced objects:</para> - <programlisting language="none">package dom.xpath; + <programlisting language="java">package dom.xpath; ... public class CheckUrl { public static void checkReadability(final String urlRef) { @@ -1205,7 +1205,7 @@ public class CheckUrl { instance along with the desired <code>xhtml</code> prefix:</para> - <programlisting language="none">final Namespace htmlNamespace = // This will allow for XPath expressions like xhtml:img + <programlisting language="java">final Namespace htmlNamespace = // This will allow for XPath expressions like xhtml:img Namespace.getNamespace("xhtml", "http://www.w3.org/1999/xhtml"); final XPathExpression<Element> xpath = XPathFactory.instance().compile ( @@ -1239,7 +1239,7 @@ public class CheckUrl { <figure xml:id="climbingCatalog"> <title>A simplified <xref linkend="glo_XML"/> product catalog</title> - <programlisting language="none"><catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + <programlisting language="xml"><catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="catalog.xsd"> <title>Outdoor products</title> <introduction> @@ -1266,7 +1266,7 @@ public class CheckUrl { <para>A corresponding schema file <filename>catalog.xsd</filename> is straightforward:</para> - <programlisting language="none"><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" + <programlisting language="xml"><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" vc:minVersion="1.0" vc:maxVersion="1.1"> @@ -1321,7 +1321,7 @@ public class CheckUrl { <title>A <abbrev xlink:href="http://www.w3.org/Style/XSL">XSL</abbrev> style sheet for catalog transformation to HTML.</title> - <programlisting language="none"><?xml version="1.0" encoding="utf-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns="http://www.w3.org/1999/xhtml"> @@ -1361,7 +1361,7 @@ public class CheckUrl { <title>Transforming an XML document instance to HTML by a XSL style sheet.</title> - <programlisting language="none">package dom.xsl; + <programlisting language="java">package dom.xsl; ... public class Xml2Html { private final SAXBuilder builder = new SAXBuilder(); @@ -1395,7 +1395,7 @@ public class Xml2Html { <figure xml:id="xml2xmlDriver"> <title>A driver class for the xml2xml transformer.</title> - <programlisting language="none">package dom.xsl; + <programlisting language="java">package dom.xsl; ... public class Xml2HtmlDriver { ... @@ -1431,7 +1431,7 @@ public class Xml2HtmlDriver { RDBMS. Consider the following schema and <code>INSERT</code>s:</para> - <programlisting language="none">CREATE TABLE Product( + <programlisting language="sql">CREATE TABLE Product( orderNo CHAR(10) ,price NUMERIC(10,2) ); @@ -1480,7 +1480,7 @@ INSERT INTO Product VALUES('w-124', 110.40);</programlisting> received from an RDBMS via <trademark xlink:href="http://electronics.zibb.com/trademark/jdbc/29545026">JDBC</trademark>:</para> - <programlisting language="none">package dom.xsl; + <programlisting language="java">package dom.xsl; ... public class XmlRdbms2Html { private final SAXBuilder builder = new SAXBuilder(); @@ -1546,7 +1546,7 @@ public class XmlRdbms2Html { <para>The method <code>addPrices(...)</code> utilizes our RDBMS access class:</para> - <programlisting language="none">package dom.xsl; + <programlisting language="java">package dom.xsl; ... public class DbAccess { public void connect(final String jdbcUrl, diff --git a/Doc/Sda1/fo.xml b/Doc/Sda1/fo.xml index 68962efef..e03e1c67a 100644 --- a/Doc/Sda1/fo.xml +++ b/Doc/Sda1/fo.xml @@ -131,7 +131,7 @@ xlink:href="http://www.w3.org/TR/2001/REC-xsl-20011015/slice6.html#fo-section">FO</abbrev> document</title> - <programlisting language="none"><?xml version="1.0" encoding="utf-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="utf-8"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> @@ -202,7 +202,7 @@ parameterizing of a physical page and the <link xlink:href="http://www.w3.org/TR/xsl/#fo_region-body">fo:region-body</link>.</title> - <programlisting language="none"><?xml version="1.0" encoding="utf-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="utf-8"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-size="6pt"> @@ -343,7 +343,7 @@ <figure xml:id="paramHeadFoot"> <title>Parameterizing header and footer.</title> - <programlisting language="none"><?xml version="1.0" encoding="utf-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="utf-8"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-size="6pt"> @@ -531,7 +531,7 @@ </imageobject> </mediaobject> - <programlisting language="none">... + <programlisting language="xml">... <fo:block font-weight='bold' border-bottom-style='dashed' border-style='solid' @@ -545,7 +545,7 @@ property set. In HTML/CSS this may be achieved by using the <code>SPAN</code> tag:</para> - <programlisting language="none"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + <programlisting language="xml"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Blocks/spans and CSS</title> @@ -587,7 +587,7 @@ <figure xml:id="listItemize"> <title>An itemized list and result.</title> - <programlisting language="none">... + <programlisting language="xml">... <fo:list-block provisional-distance-between-starts="2mm"> <fo:list-item> @@ -638,7 +638,7 @@ <figure xml:id="leaderToc"> <title>Two simulated entries in a table of contents.</title> - <programlisting language="none">... + <programlisting language="xml">... <fo:block text-align-last='justify'>Valid XML<fo:leader leader-pattern="dots"/> page 7</fo:block> @@ -672,7 +672,7 @@ page 42</fo:block> ...</programlisting> <title>Four entries separated by equal amounts of dotted space.</title> - <programlisting language="none"><fo:block text-align-last='justify'>A<fo:leader + <programlisting language="xml"><fo:block text-align-last='justify'>A<fo:leader leader-pattern="dots"/>B<fo:leader leader-pattern="dots"/>C<fo:leader leader-pattern="dots"/>D</fo:block></programlisting> @@ -697,7 +697,7 @@ leader-pattern="dots"/>C<fo:leader leader-pattern="dots"/>D</fo:bloc <title>A horizontal line separator between header and body of a page.</title> - <programlisting language="none">... + <programlisting language="xml">... <fo:page-sequence master-reference="simplePageLayout"> <fo:static-content flow-name="xsl-region-before"> <fo:block text-align-last='justify'>FO<fo:leader/>page 5</fo:block> @@ -745,7 +745,7 @@ leader-pattern="dots"/>C<fo:leader leader-pattern="dots"/>D</fo:bloc <figure xml:id="pageNumberingRoman"> <title>Roman style page numbers.</title> - <programlisting language="none">... + <programlisting language="xml">... <fo:page-sequence format="i" master-reference="simplePageLayout"> <fo:static-content @@ -783,7 +783,7 @@ leader-pattern="dots"/>C<fo:leader leader-pattern="dots"/>D</fo:bloc <figure xml:id="dictionary"> <title>A dictionary with running page headers.</title> - <programlisting language="none">... + <programlisting language="xml">... <fo:page-sequence master-reference="simplePageLayout"> <fo:static-content flow-name="xsl-region-before"> @@ -891,7 +891,7 @@ leader-pattern="dots"/>C<fo:leader leader-pattern="dots"/>D</fo:bloc <figure xml:id="refJavaXml"> <title>Two blocks mutual page referencing each other.</title> - <programlisting language="none">... + <programlisting language="xml">... <fo:flow flow-name='xsl-region-body'> <fo:block id='xml'>Java section see page <fo:page-number-citation ref-id='java'/>. @@ -929,7 +929,7 @@ leader-pattern="dots"/>C<fo:leader leader-pattern="dots"/>D</fo:bloc <title>Two blocks with mutual page- and hypertext references.</title> - <programlisting language="none"><fo:flow flow-name='xsl-region-body'> + <programlisting language="xml"><fo:flow flow-name='xsl-region-body'> <fo:block id='xml'>Java section see <fo:basic-link color="blue" internal-destination="java">page<fo:page-number-citation ref-id='java'/>.</fo:basic-link></fo:block> @@ -1023,7 +1023,7 @@ leader-pattern="dots"/>C<fo:leader leader-pattern="dots"/>D</fo:bloc <figure xml:id="memo2fosurname"> <title>Generating a sender's surname for printing.</title> - <programlisting language="none"><?xml version="1.0" encoding="utf-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> @@ -1058,7 +1058,7 @@ leader-pattern="dots"/>C<fo:leader leader-pattern="dots"/>D</fo:bloc <figure xml:id="memoMessage"> <title>A <code>memo</code> document instance.</title> - <programlisting language="none"><memo ...="memo.xsd"> + <programlisting language="xml"><memo ...="memo.xsd"> <from> <name>Martin</name> <surname>Goik</surname> @@ -1164,7 +1164,7 @@ leader-pattern="dots"/>C<fo:leader leader-pattern="dots"/>D</fo:bloc </question> <answer> - <programlisting language="none"><?xml version="1.0" encoding="utf-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> diff --git a/Doc/Sda1/jdbc.xml b/Doc/Sda1/jdbc.xml index 99eaedc6b..3ff95988c 100644 --- a/Doc/Sda1/jdbc.xml +++ b/Doc/Sda1/jdbc.xml @@ -25,7 +25,7 @@ Let us start wit a simple example assuming a <xref linkend="glo_Java"/> class User:</para> - <programlisting language="none">public class User { + <programlisting language="java">public class User { String cname; //The user's common name e.g. 'Joe Bix' String uid; //The user's unique system ID (login name) e.g. 'bix' @@ -35,7 +35,7 @@ <para>A relational implementation might look like:</para> - <programlisting language="none">CREATE TABLE User( + <programlisting language="sql">CREATE TABLE User( CHAR(80) cname ,CHAR(10) uid PRIMARY KEY )</programlisting> @@ -373,7 +373,7 @@ <title>A relation <code>Person</code> containing names and email addresses</title> - <programlisting language="none"><emphasis role="strong">CREATE</emphasis> <emphasis + <programlisting language="sql"><emphasis role="strong">CREATE</emphasis> <emphasis role="strong">TABLE</emphasis> Person ( name CHAR(20) ,email CHAR(20) <emphasis>UNIQUE</emphasis>)</programlisting> @@ -391,7 +391,7 @@ xlink:href="http://electronics.zibb.com/trademark/jdbc/29545026">JDBC</trademark> application inserting data into a relational table.</title> - <programlisting language="none">01 package sda.jdbc.intro.v1; + <programlisting language="java">01 package sda.jdbc.intro.v1; 02 03 import java.sql.Connection; 04 import java.sql.DriverManager; @@ -772,7 +772,7 @@ Statement createStatement(int resultSetType, PRACTICE!!!</emphasis>) the following (ugly code) might be possible:</para> - <programlisting language="none">package my.personal.application; + <programlisting language="java">package my.personal.application; import java.sql.Connection; import java.sql.Statement; @@ -801,7 +801,7 @@ public someClass { <para>Introduce some sort of switch statement to provide a fixed number of databases beforehand:</para> - <programlisting language="none">public void someMethod(final String vendor){ + <programlisting language="java">public void someMethod(final String vendor){ final Connection conn; @@ -1019,7 +1019,7 @@ SimpleInsert.username=hdmuser</programlisting> <classname>sda.jdbc.intro.v1.DbProps</classname> to actually access our properties:</para> - <programlisting language="none">package sda.jdbc.intro.v1; + <programlisting language="java">package sda.jdbc.intro.v1; ... public class DbProps { private static final String BUNDLE_NAME = "sda.jdbc.intro.v1.database"; @@ -1044,7 +1044,7 @@ public class DbProps { related code now contains three references to external properties:</para> - <programlisting language="none">package sda.jdbc.intro.v1; + <programlisting language="java">package sda.jdbc.intro.v1; ... public class SimpleInsert { @@ -1202,7 +1202,7 @@ public class SimpleInsert { <para>The complete implementation resides in <classname>sda.jdbc.intro.v01.InsertPerson</classname>:</para> - <programlisting language="none">package sda.jdbc.intro.v01; + <programlisting language="java">package sda.jdbc.intro.v01; import ... @@ -1298,7 +1298,7 @@ public class InsertPerson extends JFrame { later used as a component of our next step GUI application prototype. This class should have the following methods:</para> - <programlisting language="none">... + <programlisting language="java">... /** * Handle database communication. There are two * distinct internal states <q>disconnected</q> and <q>connected</q>, see @@ -1429,7 +1429,7 @@ PersistenceHandler.username=foo</pre> <para>We show a possible implementation of <classname>sda.jdbc.intro.v1.PersistenceHandler</classname>:</para> - <programlisting language="none">package sda.jdbc.intro.v1; + <programlisting language="java">package sda.jdbc.intro.v1; ... public class PersistenceHandler { @@ -1629,7 +1629,7 @@ PersistenceHandler.username=foo</pre> method disconnects any existing database connection thus freeing resources.</para> - <programlisting language="none">package sda.jdbc.intro.v1; + <programlisting language="java">package sda.jdbc.intro.v1; import ... @@ -1960,7 +1960,7 @@ public class InsertPerson extends JFrame { (<quote>;</quote>) will not be executed but flagged as a SQL syntax error. We take an example:</para> - <programlisting language="none">INSERT INTO Person VALUES (...);DROP TABLE Person</programlisting> + <programlisting language="sql">INSERT INTO Person VALUES (...);DROP TABLE Person</programlisting> <para>In order to execute these so called multi user queries we explicitly have to enable a <productname @@ -2191,7 +2191,7 @@ public class InsertPerson extends JFrame { <para>Complete the implementation of the following skeleton:</para> - <programlisting language="none">... + <programlisting language="java">... import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -2234,7 +2234,7 @@ The expression '[^0-9]+.*' ... <answer> <para>A possible implementation is given by:</para> - <programlisting language="none">import java.util.regex.Matcher; + <programlisting language="java">import java.util.regex.Matcher; import java.util.regex.Pattern; /** @@ -2382,7 +2382,7 @@ public class RegexpPrimer { build a generic class to filter user text input by arbitrary regular expressions:</para> - <programlisting language="none">package sda.jdbc.intro.v1.sanitize; + <programlisting language="java">package sda.jdbc.intro.v1.sanitize; ... public class RegexpVerifier extends InputVerifier { @@ -2425,7 +2425,7 @@ public class RegexpVerifier extends InputVerifier { with respect to <classname>sda.jdbc.intro.v1.InsertPerson</classname>:</para> - <programlisting language="none">package sda.jdbc.intro.v1.sanitize; + <programlisting language="java">package sda.jdbc.intro.v1.sanitize; ... public class InsertPerson extends JFrame { @@ -2519,7 +2519,7 @@ public class InsertPerson extends JFrame { waste of resources. We consider the transfer of records between different databases:</para> - <programlisting language="none">INSERT INTO Person VALUES ('Jim', 'jim@q.org') + <programlisting language="sql">INSERT INTO Person VALUES ('Jim', 'jim@q.org') INSERT INTO Person VALUES ('Eve', 'eve@y.org') INSERT INTO Person VALUES ('Pete', 'p@rr.com') ...</programlisting> @@ -2580,7 +2580,7 @@ INSERT INTO Person VALUES ('Pete', 'p@rr.com') linkend="figJdbcSimpleWrite"/> may be rewritten using <classname>java.sql.PreparedStatement</classname> objects:</para> - <programlisting language="none">sda.jdbc.intro.v1; + <programlisting language="java">sda.jdbc.intro.v1; ... public class SimpleInsert { @@ -2668,7 +2668,7 @@ public class SimpleInsert { <classname>sda.jdbc.intro.v1.prepare.PersistenceHandler</classname>. We may now safely enter offending strings like:</para> - <programlisting language="none">Jim', 'jim@c.com');DROP TABLE Person;INSERT INTO Person VALUES('Joe</programlisting> + <programlisting language="sql">Jim', 'jim@c.com');DROP TABLE Person;INSERT INTO Person VALUES('Joe</programlisting> <para>This time the input value is taken <quote>as is</quote> and yields the following error message:</para> @@ -2686,7 +2686,7 @@ public class SimpleInsert { <code>Person</code>. We may enlarge this value to allow the <code>INSERT</code> operation:</para> - <programlisting language="none">CREATE TABLE Person ( + <programlisting language="sql">CREATE TABLE Person ( name char(<emphasis role="bold">80</emphasis>) <emphasis role="bold">-- a little bit longer --</emphasis> ,email CHAR(20) UNIQUE );</programlisting> @@ -2798,13 +2798,13 @@ public class SimpleInsert { <caption>Names and birth dates of friends.</caption> <tr> - <td><programlisting language="none">CREATE TABLE Friends ( + <td><programlisting language="sql">CREATE TABLE Friends ( id INTEGER NOT NULL PRIMARY KEY ,nickname char(10) ,birthdate DATE );</programlisting></td> - <td><programlisting language="none">INSERT INTO Friends VALUES + <td><programlisting language="sql">INSERT INTO Friends VALUES (1, 'Jim', '1991-10-10') ,(2, 'Eve', '2003-05-24') ,(3, 'Mick','2001-12-30') @@ -2818,7 +2818,7 @@ public class SimpleInsert { <figure xml:id="listingJdbcRead"> <title>Accessing relational data</title> - <programlisting language="none">package sda.jdbc.intro; + <programlisting language="java">package sda.jdbc.intro; ... public class SimpleRead { @@ -2919,7 +2919,7 @@ public class SimpleRead { <answer> <para>Modifying our iteration loop:</para> - <programlisting language="none">// Step 4: Dataset iteration + <programlisting language="java">// Step 4: Dataset iteration while (data.next()) { System.out.println(data.<emphasis role="bold">getString</emphasis>("id") <co linkends="jdbcReadWrongType-1" @@ -2958,7 +2958,7 @@ while (data.next()) { <para>We may however provide <quote>compatible</quote> data records:</para> - <programlisting language="none">DELETE FROM Friends; + <programlisting language="sql">DELETE FROM Friends; INSERT INTO Friends VALUES (1, <emphasis role="bold">'31'</emphasis>, '1991-10-10');</programlisting> <para>This time our application executes perfectly @@ -2991,7 +2991,7 @@ INSERT INTO Friends VALUES (1, <emphasis role="bold">'31'</emphasis>, '1991-10-1 <para>The attribute <code>birthday</code> in our database table Friends allows <code>NULL</code> values:</para> - <programlisting language="none">INSERT INTO Friends VALUES + <programlisting language="sql">INSERT INTO Friends VALUES (1, 'Jim', '1991-10-10') ,(2, <emphasis role="bold"> NULL</emphasis>, '2003-5-24') ,(3, 'Mick', '2001-12-30');</programlisting> @@ -3041,7 +3041,7 @@ INSERT INTO Friends VALUES (1, <emphasis role="bold">'31'</emphasis>, '1991-10-1 on the following extension of the <code>Person</code> table:</para> - <programlisting language="none">CREATE TABLE Person ( + <programlisting language="sql">CREATE TABLE Person ( name char(80) NOT NULL ,email CHAR(20) NOT NULL UNIQUE ,login CHAR(10) UNIQUE -- login names must be unique -- @@ -3067,7 +3067,7 @@ INSERT INTO Friends VALUES (1, <emphasis role="bold">'31'</emphasis>, '1991-10-1 being executed by a <classname>java.sql.Statement</classname> object:</para> - <programlisting language="none">SELECT * FROM Person WHERE login='<emphasis + <programlisting language="sql">SELECT * FROM Person WHERE login='<emphasis role="bold">fred</emphasis>' and password = '<emphasis role="bold">12345678</emphasis>'</programlisting> @@ -3093,7 +3093,7 @@ INSERT INTO Friends VALUES (1, <emphasis role="bold">'31'</emphasis>, '1991-10-1 <para>Based on the login name <quote>fred</quote> the following SQL string is being crafted:</para> - <programlisting language="none">SELECT * FROM Person WHERE login='fred' and password = 'sd' OR <emphasis + <programlisting language="sql">SELECT * FROM Person WHERE login='fred' and password = 'sd' OR <emphasis role="bold">'1' = '1'</emphasis>;</programlisting> <para>Since the WHERE clause's last component always evaluates @@ -3171,7 +3171,7 @@ INSERT INTO Friends VALUES (1, <emphasis role="bold">'31'</emphasis>, '1991-10-1 linkend="hashProviderMethod"/> and verifying <coref linkend="hashVerifyMethod"/> methods:</para> - <programlisting language="none">package sda.jdbc.intro.auth; + <programlisting language="java">package sda.jdbc.intro.auth; ... public class HashProvider { ... @@ -3211,7 +3211,7 @@ public class HashProvider { <coref linkend="saltPwhashSeparator"/> separating salt and password hash:</para> - <programlisting language="none">package sda.jdbc.intro.auth; + <programlisting language="java">package sda.jdbc.intro.auth; public class TestHashProvider { @@ -3324,7 +3324,7 @@ public class TestHashProvider { linkend="uiuErrmsg"/> in <classname>sda.jdbc.intro.auth.UserInputUnit</classname>:</para> - <programlisting language="none">package sda.jdbc.intro.auth; + <programlisting language="java">package sda.jdbc.intro.auth; ... public class UserInputUnit { @@ -3342,7 +3342,7 @@ public class UserInputUnit { linkend="verfierGuiField"/> in class <classname>sda.jdbc.intro.auth.InputVerifierNotify</classname>:</para> - <programlisting language="none">package sda.jdbc.intro.auth; + <programlisting language="java">package sda.jdbc.intro.auth; ... public abstract class InputVerifierNotify extends InputVerifier { @@ -3380,7 +3380,7 @@ public abstract class InputVerifierNotify extends InputVerifier { <classname>sda.jdbc.intro.auth.InsertPerson</classname>. We remark some important points:</para> - <programlisting language="none">package sda.jdbc.intro.auth; + <programlisting language="java">package sda.jdbc.intro.auth; ... public class InsertPerson extends JFrame { ... // GUI attributes for user input @@ -3613,7 +3613,7 @@ PersistenceHandler.password=<emphasis role="bold">XYZ</emphasis> <co methods of a RDBMS interfacing class using <xref linkend="glo_JDBC"/>:</para> - <programlisting language="none">package sax.rdbms; + <programlisting language="java">package sax.rdbms; public class RdbmsAccess { @@ -3638,7 +3638,7 @@ public class RdbmsAccess { <answer> <para>We start by creating a suitable RDBMS Table:</para> - <programlisting language="none">CREATE SCHEMA AUTHORIZATION midb2 + <programlisting language="sql">CREATE SCHEMA AUTHORIZATION midb2 CREATE TABLE Product( orderNo CHAR(10) NOT NULL PRIMARY KEY ,price DECIMAL (9,2) NOT NULL @@ -3646,12 +3646,12 @@ CREATE TABLE Product( <para>Next we feed some toy data:</para> - <programlisting language="none">INSERT INTO Product VALUES('x-223', 330.20); + <programlisting language="sql">INSERT INTO Product VALUES('x-223', 330.20); INSERT INTO Product VALUES('w-124', 110.40);</programlisting> <para>Now we implement our RDBMS access class:</para> - <programlisting language="none">package dom.xsl; + <programlisting language="java">package dom.xsl; ... public class DbAccess { @@ -3697,7 +3697,7 @@ public class DbAccess { <para>This access layer may be tested independently from handling catalog instances:</para> - <programlisting language="none">package dom/xsl; + <programlisting language="java">package dom.xsl; public class DbAccessDriver { @@ -3716,7 +3716,7 @@ public class DbAccessDriver { xlink:href="http://www.saxproject.org">SAX</acronym> handler:</para> - <programlisting language="none">package sax.rdbms; + <programlisting language="java">package sax.rdbms; ... public class HtmlEventHandler extends DefaultHandler{ public void startDocument() { diff --git a/Doc/Sda1/jpaintro.xml b/Doc/Sda1/jpaintro.xml index 58135b472..97526fed5 100644 --- a/Doc/Sda1/jpaintro.xml +++ b/Doc/Sda1/jpaintro.xml @@ -248,7 +248,7 @@ Hibernate: being defined in <filename>persistence.xml</filename>:</para> - <programlisting language="none"><property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/hdm" /> + <programlisting language="xml"><property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/hdm" /> <property name="javax.persistence.jdbc.user" value="hdmuser" /> <property name="javax.persistence.jdbc.password" value="XYZ" /> <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" /></programlisting> diff --git a/Doc/Sda1/sax.xml b/Doc/Sda1/sax.xml index 455595ac1..4e11832ed 100644 --- a/Doc/Sda1/sax.xml +++ b/Doc/Sda1/sax.xml @@ -66,7 +66,7 @@ <figure xml:id="simpleCatalog"> <title>A <xref linkend="glo_XML"/> based catalog.</title> - <programlisting language="none"><catalog> + <programlisting language="xml"><catalog> <item orderNo="<emphasis role="bold">3218</emphasis>">Swinging headset</item> <item orderNo="<emphasis role="bold">9921</emphasis>">200W Stereo Amplifier</item> </catalog></programlisting> @@ -80,7 +80,7 @@ <figure xml:id="saxRdbmsSchema"> <title>A Relation containing price information.</title> - <programlisting language="none">CREATE TABLE Product ( + <programlisting language="sql">CREATE TABLE Product ( orderNo CHAR(10) PRIMARY KEY ,price Money ) @@ -99,7 +99,7 @@ INSERT INTO Product VALUES('<emphasis role="bold">9921</emphasis>', 121.50)</pro <figure xml:id="saxPriceOut"> <title>HTML generated output.</title> - <programlisting language="none"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + <programlisting language="xml"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head><title>Available products</title></head> <body> @@ -299,7 +299,7 @@ INSERT INTO Product VALUES('<emphasis role="bold">9921</emphasis>', 121.50)</pro <figure xml:id="saxElementCount"> <title>Counting XML elements.</title> - <programlisting language="none">package sax.stat.v1; + <programlisting language="java">package sax.stat.v1; ... public class ElementCount { @@ -333,7 +333,7 @@ public class ElementCount { <para>We now explain this application in detail. The first part deals with the instantiation of a parser:</para> - <programlisting language="none">try { + <programlisting language="java">try { final SAXParserFactory saxPf = <emphasis role="bold">SAXParserFactory</emphasis>.newInstance(); final SAXParser saxParser = saxPf.newSAXParser(); saxParser.parse(uri, eventHandler); @@ -353,7 +353,7 @@ public class ElementCount { something meaningful when a XML document gets parsed. For this purpose our application supplies an event handler instance:</para> - <programlisting language="none">public void parse(final String uri) { + <programlisting language="java">public void parse(final String uri) { try { final SAXParserFactory saxPf = SAXParserFactory.newInstance(); final SAXParser saxParser = saxPf.newSAXParser(); @@ -366,7 +366,7 @@ public class ElementCount { <para>What does the event handler actually do? It offers methods to the parser being callable during the parsing process:</para> - <programlisting language="none">package sax.stat.v1; + <programlisting language="java">package sax.stat.v1; ... public class MyEventHandler extends <classname>org.xml.sax.helpers.DefaultHandler</classname> { @@ -459,7 +459,7 @@ public class MyEventHandler extends <classname>org.xml.sax.helpers.DefaultHandle the whole process and print out the desired number of elements upon completion of a parsing run:</para> - <programlisting language="none">package sax.stat.v1; + <programlisting language="java">package sax.stat.v1; public class ElementCountDriver { public static void main(String argv[]) { @@ -598,7 +598,7 @@ Closing Document <classname>org.xml.sax.ErrorHandler</classname> being part of the <acronym xlink:href="http://www.saxproject.org">SAX</acronym> API:</para> - <programlisting language="none">package sax.stat.v2; + <programlisting language="java">package sax.stat.v2; ... public class MyErrorHandler implements ErrorHandler { @@ -627,7 +627,7 @@ public class MyErrorHandler implements ErrorHandler { <figure xml:id="saxMissItem"> <title>A non well formed document.</title> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <catalog> <item orderNo="3218">Swinging headset</item> <item orderNo="9921">200W Stereo Amplifier @@ -651,7 +651,7 @@ element starting on line 4.</programlisting> snippet we also register a content handler instance to the parser and thus separate the parser's configuration from its invocation:</para> - <programlisting language="none">package sax.stat.v2; + <programlisting language="java">package sax.stat.v2; ... public class ElementCount { public ElementCount() @@ -750,7 +750,7 @@ public class ElementCount { solution may ask for the set of all defined attributes and show their values:</para> - <programlisting language="none">package sax; + <programlisting language="java">package sax; public class AttribEventHandler extends DefaultHandler { @@ -797,7 +797,7 @@ Content " ...</programlisting> names being present in an arbitrary XML document. Consider the following example:</para> - <programlisting language="none"><memo> + <programlisting language="xml"><memo> <from> <name>Martin</name> <surname>Goik</surname> @@ -851,7 +851,7 @@ Content " ...</programlisting> <answer> <para>A suitable handler reads:</para> - <programlisting language="none">package sax.count; + <programlisting language="java">package sax.count; import java.util.SortedSet; import java.util.TreeSet; @@ -889,7 +889,7 @@ public class ListTagNamesHandler extends DefaultHandler { <para>A complete application requires a driver:</para> - <programlisting language="none">package sax.count; + <programlisting language="java">package sax.count; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; @@ -934,7 +934,7 @@ public class Driver { <question> <para>We reconsider the following memo instance:</para> - <programlisting language="none"><memo> + <programlisting language="xml"><memo> <from> <name>Martin</name> <surname>Goik</surname> @@ -1023,7 +1023,7 @@ Subject: Firewall problems</programlisting> </question> <answer> - <programlisting language="none">package sax.view; + <programlisting language="java">package sax.view; ... /** A view on memo documents restricting to sender name an subject. */ public class MemoViewHandler extends DefaultHandler { @@ -1091,7 +1091,7 @@ public class MemoViewHandler extends DefaultHandler { <para>Consider the following <xref linkend="glo_XHTML"/> document instance example:</para> - <programlisting language="none"><html xmlns='http://www.w3.org/1999/xhtml'> + <programlisting language="xml"><html xmlns='http://www.w3.org/1999/xhtml'> <head> <title>A simple image</title> </head> @@ -1140,7 +1140,7 @@ Found image element 'c.gif' having attribute align='bottom' <para>Consider the following <xref linkend="glo_XHTML"/> document instance example:</para> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml"> @@ -1243,7 +1243,7 @@ Document contains 2 inline <img> elements.</programlisting> <figure xml:id="saxNotValid"> <title>An invalid XML document.</title> - <programlisting language="none"><xs:element name="catalog"> + <programlisting language="xml"><xs:element name="catalog"> <xs:complexType> <xs:sequence> <xs:element ref="item"/> @@ -1257,7 +1257,7 @@ Document contains 2 inline <img> elements.</programlisting> </xs:complexType> </xs:element></programlisting> - <programlisting language="none"><catalog> + <programlisting language="xml"><catalog> <item orderNo="3218">Swinging headset</item> <item orderNo="9921">200W Stereo Amplifier</item> <emphasis role="bold"><!-- second entry forbidden by schema --></emphasis> @@ -1276,7 +1276,7 @@ Document contains 2 inline <img> elements.</programlisting> schema. The parser will not report any error or warning. In order to enable validation we need to configure our parser:</para> - <programlisting language="none">xmlReader.setFeature("http://xml.org/sax/features/validation", true);</programlisting> + <programlisting language="java">xmlReader.setFeature("http://xml.org/sax/features/validation", true);</programlisting> <para>The string <code>http://xml.org/sax/features/validation</code> serves as a key. Since this is an ordinary string value a parser may or @@ -1312,7 +1312,7 @@ Document contains 2 inline <img> elements.</programlisting> process various catalog file formats. Maven based project allow the corresponding library import by adding the following dependency:</para> - <programlisting language="none"><dependency> + <programlisting language="xml"><dependency> <groupId>xml-resolver</groupId> <artifactId>xml-resolver</artifactId> <version>1.2</version> @@ -1339,7 +1339,7 @@ prefer=public</programlisting> the resolver to our SAX parser instance <coref linkend="resolverRegister"/>:</para> - <programlisting language="none">xmlReader = saxParser.getXMLReader(); + <programlisting language="java">xmlReader = saxParser.getXMLReader(); // Set up resolving PUBLIC identifier final CatalogManager cm = new CatalogManager("<emphasis role="bold">CatalogManager.properties</emphasis>" <co @@ -1357,7 +1357,7 @@ prefer=public</programlisting> xlink:href="http://www.saxproject.org">SAX</acronym> parsing features:</para> - <programlisting language="none">xmlReader = saxParser.getXMLReader(); + <programlisting language="java">xmlReader = saxParser.getXMLReader(); xmlReader.setFeature("http://xml.org/sax/features/namespaces", true); xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);</programlisting> @@ -1366,7 +1366,7 @@ xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);</p class="starttag">xsl:for-each</tag> are also passed and may be used by an application:</para> - <programlisting language="none">package sax; + <programlisting language="java">package sax; ... public class NamespaceEventHandler extends DefaultHandler { ... @@ -1380,7 +1380,7 @@ public class NamespaceEventHandler extends DefaultHandler { <para>As an example we take a XSLT script:</para> - <programlisting language="none"><?xml version="1.0" encoding="utf-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:fo='http://www.w3.org/1999/XSL/Format'> @@ -1449,7 +1449,7 @@ localName='HTML'</programlisting> <title>A sample catalog containing products and corresponding descriptions.</title> - <programlisting language="none"><xs:element name="catalog"> + <programlisting language="xml"><xs:element name="catalog"> <xs:complexType> <xs:sequence> <xs:element ref="product" minOccurs="0" maxOccurs="unbounded"/> @@ -1468,7 +1468,7 @@ localName='HTML'</programlisting> </xs:complexType> </xs:element></programlisting> - <programlisting language="none"><catalog ... xsi:noNamespaceSchemaLocation="catalog.xsd"> + <programlisting language="xml"><catalog ... xsi:noNamespaceSchemaLocation="catalog.xsd"> <product id="mpt"> <name>Monkey Picked Tea</name> <description>Rare wild Chinese tea</description> @@ -1541,7 +1541,7 @@ localName='HTML'</programlisting> these statements as a blueprint to be generated by your <xref linkend="glo_SAX"/> application:</para> - <programlisting language="none"><emphasis role="bold">INSERT INTO Product VALUES ('mpt', 'Monkey picked tea', NULL);</emphasis> + <programlisting language="sql"><emphasis role="bold">INSERT INTO Product VALUES ('mpt', 'Monkey picked tea', NULL);</emphasis> INSERT INTO Description VALUES('mpt', 0, 'Picked only by specially trained monkeys'); INSERT INTO Description VALUES('mpt', 1, 'Rare wild Chinese tea'); @@ -1674,7 +1674,7 @@ INSERT INTO Description VALUES('instantTent', 2, 'Exclusive WeatherTec system.') document instances. Consider the following XSL sample document containing <xref linkend="glo_XHTML"/>:</para> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" <co xml:id="xhtmlCombinedNs_Svg"/> diff --git a/Doc/Sda1/vaadin.xml b/Doc/Sda1/vaadin.xml index ae7a0fe4e..0bd4f6e70 100644 --- a/Doc/Sda1/vaadin.xml +++ b/Doc/Sda1/vaadin.xml @@ -30,7 +30,7 @@ xlink:href="http://vaadin.com/nexus/#nexus-search">http://vaadin.com/nexus/#nexus-search</link> tells us:</para> - <programlisting language="none"><dependency> + <programlisting language="xml"><dependency> <groupId>com.vaadin</groupId> <artifactId>vaadin-cdi</artifactId> <version>1.0.2</version> @@ -46,7 +46,7 @@ want to adjust its scan interval for automatic application redeployment in <filename>pom.xml</filename>:</para> - <programlisting language="none"><plugin> + <programlisting language="xml"><plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.3.0.v20150612</version> diff --git a/Doc/Sda1/xmlintro.xml b/Doc/Sda1/xmlintro.xml index b8c0b1f84..3ed2f09ee 100644 --- a/Doc/Sda1/xmlintro.xml +++ b/Doc/Sda1/xmlintro.xml @@ -168,7 +168,7 @@ <figure xml:id="memoWellFormed"> <title>The representation of a short message.</title> - <programlisting language="none"><?xml<co + <programlisting language="xml"><?xml<co xml:id="first_xml_code_magic"/> version="1.0"<co xml:id="first_xml_code_version"/> encoding="UTF-8"<co xml:id="first_xml_code_encoding"/>?> @@ -262,7 +262,7 @@ Parsing was successful</errortext></programlisting> <title>An invalid XML document due to the omission of <tag class="endtag">from</tag>.</title> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <memo> <from>M. Goik <co xml:id="omitFromMissingElement"/> <to>B. King</to> @@ -294,7 +294,7 @@ must be terminated by the matching end-tag "</from>". parsing error</error <para>Even if every XML element has a closing counterpart the resulting XML may be invalid:</para> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <memo> <from>M. Goik<to>B. King</from></to> <to>A. June</to> @@ -314,7 +314,7 @@ terminated by the matching end-tag "</to>". parsing error</computeroutput> closed. Actually this violates the expressibility of XML documents as a tree like structure. The situation may be resolved by choosing:</para> - <programlisting language="none">...<from>M. Goik<to>B. King</to></from>...</programlisting> + <programlisting language="xml">...<from>M. Goik<to>B. King</to></from>...</programlisting> <para>We provide two examples illustrating proper and improper nesting of XML documents:</para> @@ -354,7 +354,7 @@ terminated by the matching end-tag "</to>". parsing error</computeroutput> <figure xml:id="memoWellAttrib"> <title>An XML document with attributes.</title> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <memo date="10.02.2006" priority="high"> <from>M. Goik</from> <to>B. King</to> @@ -473,7 +473,7 @@ terminated by the matching end-tag "</to>". parsing error</computeroutput> <informalfigure xml:id="exampleSingleDoubleQuotes"> <para>Quotes as part of attribute values.</para> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <test> <person name='Gary "King" Mandelson'/> <!-- o.k. --> <person name="Gary 'King' Mandelson"/> <!-- o.k. --> diff --git a/Doc/Sda1/xmlschema.xml b/Doc/Sda1/xmlschema.xml index 620759454..25882fcb4 100644 --- a/Doc/Sda1/xmlschema.xml +++ b/Doc/Sda1/xmlschema.xml @@ -151,7 +151,7 @@ <figure xml:id="figure_memo_dtd"> <title>A schema to describe memo documents.</title> - <programlisting language="none"><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" + <programlisting language="xml"><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" vc:minVersion="1.0" vc:maxVersion="1.1"> @@ -317,7 +317,7 @@ <title>A memo document instance holding a reference to a document external schema.</title> - <programlisting language="none"><memo <co + <programlisting language="xml"><memo <co xml:id="memo_external_dtd_top_element"/> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="memo.xsd" <co xml:id="memo_external_dtd_url"/> @@ -385,7 +385,7 @@ <figure xml:id="memoDtdOnFtp"> <title>A schema reference to a FTP server.</title> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <memo ... xsi:noNamespaceSchemaLocation="https://someserver.org/memo.xsd"> <from>M. Goik</from> ... @@ -560,7 +560,7 @@ if the Memo schema is expected to grow in complexity. A simple sketch reads:</para> - <programlisting language="none">import java.util.Date; + <programlisting language="java">import java.util.Date; import java.util.SortedSet; public class Memo { @@ -593,7 +593,7 @@ public class Memo { <para>Our schema defines:</para> - <programlisting language="none"><xs:simpleType name="Priority"> + <programlisting language="xml"><xs:simpleType name="Priority"> <xs:restriction base="xs:string"> <xs:enumeration value="low"/> <xs:enumeration value="medium"/> @@ -604,7 +604,7 @@ public class Memo { <para>Starting from <xref linkend="glo_Java"/> 1.5 we may implement this constraint by a type safe enumeration:</para> - <programlisting language="none">public enum Priority {low, standard, high};</programlisting> + <programlisting language="java">public enum Priority {low, standard, high};</programlisting> </answer> </qandaentry> </qandadiv> @@ -656,7 +656,7 @@ public class Memo { <figure xml:id="figure_book.dtd_v1"> <title>A first schema version for book documents</title> - <programlisting language="none"><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" + <programlisting language="xml"><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" vc:minVersion="1.0" vc:maxVersion="1.1"> @@ -687,7 +687,7 @@ public class Memo { <para>We supply a valid document instance:</para> <informalfigure xml:id="bookInitialInstance"> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="book.xsd"> <title>Introduction to Java</title> @@ -765,7 +765,7 @@ public class Memo { <answer> <para>A possible schema implementation:</para> - <programlisting language="none"><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" + <programlisting language="xml"><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" vc:minVersion="1.0" vc:maxVersion="1.1"> @@ -825,7 +825,7 @@ public class Memo { <para>An example data set:</para> - <programlisting language="none"><data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + <programlisting language="xml"><data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="invoice.xsd"> <customer id="5"> <name>Clarke Jefferson</name> @@ -897,7 +897,7 @@ public class Memo { <para>The following XML example instance may guide you towards an <filename>airline.xsd</filename> schema:</para> - <programlisting language="none"><top xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + <programlisting language="xml"><top xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="airline.xsd"> <airlines> <airline airlineCode="DLH" id="1"> @@ -943,7 +943,7 @@ public class Memo { </question> <answer> - <programlisting language="none"><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" + <programlisting language="xml"><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" vc:minVersion="1.1"> @@ -1130,7 +1130,7 @@ public class Memo { <question> <para>Consider the following product catalog example:</para> - <programlisting language="none"><catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + <programlisting language="xml"><catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="catalog.xsd"> <title>Outdoor products</title> <introduction> @@ -1198,7 +1198,7 @@ public class Memo { </question> <answer> - <programlisting language="none"><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" + <programlisting language="xml"><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" vc:minVersion="1.0" vc:maxVersion="1.1"> @@ -1295,7 +1295,7 @@ public class Memo { <para>The following sample document instance shall be valid:</para> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="catalog.xsd"> <title>Introduction to Java</title> @@ -1324,7 +1324,7 @@ public class Memo { <figure xml:id="paraListEmphasize"> <title>Version 2 of book.xsd</title> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" vc:minVersion="1.0" vc:maxVersion="1.1"> @@ -1501,7 +1501,7 @@ public class Memo { <para>We define a suitable <tag class="starttag">xs:attribute</tag> type:</para> - <programlisting language="none"><xs:attribute <emphasis + <programlisting language="xml"><xs:attribute <emphasis role="bold">name="lang"</emphasis>> <xs:simpleType> <xs:restriction base="xs:string"> @@ -1517,7 +1517,7 @@ public class Memo { <para>Than we add this attribute to our elements like <tag class="starttag">chapter</tag> and others:</para> - <programlisting language="none"> <xs:element name="chapter"> + <programlisting language="xml"> <xs:element name="chapter"> <xs:complexType> <xs:sequence> ... </xs:sequence> <xs:attribute <emphasis role="bold">ref="lang"</emphasis> use="optional"/> @@ -1529,7 +1529,7 @@ public class Memo { level. But of course we may define it on top level as well:</para> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <book ... lang="english"> <title>Introduction to Java</title> ...</programlisting> @@ -1551,7 +1551,7 @@ public class Memo { <para>We recall the problem of nested quotes yielding non-well formed XML code:</para> - <programlisting language="none"><img src="bold.gif" alt="We may use "quotes" here" /></programlisting> + <programlisting language="xml"><img src="bold.gif" alt="We may use "quotes" here" /></programlisting> <para>The XML specification defines legal attribute value definitions as:</para> @@ -1647,14 +1647,14 @@ public class Memo { <para>We may take advantage of the second rule:</para> - <programlisting language="none"><img src="bold.gif" alt='We may use "quotes" here' /></programlisting> + <programlisting language="xml"><img src="bold.gif" alt='We may use "quotes" here' /></programlisting> <para>Notice that according to <xref linkend="w3RecXml_NT-AttValue"/> the delimiting quotes must not be mixed. The following code is thus not well formed:</para> - <programlisting language="none"><img src="bold.gif'/></programlisting> + <programlisting language="xml"><img src="bold.gif'/></programlisting> </answer> </qandaentry> </qandadiv> @@ -1694,7 +1694,7 @@ public class Memo { <answer> <para>We extend our schema:</para> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" vc:minVersion="1.0" vc:maxVersion="1.1"> diff --git a/Doc/Sda1/xslt.xml b/Doc/Sda1/xslt.xml index 6c3dace0b..a8de2b169 100644 --- a/Doc/Sda1/xslt.xml +++ b/Doc/Sda1/xslt.xml @@ -56,7 +56,7 @@ <para>We start from an extended version of our <filename>memo.xsd</filename>:</para> - <programlisting language="none"><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" + <programlisting language="xml"><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" vc:minVersion="1.0" vc:maxVersion="1.1"> @@ -125,7 +125,7 @@ <figure xml:id="figure_memoref_instance"> <title>A memo document instance with an internal reference.</title> - <programlisting language="none"><memo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + <programlisting language="xml"><memo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="memo.xsd" date="2014-09-24" priority="high" > <from <emphasis role="bold">id="goik"</emphasis>>Martin Goik</from> @@ -145,7 +145,7 @@ xlink:href="http://www.w3.org/Style/XSL">XSL</abbrev> this task can be accomplished by a script <filename>memo2sender.xsl</filename>:</para> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> @@ -193,7 +193,7 @@ Martin Goik</computeroutput></programlisting> xlink:href="http://www.w3.org/Style/XSL">XSL</abbrev> example code:</para> - <programlisting language="none"><xsl:stylesheet <co + <programlisting language="xml"><xsl:stylesheet <co xml:id="programlisting_helloxsl_stylesheet"/> xmlns:xsl <co xml:id="programlisting_helloxsl_namespace_abbv"/> ="http://www.w3.org/1999/XSL/Transform" version="2.0" <co xml:id="programlisting_helloxsl_xsl_version"/> > @@ -351,7 +351,7 @@ Martin Goik</computeroutput></programlisting> <figure xml:id="programlisting_tolist_xpath"> <title>Iterating over the list of recipient nodes.</title> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> @@ -555,7 +555,7 @@ Martin Goik</computeroutput></programlisting> <figure xml:id="programlisting_memo_export_sql"> <title>Exporting SQL statements.</title> - <programlisting language="none">... + <programlisting language="xml">... <xsl:variable name="newline" <co xml:id="programlisting_xsl_if_definevar"/>> <!-- A newline \n --> <xsl:text> </xsl:text> @@ -684,7 +684,7 @@ INSERT INTO Customer (id, name) VALUES ('eve', 'Eve intruder')</computeroutput>< comparison <code>10 < 10</code> will evaluate to false:</para> - <programlisting language="none"><xsl:for-each select="memo/to"> + <programlisting language="xml"><xsl:for-each select="memo/to"> <xsl:value-of select="."/> <xsl:if test="position() &lt; last()"> <xsl:text>,</xsl:text> @@ -715,7 +715,7 @@ INSERT INTO Customer (id, name) VALUES ('eve', 'Eve intruder')</computeroutput>< xlink:href="http://www.w3.org/TR/xpath">XPath</abbrev> in the <tag class="element">for-each</tag>:</para> - <programlisting language="none"><xsl:for-each select="<emphasis + <programlisting language="xml"><xsl:for-each select="<emphasis role="bold">from[@id]|to[@id]</emphasis>"> <xsl:text>INSERT INTO Customer (id, name) VALUES ('</xsl:text> <xsl:value-of select="@id"/> @@ -740,7 +740,7 @@ INSERT INTO Customer (id, name) VALUES ('eve', 'Eve intruder')</computeroutput>< formatting rules at a centralized location. So the solution to <xref linkend="example_position_last"/> in an equivalent way:</para> - <programlisting language="none"><xsl:template match="/"> + <programlisting language="xml"><xsl:template match="/"> <xsl:apply-templates select="memo/to" <co xml:id="programlisting_apply_templates_apply"/>/> </xsl:template> @@ -797,7 +797,7 @@ INSERT INTO Customer (id, name) VALUES ('eve', 'Eve intruder')</computeroutput>< count <emphasis>good</emphasis> programmers tend to define a separate method. For example:</para> - <programlisting language="none">for (int i = 0; i < 10; i++){ + <programlisting language="java">for (int i = 0; i < 10; i++){ if (a[i] < b[i]){ max[i] = b; } else { @@ -810,7 +810,7 @@ INSERT INTO Customer (id, name) VALUES ('eve', 'Eve intruder')</computeroutput>< variables gets computed. This may be needed at several locations and thus it is convenient to centralize this code into a method:</para> - <programlisting language="none">// cf. <xsl:template match="..."> + <programlisting language="xml">// cf. <xsl:template match="..."> static int maximum(int a, int b){ if (a < b){ return b; @@ -834,7 +834,7 @@ for (int i = 0; i < 10; i++){ format a set of nodes. It does not contain information about any rules being defined to do this job:</para> - <programlisting language="none"><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + <programlisting language="xml"><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="text"/> @@ -860,7 +860,7 @@ broken! This bug has been reported by the sender.</computeroutput></programlisti thus good programming practice during style sheet development to define a special template catching forgotten rules:</para> - <programlisting language="none"><xsl:template match="/memo"> + <programlisting language="xml"><xsl:template match="/memo"> <xsl:apply-templates select="content"/> </xsl:template> @@ -919,7 +919,7 @@ broken! This bug has been reported by the sender.</computeroutput></programlisti <para>We define two templates differing only in the static string value for a person's type. The relevant <abbrev xlink:href="http://www.w3.org/Style/XSL">XSL</abbrev> portion - reads:<programlisting language="none"><xsl:template match="/memo"> + reads:<programlisting language="xml"><xsl:template match="/memo"> <xsl:apply-templates select="from|to"/> </xsl:template> @@ -994,7 +994,7 @@ broken! This bug has been reported by the sender.</computeroutput></programlisti including an optional final <code>else</code> block being reached if all boolean tests fail:</para> - <programlisting language="none">if (condition a){ + <programlisting language="java">if (condition a){ ...//block 1 } else if (condition b){ ... //block b @@ -1019,7 +1019,7 @@ IV: ... xlink:href="http://www.w3.org/TR/xslt20/#convert">a better way</link> we may generate these number literals by:</para> - <programlisting language="none"><xsl:template match="/memo"> + <programlisting language="xml"><xsl:template match="/memo"> <xsl:apply-templates select="to"/> </xsl:template> @@ -1070,7 +1070,7 @@ IV: ... xlink:href="http://www.w3.org/Style/XSL">XSL</abbrev> style sheet:</para> - <programlisting language="none"><xsl:output method="xhtml" indent="yes"/> + <programlisting language="xml"><xsl:output method="xhtml" indent="yes"/> <xsl:template match="/memo"> <html> @@ -1094,7 +1094,7 @@ IV: ... <para>Processing this style sheet for a <tag class="starttag">memo</tag> document instance yields:</para> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <html> <head> <title>Recipient list</title> @@ -1111,14 +1111,14 @@ IV: ... DTD. We may supply this reference by modifying our <tag class="emptytag">xsl:output</tag> directive:</para> - <programlisting language="none"><xsl:output method="xhtml" indent="yes" + <programlisting language="xml"><xsl:output method="xhtml" indent="yes" <emphasis role="bold">doctype-public</emphasis>="-//W3C//DTD XHTML 1.0 Strict//EN" <emphasis role="bold">doctype-system</emphasis>="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/></programlisting> <para>This adds a corresponding header which allows to validate the generated HTML:</para> - <programlisting language="none"><!DOCTYPE html + <programlisting language="xml"><!DOCTYPE html PUBLIC "<emphasis role="bold">-//W3C//DTD XHTML 1.0 Strict//EN</emphasis>" "<emphasis role="bold">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</emphasis>"> <html><head> ...</programlisting> @@ -1128,7 +1128,7 @@ IV: ... xlink:href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</uri> as default namespace:</para> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet <emphasis role="bold">xmlns="http://www.w3.org/1999/xhtml"</emphasis> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> @@ -1144,7 +1144,7 @@ IV: ... <para>This yields the following output::</para> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> @@ -1184,7 +1184,7 @@ IV: ... </question> <answer> - <programlisting language="none"><?xml version="1.0" encoding="UTF-8"?> + <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output indent="yes" method="xhtml"/> @@ -1225,11 +1225,11 @@ IV: ... <quote>red</quote> if a memo has a priority value of <tag class="attvalue">high</tag>:</para> - <programlisting language="none"><h1 style="background:red">Firewall problems</h1></programlisting> + <programlisting language="xml"><h1 style="background:red">Firewall problems</h1></programlisting> <para>Regarding our memo example this may be achieved by:</para> - <programlisting language="none"><xsl:template match="/memo"> + <programlisting language="xml"><xsl:template match="/memo"> <html> ... <body> @@ -1279,7 +1279,7 @@ IV: ... name of an attribute to be added together with an attribute value specification:</para> - <programlisting language="none"><xsl:template match="/memo"> + <programlisting language="xml"><xsl:template match="/memo"> <html> ... <h1> @@ -1347,7 +1347,7 @@ IV: ... for this purpose. As stated before this value is definitively unique:</para> - <programlisting language="none"><xsl:template match="/book"> + <programlisting language="xml"><xsl:template match="/book"> ... <body> <h1><xsl:value-of select="title"/></h1> @@ -1423,7 +1423,7 @@ IV: ... containing <tag class="starttag">url</tag> and <tag class="starttag">emphasis</tag> child nodes:</para> - <programlisting language="none"><content>The <emphasis + <programlisting language="xml"><content>The <emphasis role="bold"><url href="http://w3.org/XML">XML</url></emphasis> language is <emphasis role="bold"><emphasis>easy</emphasis></emphasis> to learn. However you need some <emphasis role="bold"><emphasis>time</emphasis></emphasis>.</content></programlisting> @@ -1432,14 +1432,14 @@ IV: ... distinguish them from <code>xs:text</code> nodes. A possible <acronym>XHtml</acronym> output might look like:</para> - <programlisting language="none"><p>The <emphasis role="bold"><a href="http://w3.org/XML">XML</a>language is<em>easy</em></emphasis> to learn. However you + <programlisting language="xml"><p>The <emphasis role="bold"><a href="http://w3.org/XML">XML</a>language is<em>easy</em></emphasis> to learn. However you need some <emphasis role="bold"><em>time</em></emphasis>.</p></programlisting> <para>We start with a first version of an <abbrev xlink:href="http://www.w3.org/Style/XSL">XSL</abbrev> template:</para> - <programlisting language="none"> <xsl:template match="content"> + <programlisting language="xml"> <xsl:template match="content"> <p> <xsl:value-of select="."/> </p> @@ -1448,13 +1448,13 @@ need some <emphasis role="bold"><em>time</em></emphasis>.</p>< <para>As mentioned earlier all <code>#PCDATA</code> text nodes of the whole subtree are glued together leading to:</para> - <programlisting language="none"><p>The XML language is easy to learn. However you need some time.</p></programlisting> + <programlisting language="xml"><p>The XML language is easy to learn. However you need some time.</p></programlisting> <para>Our next attempt is to define templates to format the elements <tag class="starttag">url</tag> and <tag class="starttag">emphasis</tag>:</para> - <programlisting language="none">... + <programlisting language="xml">... <xsl:template match="content"> <p> <xsl:apply-templates select="emphasis|url"/> @@ -1474,7 +1474,7 @@ need some <emphasis role="bold"><em>time</em></emphasis>.</p>< Unfortunately the <code>#PCDATA</code> text nodes between the element nodes are lost:</para> - <programlisting language="none"><p> + <programlisting language="xml"><p> <a href="http://w3.org/XML">XML</a> <em>easy</em> <em>time</em> @@ -1488,7 +1488,7 @@ need some <emphasis role="bold"><em>time</em></emphasis>.</p>< for this purpose. It returns the boolean value <code>true</code> for an argument node of type text:</para> - <programlisting language="none">... + <programlisting language="xml">... <xsl:template match="content"> <p> <xsl:apply-templates select="<emphasis role="bold">text()</emphasis>|emphasis|url"/> @@ -1499,7 +1499,7 @@ need some <emphasis role="bold"><em>time</em></emphasis>.</p>< <para>The yields the desired output. The text node result elements are shown in bold style</para> - <programlisting language="none"><p><emphasis role="bold">The</emphasis> <a href="http://w3.org/XML">XML</a><emphasis + <programlisting language="xml"><p><emphasis role="bold">The</emphasis> <a href="http://w3.org/XML">XML</a><emphasis role="bold"> language is </emphasis><em>easy</em><emphasis role="bold"> to learn. However you need some </emphasis><em>time</em><emphasis role="bold">.</emphasis></p></programlisting> @@ -1513,7 +1513,7 @@ you need some </emphasis><em>time</em><emphasis role="bold">.</empha expression <code>select="text()|emphasis|url"</code> corresponds nicely to the schema's content model definition:</para> - <programlisting language="none"><xs:element name="content"> + <programlisting language="xml"><xs:element name="content"> <xs:complexType <emphasis role="bold">mixed="true"</emphasis>> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element <emphasis role="bold">ref="emphasis"</emphasis>/> @@ -1548,7 +1548,7 @@ you need some </emphasis><em>time</em><emphasis role="bold">.</empha output. We may however redefine this default rule by adding a template:</para> - <programlisting language="none"><xsl:template match="text()"> + <programlisting language="xml"><xsl:template match="text()"> <emphasis role="bold"><span style="color:red"> <xsl:value-of select="."/> </span></emphasis> @@ -1556,7 +1556,7 @@ you need some </emphasis><em>time</em><emphasis role="bold">.</empha <para>This yields:</para> - <programlisting language="none"><p> + <programlisting language="xml"><p> <emphasis role="bold"><span style="color:red">The </span></emphasis> <a href="http://w3.org/XML">XML</a> <emphasis role="bold"><span style="color:red"> language is </span></emphasis> @@ -1590,7 +1590,7 @@ you need some </emphasis><em>time</em><emphasis role="bold">.</empha create <acronym>XHtml</acronym>l documents from <tag class="starttag">catalog</tag> instances:</para> - <programlisting language="none" xml:lang=""><xsl:template match="/catalog"> + <programlisting language="xml" xml:lang=""><xsl:template match="/catalog"> <html> <head><title>Product catalog</title></head> <body> @@ -1638,13 +1638,13 @@ you need some </emphasis><em>time</em><emphasis role="bold">.</empha document instance containing a <tag class="starttag">link ref="homeTrainer"</tag> reference will be formatted as:</para> - <programlisting language="none"><p>If you hate rain look <a href="#homeTrainer">here</a>.</p></programlisting> + <programlisting language="xml"><p>If you hate rain look <a href="#homeTrainer">here</a>.</p></programlisting> <para>Now suppose we want to add the product's title <emphasis>Home trainer</emphasis> here to give the reader an idea about the product without clicking the hypertext link:</para> - <programlisting language="none"><p>If you hate rain look <a href="#homeTrainer">here</a> <emphasis + <programlisting language="xml"><p>If you hate rain look <a href="#homeTrainer">here</a> <emphasis role="bold">(Home trainer)</emphasis>.</p></programlisting> <para>This title text node is part of the <tag @@ -1673,7 +1673,7 @@ you need some </emphasis><em>time</em><emphasis role="bold">.</empha <code>ID</code> reference by means of the built in function <link xlink:href="http://www.w3.org/TR/xpath#function-id">id(...)</link>:</para> - <programlisting language="none"><xsl:template match="link"> + <programlisting language="xml"><xsl:template match="link"> <a href="#{@ref}"><xsl:value-of select="."/></a> <xsl:text> (</xsl:text> <xsl:value-of select="<emphasis role="bold">id(@ref)</emphasis>/title" <co @@ -1822,7 +1822,7 @@ you need some </emphasis><em>time</em><emphasis role="bold">.</empha model we may simply copy corresponding nodes to the output:</para> - <programlisting language="none"><xsl:template match="table"> + <programlisting language="xml"><xsl:template match="table"> <xsl:copy-of select="."/> </xsl:template></programlisting> @@ -1831,7 +1831,7 @@ you need some </emphasis><em>time</em><emphasis role="bold">.</empha resembles XHTML lists. Since the structure are compatible we only have to provide a mapping:</para> - <programlisting language="none"><xsl:template match="para"> + <programlisting language="xml"><xsl:template match="para"> <p id="{generate-id(.)}"><xsl:apply-templates select="text()|*" /></p> </xsl:template> @@ -1886,7 +1886,7 @@ you need some </emphasis><em>time</em><emphasis role="bold">.</empha linkend="programlisting_book2html_single_toclink"/> to the table of contents:</para> - <programlisting language="none"><xsl:template match="chapter"> + <programlisting language="xml"><xsl:template match="chapter"> <h2 id="{<emphasis role="bold">generate-id(.)</emphasis>}" <co xml:base="" xml:id="programlisting_book2html_single_chapterid"/>> @@ -1908,7 +1908,7 @@ you need some </emphasis><em>time</em><emphasis role="bold">.</empha linkend="section_xsl_functionid">id()</link> function and then use the target's identity value:</para> - <programlisting language="none"><xsl:template match="link"> + <programlisting language="xml"><xsl:template match="link"> <a href="#{generate-id(id(@linkend))}"> <xsl:value-of select="."/> </a> @@ -1933,7 +1933,7 @@ you need some </emphasis><em>time</em><emphasis role="bold">.</empha <para>XSL allows us to traverse a document instance's graph in different directions. We start with a memo document instance:</para> - <programlisting language="none"><memo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + <programlisting language="xml"><memo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="memo.xsd" date="9.9.2099"> <from>Joe</from> <to>Jack</to> @@ -1951,7 +1951,7 @@ you need some </emphasis><em>time</em><emphasis role="bold">.</empha line of text showing also the preceding and the following recipients:</para> - <programlisting language="none"> <----Jack----> Eve Jude Tolstoi <co + <programlisting language="xml"> <----Jack----> Eve Jude Tolstoi <co xml:id="programlisting_axis_jack"/> Jack <----Eve----> Jude Tolstoi <co xml:id="programlisting_axis_eve"/> Jack Eve <----Jude----> Tolstoi <co xml:id="programlisting_axis_jude"/> @@ -2000,7 +2000,7 @@ Jack Eve Jude <----Tolstoi----> <co our <quote>four recipient</quote> example we may create the desired output by:</para> - <programlisting language="none"><xsl:template match="/"> + <programlisting language="xml"><xsl:template match="/"> <xsl:apply-templates select="memo/to"/> </xsl:template> @@ -2100,7 +2100,7 @@ Jack Eve Jude <----Tolstoi----> <co xlink:href="http://www.w3.org/Style/XSL">XSL</abbrev> element <link xlink:href="http://www.w3.org/TR/xslt20/#element-result-document"><xsl:result-document></link>:</para> - <programlisting language="none"><xsl:template match="/memo"> + <programlisting language="xml"><xsl:template match="/memo"> <xsl:apply-templates select="to"/> </xsl:template> @@ -2182,7 +2182,7 @@ Jack Eve Jude <----Tolstoi----> <co generate the table of contents file <filename>index.html</filename>:</para> - <programlisting language="none"><xsl:template match="/"> + <programlisting language="xml"><xsl:template match="/"> <xsl:result-document href="index.html"> <xsl:apply-templates select="book"/> </xsl:result-document> @@ -2215,7 +2215,7 @@ Jack Eve Jude <----Tolstoi----> <co up</quote> from a paragraph to the corresponding chapter node:</para> - <programlisting language="none"><xsl:template match="link"> + <programlisting language="xml"><xsl:template match="link"> <xsl:variable name="reftargetNode" select="id(@linkend)"/> <xsl:variable name="reftargetParentChapter" select="$reftargetNode/ancestor-or-self::chapter"/> -- GitLab