xmlns:xsl namespace - "xsl:stylesheet" must be dec

Having trouble installing Oxygen? Got a bug to report? Post it all here.
jraymond
Posts: 2
Joined: Tue Jul 29, 2003 11:08 pm
Location: Canada, Alberta, Edmonton
Contact:

xmlns:xsl namespace - "xsl:stylesheet" must be dec

Post by jraymond »

Hi,
I have been evaluating oXygen for our department at the University of Alberta and I have been running into a minor problem. We need to provide a build for each Section of our document (for our staffs) and thus I have been using Ant to do that. I am using the "External Tools" to call Ant. However, I get the following error:

[code]build-10-Inquiries:
[exec] [Error] myxsl.xsl:5:81: Element type "xsl:stylesheet" must be declared.[/code]
... (more error of same type)

I have tried Ant on a DOS command prompt with no problem. The source of the problem (what I believe is the cause) is in my xsl file and is the DOCTYPE declaration:

[code]<?xml version="1.0" ?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY tab "&#009;" >
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">...[/code]

However, I don't see the problem! If I remove this DOCTYPE declaration (and of course any reference to 'tab') it works.

Why does oXygen not able to resolve the xsl namespace?
Is there a work arround? (keeping in mind that I need to define ENTITY)

Any help will be very much appreciated
Thank you,
Jocelyn
Dan
Posts: 501
Joined: Mon Feb 03, 2003 10:56 am

Post by Dan »

Hello,

Oxygen transformations are using the Xerces and Xalan packages from the lib directory of the installation. The Java version 1.4 comes by default with a Xalan transformer. Oxygen disregards this transformer and uses the one from the lib, but other applications, like ant, can use it, hence the difference in behaviour.

I think that when run from the command line, ant starts another java machine, like 1.3, but when run from Oxygen, as an external tool, it takes the environment variable JAVA_HOME set to the 1.4.

You can modify the ant.bat or ant script to print at the begining the environment variable JAVA_HOME. For this, put on the first line

echo %JAVA_HOME%

After this run the ant both from the DOS command line and from "External tools". It must print the same thing. If they are different then modify the ant script and set the java home to the value printed by the DOS execution, on the first line of the script.

Ex:
set JAVA_HOME=c:\jdk1.3

----------
If still this does not work, then you can try to print the environment variables The command to be placed in the script, also at the begining, is:

set

Run it again from DOS and as an external tool and let me know the result.

Regards,
Dan
jraymond
Posts: 2
Joined: Tue Jul 29, 2003 11:08 pm
Location: Canada, Alberta, Edmonton
Contact:

xmlns:xsl namespace - "xsl:stylesheet" must be dec

Post by jraymond »

Thanks Dan for your quick reply.

I tried your suggestion. I found that you were right, oXygen was using the xml parser that come with it. For instance the classpath was:

[code]CLASSPATH=C:\Program Files\Oxygen2.0.2;C:\Program Files\Oxygen2.0.2\lib;C:\Program Files\Oxygen2.0.2\lib\[b]xercesImpl.jar[/b];C:\Program Files\Oxygen2.0.2\lib\[b]xalan.jar[/b];....[/code]

So I simply needed to add a [code]-classpath[/code] argument to my ant build script to point to my xml parser and it solved the problem.

Thank you for your time.
Jocelyn
Post Reply