This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] Linking JavaScript Query


Hi Bob, I am using xsltproc to generate my output.

The build information is as follows from xsltproc -V:

Using libxml 20504, libxslt 10027 and libexslt 718
xsltproc was compiled against libxml 20504, libxslt 10027 and libexslt 718
libxslt 10027 was compiled against libxml 20504
libexslt 718 was compiled against libxml 20504


This is a snip of the head of the resulting docs

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<html>
  <head xmlns="http://www.w3.org/1999/xhtml";>
    <title>5.2.?Environmental Impacts in Agriculture</title>
    <link rel="stylesheet" href="../xhtml-styles.css" type="text/css"/>
    <meta name="generator" content="DocBook XSL Stylesheets V1.60.1"/>

Any ideas?

On Thursday, May 8, 2003, at 02:02 AM, Bob Stayton wrote:

On Thu, May 08, 2003 at 12:02:08AM -0500, David Pratt wrote:
When linking to a JavaScript file I am including the following in the
html.head template in
my customization:

<script type="text/javascript" src="../xhtml-javascript.js"></script>

When my xhtml chunk stylesheet completes its job, this line is
converted to the following:

<script type="text/javascript" src="../xhtml-javascript.js"/>

This is nice and tidy but my browsers are not liking this and the pages
will not appear. If I
manually edit them back to what I placed in the customization, they
will appear when refreshed.
Is there a way to control this empty element cleanup to preserve the
script end element?

If you are using Saxon, then you can use a Saxon extension to solve this problem. You need to add the saxon namespace to the customization layer:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:saxon="http://icl.com/saxon";
	        version="1.0">

And then add the Saxon extension output method:

<xsl:output method="saxon:xhtml" />

This will produce what you are looking for.

Note that if you were using xsltproc, you wouldn't have
the problem.  It notices the XHTML namespace that
the output is in and adjusts the serialization of
the output to use XHTML syntax, so you get the
output you want.

--

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The SCO Group                               fax:   (831) 429-1887
                                            email: bobs@sco.com



---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]