Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlaf Otto2017-03-30 15:31:32 +0000
committerOlaf Otto2017-03-30 15:31:32 +0000
commitcc9e61328308a371792158645fd95978d1b7e8cf (patch)
tree0bb9b893dca75ce1341490c32037e3dc7d0cc368
parent93e105e5ea37827cc139a9e3ed729006084eac00 (diff)
downloadorg.eclipse.gemini.blueprint-cc9e61328308a371792158645fd95978d1b7e8cf.tar.gz
org.eclipse.gemini.blueprint-cc9e61328308a371792158645fd95978d1b7e8cf.tar.xz
org.eclipse.gemini.blueprint-cc9e61328308a371792158645fd95978d1b7e8cf.zip
Updated with regard to release of 2.1.0.M2
Signed-off-by: Olaf Otto <olaf@x100.de>
-rw-r--r--docs/pom.xml4
-rw-r--r--docs/src/docbkx/introduction/getting-started.xml8
-rw-r--r--docs/src/docbkx/introduction/what-is-new.xml62
-rw-r--r--docs/src/docbkx/reference/compendium/compendium.xml6
-rw-r--r--docs/src/docbkx/reference/deployment.xml13
-rw-r--r--docs/src/docbkx/reference/service-registry.xml41
-rw-r--r--docs/src/docbkx/resources/xsl/highlight.xsl197
7 files changed, 267 insertions, 64 deletions
diff --git a/docs/pom.xml b/docs/pom.xml
index d43078b..8b5a19f 100644
--- a/docs/pom.xml
+++ b/docs/pom.xml
@@ -16,7 +16,7 @@
<plugin>
<groupId>com.agilejava.docbkx</groupId>
<artifactId>docbkx-maven-plugin</artifactId>
- <version>2.0.7</version>
+ <version>2.0.17</version>
<executions>
<execution>
<id>single-page</id>
@@ -93,7 +93,7 @@
<entities>
<entity>
<name>version</name>
- <value>${version}</value>
+ <value>${project.version}</value>
</entity>
</entities>
</configuration>
diff --git a/docs/src/docbkx/introduction/getting-started.xml b/docs/src/docbkx/introduction/getting-started.xml
index 0035df3..a8448d2 100644
--- a/docs/src/docbkx/introduction/getting-started.xml
+++ b/docs/src/docbkx/introduction/getting-started.xml
@@ -19,10 +19,10 @@
<section id="get-started:first-steps:spring">
<title>Knowing Spring</title>
- <para>Gemini Blueprint uses heavily Spring framework's <ulink url="http://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/overview.html#overview-core-container">core</ulink> functionalty,
- such as the <ulink url="http://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/beans.html#beans-introduction">IoC</ulink> container,
- <ulink url="http://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/resources.html">resource</ulink> abstraction and
- <ulink url="http://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/aop.html">AOP</ulink> infrastructure. While it is not important
+ <para>Gemini Blueprint uses heavily Spring framework's <ulink url="http://docs.spring.io/spring/docs/4.3.x/spring-framework-reference/html/overview.html#overview-core-container">core</ulink> functionalty,
+ such as the <ulink url="http://docs.spring.io/spring/docs/4.3.x/spring-framework-reference/html/beans.html#beans-introduction">IoC</ulink> container,
+ <ulink url="http://docs.spring.io/spring/docs/4.3.x/spring-framework-reference/html/resources.html">resource</ulink> abstraction and
+ <ulink url="http://docs.spring.io/spring/docs/4.3.x/spring-framework-reference/html/aop.html">AOP</ulink> infrastructure. While it is not important
to know the Spring framework APIs, understanding the concepts behind them is. At a minimum, the idea behind IoC should be familiar.
That being said, the more knowledge you have about Spring framework, the faster you will pick Gemini Blueprint.
Besides the comprehensive documentation that explains the Spring Framework in detail,
diff --git a/docs/src/docbkx/introduction/what-is-new.xml b/docs/src/docbkx/introduction/what-is-new.xml
index b721fdd..8aaa8e3 100644
--- a/docs/src/docbkx/introduction/what-is-new.xml
+++ b/docs/src/docbkx/introduction/what-is-new.xml
@@ -1,44 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE preface PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
<chapter id="what-is-new">
- <title>What is new?</title>
+ <title>What is new?</title>
- <para>While a relatively young project, each version of Gemini Blueprint (even minor ones) offers new functionality. This chapter is a guide to the new
- and improved feature and intended as a high-level, short summary. Please follow the appropriate links for more in-depth information.</para>
-
- <note>This section includes the updates from Spring Dynamic Modules (Spring DM) project and previous gemini blueprint versions.</note>
+ <para>While a relatively young project, each version of Gemini Blueprint (even minor ones) offers new functionality. This chapter is a guide to the new
+ and improved feature and intended as a high-level, short summary. Please follow the appropriate links for more in-depth information.</para>
- <section id="dm-2.0.0">
+ <section id="gemini-blueprint-2.1.0">
+ <title>Gemini Blueprint 2.1.0+</title>
+ <section id="gemini-blueprint-2.1.0.x:jdk8">
+ <title>Java 8</title>
+ <para>Gemini Blueprint requires <ulink url="https://java.sun.com/j2se/1.8.0/">JDK 7</ulink> to run (or compile). The framework code has been
+ revised to take advantage of the JDK 8 features.</para>
+ </section>
+ <section id="gemini-blueprint-2.1.x:spring-4.3.x">
+ <title>Spring 4.3.x</title>
+ <para>Besides the Java 8 upgrade, Gemini Blueprint requires Spring 4.3.x to get access to the latest framework features and JDK optimizations.</para>
+ </section>
+ <section id="gemini-blueprint-2.1.x:gemini-blueprint-extensions">
+ <title>Gemini Blueprint Extensions</title>
+ <para>With 2.1, gemini blueprint ships the gemini-blueprint-extensions bundle, supporting the @ServiceReference
+ annotation on fields and setter methods to inject service references without using a service import in the blueprint context's XML declaration.
+ See <xref linkend="service-registry:annotations-vs-xml-declarations"/> for more information.</para>
+ </section>
+ </section>
+
+ <section id="gemini-blueprint-2.0.0">
<title>Gemini Blueprint 2.0.0+</title>
- <section id="dm-2.0.0.x:blueprint">
+ <section id="gemini-blueprint-2.0.0.x:blueprint">
<title>OSGi 5.x Blueprint Reference Implementation (RI)</title>
<para>Gemini Blueprint served as the basis for the Blueprint Container specification, introduced by OSGi 5 Gemini Blueprint stands as the RI for the
aforementioned specification, providing the Blueprint API and implementation out of the box. Various aspect of Gemini Blueprint have been adjusted for
consistency to the Blueprint specification. For more information on the two models, see <xref linkend="blueprint"/> for more information.</para>
</section>
- <section id="dm-2.0.0.x:jdk5">
+ <section id="gemini-blueprint-2.0.0.x:jdk5">
<title>Java 7</title>
<para>Gemini Blueprint requires <ulink url="https://java.sun.com/j2se/1.7.0/">JDK 7</ulink> to run (or compile). The framework code has been
revised to take advantage of the JDK 7 features.</para>
</section>
- <section id="dm-2.0.x:spring-3.x">
+ <section id="gemini-blueprint-2.0.x:spring-4.2.x">
<title>Spring 4.2.x</title>
<para>Besides the Java 7 upgrade, Gemini Blueprint requires Spring 4.2.x to get access to the latest framework features and JDK optimizations.</para>
</section>
</section>
- <section id="dm-2.0.x">
+ <section id="gemini-blueprint-2.0.x">
<title>Gemini Blueprint 1.x</title>
- <section id="dm-2.0.x:blueprint">
+ <section id="gemini-blueprint-2.0.x:blueprint">
<title>OSGi 4.2 Blueprint Reference Implementation (RI)</title>
<para>Gemini Blueprint served as the basis for the Blueprint Container specification, introduced by OSGi 4.2. Gemini Blueprint stands as the RI for the
aforementioned specification, providing the Blueprint API and implementation out of the box. Various aspect of Gemini Blueprint have been adjusted for
consistency to the Blueprint specification. For more information on the two models, see <xref linkend="blueprint"/> for more information.</para>
</section>
- <section id="dm-2.0.x:jdk5">
+ <section id="gemini-blueprint-2.0.x:jdk5">
<title>Java 5</title>
<para>Gemini Blueprint requires <ulink url="http://java.sun.com/j2se/1.5.0/">JDK 5</ulink> to run (or compile). The framework code has been
revised to take advantage of the JDK 5 features such as language improvements, concurrency and generics: for example, various enum-like classes
@@ -46,45 +64,47 @@
Considerable effort has been spent to keep the code backwards compatible however, it is recommended to compile the code against the Gemini Blueprint 2.x
code and perform sanity checks before upgrading.</para>
</section>
- <section id="dm-2.0.x:spring-3.x">
+ <section id="gemini-blueprint-2.0.x:spring-3.x">
<title>Spring 3.x</title>
<para>Besides the Java 5 upgrade, Gemini Blueprint requires Spring 3.x to get access to the latest framework features and JDK optimizations.</para>
</section>
- <section id="dm-2.0.x:imports">
+ <section id="gemini-blueprint-2.0.x:imports">
<title>Service Importer Improvements</title>
<para>Gemini Blueprint provides several improvements for service imports (whether single or collection based) in terms of speed, configuration and
service lifecycle. <xref linkend="service-registry:refs"/> provides more details. </para>
</section>
- <section id="dm-2.0.x:security">
+ <section id="gemini-blueprint-2.0.x:security">
<title>Java 2 Security Integration</title>
<para>Continuing the work in Spring DM 1.2.x, Gemini Blueprint executes all user code using its credentials (the managed bundle permissions).
See <xref linkend="appendix-security"/> for more information.</para>
</section>
</section>
- <section id="dm-1.2.x">
+ <section id="gemini-blueprint-1.2.x">
<title>Spring DM 1.2.x</title>
-
- <section id="dm-1.2.x:security">
+
+ <note>This section includes the updates from Spring Dynamic Modules (Spring DM) project and previous gemini blueprint versions.</note>
+
+ <section id="gemini-blueprint-1.2.x:security">
<title>Java 2 Security Integration</title>
<para>Since 1.2.x, Spring DM is aware of <ulink url="http://java.sun.com/javase/technologies/security/#overview">secured</ulink>
environments by making use of dedicated <ulink url="http://java.sun.com/j2se/1.4.2/docs/guide/security/doprivileged.html">privileged blocks</ulink>
for executing security sensitive code. Thus, Spring DM can run as a <emphasis>trusted</emphasis> library without requiring escalated
permissions for its managed bundles. See <xref linkend="appendix-security"/> for more information.</para>
</section>
- <section id="dm-1.2.x:compendium">
+ <section id="gemini-blueprint-1.2.x:compendium">
<title>Compendium Services Support</title>
<para>1.2.x provides integration with the <ulink url="http://www.osgi.org/javadoc/r4v401/org/osgi/service/cm/package-summary.html">Configuration Admin</ulink>,
part of the OSGi compendium services. <xref linkend="compendium"/> provides more details on the topic.</para>
</section>
- <section id="dm-1.2.x:sym-name-change">
+ <section id="gemini-blueprint-1.2.x:sym-name-change">
<title>Changed Spring DM Symbolic Names</title>
<para>Since 1.2.0 M2, the Spring DM bundles symbolic names have been aligned with Spring's 2.5.6+. Thus the prefix
<literal>org.springframework.bundle.osgi</literal> has been changed to <literal>org.eclipse.gemini.blueprint</literal>; for example
Spring DM extender symbolic name was changed from <literal>org.springframework.bundle.osgi.extender</literal> to <literal>org.eclipse.gemini.blueprint.extender</literal>
(notice the missing <literal>bundle</literal> word). Additionally, the documentation has been updated to reflect Spring 2.5.6+ symbolic names.</para>
</section>
- <section id="dm-1.2.x:ebr-usage">
+ <section id="gemini-blueprint-1.2.x:ebr-usage">
<title>Usage of SpringSource Enterprise Bundle Repository (EBR)</title>
<para>To minimize the number of repositories used and the confusion caused by OSGified vs non-OSGified artifacts especially to users using SpringSource dm Server,
after 1.2.0 RC1, Spring DM aligned as many of its dependencies as possible with SpringSource <ulink url="http://www.springsource.com/repository">EBR</ulink>.
diff --git a/docs/src/docbkx/reference/compendium/compendium.xml b/docs/src/docbkx/reference/compendium/compendium.xml
index fe5edbd..7cf1e51 100644
--- a/docs/src/docbkx/reference/compendium/compendium.xml
+++ b/docs/src/docbkx/reference/compendium/compendium.xml
@@ -92,7 +92,7 @@
<interfacename>ManagedServiceFactory</interfacename>.</para></note>
<para>Those familiar with Spring's
- <ulink url="http://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/xsd-configuration.html#xsd-config-body-schemas-util">util schema</ulink> will
+ <ulink url="http://docs.spring.io/spring/docs/4.3.x/spring-framework-reference/html/xsd-configuration.html#xsd-config-body-schemas-util">util schema</ulink> will
find <literal><![CDATA[<osgi:cm-properties/>]]></literal> element similar to <literal><![CDATA[<util:properties/>]]></literal>.</para>
<para>It is possible to specify a default set of property values to be used in the event that the configuration dictionary does not contain
@@ -132,8 +132,8 @@
(default <literal>false</literal>) allows one to revert the merging algorithm, forcing the local properties to override the entries in the CM.</para>
<para>Since <literal>cm-properties</literal> exposes the CM entries as <classname>Properties</classname>, it can be used with Spring's <classname>
- <ulink url="http://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/beans.html#beans-factory-placeholderconfigurer">PropertyPlaceholderConfigurer</ulink></classname>
- and <classname><ulink url="http://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/beans.html#beans-factory-overrideconfigurer">PropertyOverrideConfigurer</ulink></classname>
+ <ulink url="http://docs.spring.io/spring/docs/4.3.x/spring-framework-reference/html/beans.html#beans-factory-placeholderconfigurer">PropertyPlaceholderConfigurer</ulink></classname>
+ and <classname><ulink url="http://docs.spring.io/spring/docs/4.3.x/spring-framework-reference/html/beans.html#beans-factory-overrideconfigurer">PropertyOverrideConfigurer</ulink></classname>
to externalize and customize environment-specific properties:</para>
<programlisting language="xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
diff --git a/docs/src/docbkx/reference/deployment.xml b/docs/src/docbkx/reference/deployment.xml
index 68fc022..6f5e649 100644
--- a/docs/src/docbkx/reference/deployment.xml
+++ b/docs/src/docbkx/reference/deployment.xml
@@ -582,6 +582,19 @@ Blueprint-Bundle: config/account-data-context.xml, config/osgi-*.xml
<ulink url="http://search.maven.org/#search|ga|1|g%3Aorg.apache.servicemix.bundles%20spring-">all Spring OSGi artifacts published in maven central</ulink>.
</para>
</section>
+
+ <section id="app-deploy:optional-libraries">
+ <title>Optional Gemini Blueprint Bundles</title>
+
+ <para>Optionally, the following bundles may be installed to augment the Gemini Blueprint core functionality:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>The Gemini Blueprint propriertary extensions bundle,
+ <literal>org.eclipse.gemini.blueprint.extensions</literal></para>
+ </listitem>
+ </itemizedlist>
+ </section>
<section id="app-deploy:spring-namespaces">
<title>Spring XML Authoring Support</title>
diff --git a/docs/src/docbkx/reference/service-registry.xml b/docs/src/docbkx/reference/service-registry.xml
index 4fa4f14..1ddbf70 100644
--- a/docs/src/docbkx/reference/service-registry.xml
+++ b/docs/src/docbkx/reference/service-registry.xml
@@ -865,13 +865,13 @@ public interface SubInterface extends SuperInterface {}]]></programlisting>
<para>In Gemini Blueprint/Spring DM, a <literal>mandatory</literal> service import that is unsatisfied (there are no services
matching the description) can either prevent an application context from starting up or, if already started,
cause the unregistration of the exported services dependent on it.</para>
-
+
<section id="service-registry:refs:availability:startup">
<title>Mandatory Services and Application Startup</title>
<para>
- The availability of a service impacts the startup of an Spring-powered application and
+ The availability of a service impacts the startup of an Spring-powered application and
the publication of any exported services that depend on it.
- As mentioned in <xref linkend="bnd-app-ctx:app-creation:mandatory-deps"/>, a SpringDM application will not start
+ As mentioned in <xref linkend="bnd-app-ctx:app-creation:mandatory-deps"/>, a SpringDM application will not start
unless <emphasis>all</emphasis> <literal>mandatory</literal> services are available, at the same time.
Before initializing the context, Gemini Blueprint/Spring DM discovers all the <literal>mandatory</literal> service
@@ -881,15 +881,15 @@ public interface SubInterface extends SuperInterface {}]]></programlisting>
If the timeout occurs, the application initialization fails (since the required or mandatory services
are not available) or succeeds, meaning the application context is being initialized.
</para>
-
+
<para>This way, the framework prevents the application from starting up only to fail since its required
- services are unavailable. This feature avoids the need for ordering the bundle startup sequence as the
+ services are unavailable. This feature avoids the need for ordering the bundle startup sequence as the
configuration already acts as a service <emphasis>barrier</emphasis> blueprint: no matter the order of the services
started, on whether they come and go, only when all of them are present, will the context initialization
commence.</para>
-
- <note>The fact that an application has mandatory service references, gives no guarantee
- that a valid service object is available when the service reference is used, since services can
+
+ <note>The fact that an application has mandatory service references, gives no guarantee
+ that a valid service object is available when the service reference is used, since services can
get unregistered at any time. Gemini Blueprint/Spring DM guarantees that all the mandatory services were present, at
the same time, before the application was started but it cannot prevent or guarantee that this services
will not be disappear during the application life span.</note>
@@ -900,7 +900,32 @@ public interface SubInterface extends SuperInterface {}]]></programlisting>
cause application context creation to fail through either deadlock
or timeout.
</warning>
+
+ </section>
+
+ <section id="service-registry:annotations-vs-xml-declarations">
+ <title>Referencing services via the @ServiceReference annotation</title>
+ <para>
+ Since 2.1.0, gemini-blueprint allows using the @ServiceReference annotation provided by the proprietary gemini-blueprint-extensions bundle
+ in addition to the XML declarations given below. Both ways of declaring service references have the exact same semantics, i.e. a bean of the form
+
+<programlisting language="java"><![CDATA[
+import org.eclipse.gemini.blueprint.extensions.annotation.ServiceReference;
+
+public class MyBean {
+ @ServiceReference
+ private Service myService;
+}]]></programlisting>
+
+ Is equivalent to
+
+ <programlisting language="xml"><![CDATA[<osgi:reference id="myService" interface="some.package.Service" />]]></programlisting>
+
+ and subsequently injecting the service reference into the bean.
+ </para>
+ <para>It is, however, important to stress that @ServiceReference is a proprietary extension that is not covered by the OSGi specification.</para>
+
</section>
<!-- keep the old name in case the old chapter in 1.2 is still referred to -->
diff --git a/docs/src/docbkx/resources/xsl/highlight.xsl b/docs/src/docbkx/resources/xsl/highlight.xsl
index 5acd704..855fb8e 100644
--- a/docs/src/docbkx/resources/xsl/highlight.xsl
+++ b/docs/src/docbkx/resources/xsl/highlight.xsl
@@ -3,40 +3,185 @@
Simple highlighter for HTML output. Follows the Eclipse color scheme.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+
+ xmlns:d="http://docbook.org/ns/docbook"
+ xmlns:s6hl="http://net.sf.xslthl/ConnectorSaxon6"
+ xmlns:sbhl="http://net.sf.xslthl/ConnectorSaxonB"
+ xmlns:xhl="http://net.sf.xslthl/ConnectorXalan"
+ xmlns:saxon6="http://icl.com/saxon"
+ xmlns:saxonb="http://saxon.sf.net/"
+ xmlns:xalan="http://xml.apache.org/xalan"
+
+ xmlns:exsl="http://exslt.org/common"
xmlns:xslthl="http://xslthl.sf.net"
- exclude-result-prefixes="xslthl"
+ exclude-result-prefixes="exsl xslthl s6hl sbhl xhl d"
version='1.0'>
+ <!-- this construction is needed to have the saxon and xalan connectors working alongside each other -->
+ <xalan:component prefix="xhl" functions="highlight">
+ <xalan:script lang="javaclass" src="xalan://net.sf.xslthl.ConnectorXalan"/>
+ </xalan:component>
+
+ <!-- for saxon 6 -->
+ <saxon6:script implements-prefix="s6hl" language="java" src="java:net.sf.xslthl.ConnectorSaxon6"/>
+
+ <!-- for saxon 8.5 and later -->
+ <saxonb:script implements-prefix="sbhl" language="java" src="java:net.sf.xslthl.ConnectorSaxonB"/>
- <xsl:template match='xslthl:keyword'>
- <span class="hl-keyword"><xsl:value-of select='.'/></span>
- </xsl:template>
- <xsl:template match='xslthl:comment'>
- <span class="hl-comment"><xsl:value-of select='.'/></span>
- </xsl:template>
+ <!-- You can override this template to do more complex mapping of
+ language attribute to highlighter language ID (see xslthl-config.xml) -->
+ <xsl:template name="language.to.xslthl">
+ <xsl:param name="context"/>
- <xsl:template match='xslthl:oneline-comment'>
- <span class="hl-comment"><xsl:value-of select='.'/></span>
- </xsl:template>
+ <xsl:choose>
+ <xsl:when test="$context/@language != ''">
+ <xsl:value-of select="$context/@language"/>
+ </xsl:when>
+ <xsl:when test="$highlight.default.language != ''">
+ <xsl:value-of select="$highlight.default.language"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
- <xsl:template match='xslthl:multiline-comment'>
- <span class="hl-multiline-comment"><xsl:value-of select='.'/></span>
- </xsl:template>
+ <xsl:template name="apply-highlighting">
+ <xsl:choose>
+ <!-- Do we want syntax highlighting -->
+ <xsl:when test="$highlight.source != 0">
+ <xsl:variable name="language">
+ <xsl:call-template name="language.to.xslthl">
+ <xsl:with-param name="context" select="."/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$language != ''">
+ <xsl:variable name="content">
+ <xsl:apply-templates/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="function-available('s6hl:highlight')">
+ <xsl:apply-templates
+ select="s6hl:highlight($language, exsl:node-set($content), $highlight.xslthl.config)"
+ mode="xslthl"/>
+ </xsl:when>
+ <xsl:when test="function-available('sbhl:highlight')">
+ <xsl:apply-templates
+ select="sbhl:highlight($language, exsl:node-set($content), $highlight.xslthl.config)"
+ mode="xslthl"/>
+ </xsl:when>
+ <xsl:when test="function-available('xhl:highlight')">
+ <xsl:apply-templates
+ select="xhl:highlight($language, exsl:node-set($content), $highlight.xslthl.config)"
+ mode="xslthl"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="$content"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <!-- No syntax highlighting -->
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
- <xsl:template match='xslthl:tag'>
- <span class="hl-tag"><xsl:value-of select='.'/></span>
- </xsl:template>
+ <!-- A fallback when the specific style isn't recognized -->
+ <xsl:template match="xslthl:*" mode="xslthl">
+ <xsl:message>
+ <xsl:text>unprocessed xslthl style: </xsl:text>
+ <xsl:value-of select="local-name(.)"/>
+ </xsl:message>
+ <xsl:apply-templates mode="xslthl"/>
+ </xsl:template>
- <xsl:template match='xslthl:attribute'>
- <span class="hl-attribute"><xsl:value-of select='.'/></span>
- </xsl:template>
+ <!-- Copy over already produced markup (FO/HTML) -->
+ <xsl:template match="node()" mode="xslthl" priority="-1">
+ <xsl:copy>
+ <xsl:apply-templates select="node()" mode="xslthl"/>
+ </xsl:copy>
+ </xsl:template>
- <xsl:template match='xslthl:value'>
- <span class="hl-value"><xsl:value-of select='.'/></span>
- </xsl:template>
-
- <xsl:template match='xslthl:string'>
- <span class="hl-string"><xsl:value-of select='.'/></span>
- </xsl:template>
+ <xsl:template match="*" mode="xslthl">
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+ <xsl:apply-templates select="node()" mode="xslthl"/>
+ </xsl:copy>
+ </xsl:template>
+ <xsl:template match="xslthl:keyword" mode="xslthl">
+ <strong class="hl-keyword">
+ <xsl:apply-templates mode="xslthl"/>
+ </strong>
+ </xsl:template>
+ <xsl:template match="xslthl:string" mode="xslthl">
+ <strong class="hl-string">
+ <em>
+ <xsl:apply-templates mode="xslthl"/>
+ </em>
+ </strong>
+ </xsl:template>
+ <xsl:template match="xslthl:comment" mode="xslthl">
+ <em class="hl-comment">
+ <xsl:apply-templates mode="xslthl"/>
+ </em>
+ </xsl:template>
+ <xsl:template match="xslthl:directive" mode="xslthl">
+ <span class="hl-directive">
+ <xsl:apply-templates mode="xslthl"/>
+ </span>
+ </xsl:template>
+ <xsl:template match="xslthl:tag" mode="xslthl">
+ <strong class="hl-tag">
+ <xsl:apply-templates mode="xslthl"/>
+ </strong>
+ </xsl:template>
+ <xsl:template match="xslthl:attribute" mode="xslthl">
+ <span class="hl-attribute">
+ <xsl:apply-templates mode="xslthl"/>
+ </span>
+ </xsl:template>
+ <xsl:template match="xslthl:value" mode="xslthl">
+ <span class="hl-value">
+ <xsl:apply-templates mode="xslthl"/>
+ </span>
+ </xsl:template>
+ <xsl:template match='xslthl:html' mode="xslthl">
+ <span class="hl-html">
+ <xsl:apply-templates mode="xslthl"/>
+ </span>
+ </xsl:template>
+ <xsl:template match="xslthl:xslt" mode="xslthl">
+ <strong>
+ <xsl:apply-templates mode="xslthl"/>
+ </strong>
+ </xsl:template>
+ <!-- Not emitted since XSLTHL 2.0 -->
+ <xsl:template match="xslthl:section" mode="xslthl">
+ <strong>
+ <xsl:apply-templates mode="xslthl"/>
+ </strong>
+ </xsl:template>
+ <xsl:template match="xslthl:number" mode="xslthl">
+ <span class="hl-number">
+ <xsl:apply-templates mode="xslthl"/>
+ </span>
+ </xsl:template>
+ <xsl:template match="xslthl:annotation" mode="xslthl">
+ <em>
+ <span class="hl-annotation">
+ <xsl:apply-templates mode="xslthl"/>
+ </span>
+ </em>
+ </xsl:template>
+ <!-- Not sure which element will be in final XSLTHL 2.0 -->
+ <xsl:template match="xslthl:doccomment|xslthl:doctype" mode="xslthl">
+ <strong class="hl-tag">
+ <xsl:apply-templates mode="xslthl"/>
+ </strong>
+ </xsl:template>
</xsl:stylesheet> \ No newline at end of file

Back to the top