[ xframe-Bugs-949282 ] Duplicate global variable declaration exception

"SourceForge.net" <[email protected]>
Newsgroups gmane.text.xml.xframe.xsddoc
Message-ID <[email protected]>
Bugs item #949282, was opened at 2004-05-06 17:35
Message generated for change (Comment added) made by kriede
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=454391&aid=949282&group_id=48863

Category: all platforms
Group: beta-0.4
>Status: Closed
Resolution: Accepted
Priority: 3
Submitted By: Vab (andleigh)
Assigned to: Kurt Riede (kriede)
Summary: Duplicate global variable declaration exception

Initial Comment:
Although xsddoc works fine from the command line with my schema 
(included below), in Ant, i get a Duplicate global variable declaration 
exception.  Stack trace is at the bottom of this message.  I have not 
modified any of the jar files in the ant/lib directory.

I am using:

xsddoc-0.4-beta
apache-ant-1.6.1

xalan (within xsddoc lib directory) xalan-j_2_3_1_01

xalan (in ant lib directory) 
ant-xalan1.jar, ant-xalan2.jar (given the size of these files, I think these 
are only running another xalan somewhere else but i don't know 
enough about the implementation of Ant to answer that any better)

Here is the schema I was running -- xsddoc runs it fine from the 
command line but fails to run in Ant

[[email protected] hdf]$ more dataPathList.xsd
--------------------
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
targetNamespace="http://ll.mit.edu";
xmlns="http://ll.mit.edu";
elementFormDefault="qualified">

<xsd:element name="dataPathList">
<xsd:complexType>
<xsd:sequence>
<xsd:element type="xsd:string" name="hdfDataPath"
maxOccurs="unbounded" minOccurs="1">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

</xsd:schema>
---------------------

Here is my Ant task:

 <target name="xsddocs" description="Creates xsd-documentation">
    <mkdir 
           dir="${xsddocs.dir}" >
    </mkdir>
     <xsddoc out="${top.dir}/xsddocs"
             title="LLSIM Schema Documentation"
             verbose="true" >
       <fileset dir="${run.schemas.dir}" includes="dataPathList.xsd" />
    </xsddoc>
  </target>

  <taskdef name="xsddoc" classname="net.sf.xframe.xsddoc.Task">
    <classpath>
      <pathelement location="${outsideLibs.dir}/xsddoc.jar"/>
    </classpath>
  </taskdef>



-----------------------------------
Here is the log and exception stack trace from Ant in -debug mode:

##################################
xsddocs:
Class java.util.Vector loaded from parent loader (parentFirst)
Finding class net.sf.xframe.xsddoc.Processor
Loaded from /home/vab/workspace/llteam/lib/xsddoc.jar 
net/sf/xframe/xsddoc/Processor.class
Class net.sf.xframe.xsddoc.Processor loaded from ant loader 
(parentFirst)

<log section omitted by Vab>
Class java.lang.System loaded from parent loader (parentFirst)
Class javax.xml.transform.SourceLocator loaded from parent loader 
(parentFirst)
Class java.io.PrintStream loaded from parent loader (parentFirst)
[xsddoc] error: Duplicate global variable declaration at resource:
/net/sf/xframe/xsddoc/xslt/xmldoc.xsl:-1#-1
[xsddoc] error: Duplicate global variable declaration at resource:
/net/sf/xframe/xsddoc/xslt/xmldoc.xsl:-1#-1

