Re: [opensuse] Re: xalan XSLT processor in openSUSE 11.1



On Tue, 2009-11-03 at 11:03 +0100, Joachim Schrod wrote:
Roger Oberholtzer wrote:
Is anyone using xalan (xalan-j2-2.7.0-244.17) in openSUSE 11.1? I cannot
get it to work. I am new to xslt, so it could be me. To eliminate as
much of 'me' as possible, I am trying to run a simple XSLT example from
the O'Reilly XSLT 2.0 book. Examples from that book can be found here:

http://examples.oreilly.com/9780596527211/

I then try an example from Chapter 2 (from the archive found at the
address above) with:

java org.apache.xalan.xslt.Process -in greetings.xml \
-xsl greeting.xsl -out test.html

The sample document in the ZIP file is not the same as in the book.
In the book, it has a "greeting" element at the root and that would
have been properly selected. Here there is no not "greeting" at the
document root, so no selection is done.

There are a number of examples in the book that are variations. These
are to get the basic ideas across.

The greeting.xsd file in the ZIP contains:

<?xml version="1.0"?>
<!-- greeting.xsl -->
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:output method="html"/>

<xsl:template match="/">
<xsl:apply-templates select="greeting"/>
</xsl:template>

<xsl:template match="greeting">
<html>
<body>
<h1>
<xsl:value-of select="."/>
</h1>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

-- If the XSL file uses "*/greeting", or even just "*", as select
pattern, it works again.

What did you change above to make it work again?

-- You can also leave off the template for "/", then the build-in
template matches that traverses the whole XML tree and triggers
all matching templates for sub-elements.

The Xalan options -TT -TC are very helpful to see what is actually
going on during parsing.

I did try -tt and -tc. I cannot say they provided more information. At
least not to my as-yet untrained eyes.

--
Roger Oberholtzer

OPQ Systems / Ramböll RST

Ramböll Sverige AB
Krukmakargatan 21
P.O. Box 17009
SE-104 62 Stockholm, Sweden

Office: Int +46 8-615 60 20
Mobile: Int +46 70-815 1696

--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx



Relevant Pages