BUILD FAILED
/home/vab/workspace/llteam/src/java/mitll/build.xml:755: net.sf.xframe.
xsddoc.ProcessorException: Duplicate global variable declaration
at net.sf.xframe.xsddoc.Task.execute(Unknown Source)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.
java:269)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:301)
at org.apache.tools.ant.Target.performTasks(Target.java:328)
at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
at org.apache.tools.ant.Main.runBuild(Main.java:632)
at org.apache.tools.ant.Main.startAnt(Main.java:183)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)
Caused by: net.sf.xframe.xsddoc.ProcessorException: Duplicate global 
variable declaration
at com.icl.saxon.style.StyleElement.compileError(StyleElement.java:
843)
at com.icl.saxon.style.XSLGeneralVariable.
checkDuplicateDeclaration(XSLGeneralVariable.java:180)
at com.icl.saxon.style.XSLVariable.validate(XSLVariable.java:38)
at com.icl.saxon.style.StyleElement.validateSubtree(StyleElement.java:
472)
at com.icl.saxon.style.XSLStyleSheet.preprocess(XSLStyleSheet.java:
337)
at com.icl.saxon.PreparedStyleSheet.
setStyleSheetDocument(PreparedStyleSheet.java:159)
at com.icl.saxon.PreparedStyleSheet.prepare(PreparedStyleSheet.
java:116) at com.icl.saxon.TransformerFactoryImpl.
newTemplates(TransformerFactoryImpl.java:119)
at com.icl.saxon.TransformerFactoryImpl.
newTransformer(TransformerFactoryImpl.java:71)
at net.sf.xframe.xsddoc.Processor.createTransformer(Unknown 
Source)
at net.sf.xframe.xsddoc.Processor.initTransformers(Unknown Source)
at net.sf.xframe.xsddoc.Processor.init(Unknown Source)
at net.sf.xframe.xsddoc.Processor.execute(Unknown Source)
... 12 more
--- Nested Exception ---
net.sf.xframe.xsddoc.ProcessorException: Duplicate global variable 
declaration
at net.sf.xframe.xsddoc.Processor.execute(Unknown Source)
at net.sf.xframe.xsddoc.Task.process(Unknown Source)
at net.sf.xframe.xsddoc.Task.execute(Unknown Source)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.
java:269)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:301)
at org.apache.tools.ant.Target.performTasks(Target.java:328)
at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
at org.apache.tools.ant.Main.runBuild(Main.java:632)
at org.apache.tools.ant.Main.startAnt(Main.java:183)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)
Caused by: javax.xml.transform.TransformerConfigurationException: 
Duplicate global variable declaration
at com.icl.saxon.style.StyleElement.compileError(StyleElement.java:
843)
at com.icl.saxon.style.XSLGeneralVariable.
checkDuplicateDeclaration(XSLGeneralVariable.java:180)
at com.icl.saxon.style.XSLVariable.validate(XSLVariable.java:38)
at com.icl.saxon.style.StyleElement.validateSubtree(StyleElement.java:
472)
at com.icl.saxon.style.XSLStyleSheet.preprocess(XSLStyleSheet.java:
337)
at com.icl.saxon.PreparedStyleSheet.
setStyleSheetDocument(PreparedStyleSheet.java:159)
at com.icl.saxon.PreparedStyleSheet.prepare(PreparedStyleSheet.
java:116) at com.icl.saxon.TransformerFactoryImpl.
newTemplates(TransformerFactoryImpl.java:119)
at com.icl.saxon.TransformerFactoryImpl.
newTransformer(TransformerFactoryImpl.java:71)
at net.sf.xframe.xsddoc.Processor.createTransformer(Unknown 
Source)
at net.sf.xframe.xsddoc.Processor.initTransformers(Unknown Source)
at net.sf.xframe.xsddoc.Processor.init(Unknown Source)
at net.sf.xframe.xsddoc.Processor.execute(Unknown Source)
... 12 more




------------------------

Thanks,
Vab

----------------------------------------------------------------------

>Comment By: Kurt Riede (kriede)
Date: 2004-05-29 10:20

Message:
Logged In: YES 
user_id=484961

closed in 0.5 beta

----------------------------------------------------------------------

Comment By: Vab (andleigh)
Date: 2004-05-06 23:45

Message:
Logged In: YES 
user_id=1035278

Replacing ant's existing xalan.jar with Version 2.6 worked, and everything is 
fine.

Thanks for the quick fix!!!!

Vab

----------------------------------------------------------------------

Comment By: Kurt Riede (kriede)
Date: 2004-05-06 18:38

Message:
Logged In: YES 
user_id=484961

Fixed in CVS.
Will be available with next release 0.5 beta

----------------------------------------------------------------------

Comment By: Kurt Riede (kriede)
Date: 2004-05-06 18:17

Message:
Logged In: YES 
user_id=484961

Thanx for the extensive information.
I was able to reproduce it with some old versions of xalan.
And indeed we have a duplicate variable declaration in 
component.xsl and the included xmldoc.xsl (mainSchema).
I'm not sure if this is invalid with respect to the XSL-T 
specification, but anyway it' easy to solve and will be fixed in 
the next release 0.5 beta.

For now you could update your ant installation to a newer 
version of XalanJ by dropping the corresponding file Xalan.jar 
into the lib folder of your ant installation.
XalanJ Version 2.5.1 or higher should work

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=454391&aid=949282&group_id=48863


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.