Commit d9008fa0 authored by Fabien Triolet's avatar Fabien Triolet
Browse files

Corrected some bug with import

parent 7ed2b6d3
/** /**
* $Id: Transmorpher.java,v 1.2 2002-11-15 15:12:56 triolet Exp $ * $Id: Transmorpher.java,v 1.3 2002-11-18 16:08:40 triolet Exp $
* *
* Transmorpher * Transmorpher
* *
...@@ -364,7 +364,13 @@ public class Transmorpher extends Observable { ...@@ -364,7 +364,13 @@ public class Transmorpher extends Observable {
System.out.println("</transmorpher>"); System.out.println("</transmorpher>");
} //end generate XML } //end generate XML
public void generateStylesheet() throws TMException,IOException{
for (ListIterator l = transformations.listIterator(); l.hasNext();) {
Transformation t = ((Transformation)l.next());
if (t instanceof Ruleset) ((Ruleset)t).generateXSLTStylesheet(reloc);
else if (t instanceof Query) ((Query)t).generateXSLTStylesheet(reloc);
}
}
/** Generates Java code for the transformation **/ /** Generates Java code for the transformation **/
public final void generateExec(String _reloc) public final void generateExec(String _reloc)
throws TransformerException, throws TransformerException,
...@@ -373,11 +379,11 @@ public class Transmorpher extends Observable { ...@@ -373,11 +379,11 @@ public class Transmorpher extends Observable {
SAXException, SAXException,
IOException { IOException {
if(_reloc!=null) reloc=_reloc; if(_reloc!=null) reloc=_reloc;
for (ListIterator l = transformations.listIterator(); l.hasNext();) { generateStylesheet();
Transformation t = ((Transformation)l.next()); for (ListIterator l = imports.listIterator(0); l.hasNext();) {
if (t instanceof Ruleset) ((Ruleset)t).generateXSLTStylesheet(reloc); ((Transmorpher)l.next()).generateStylesheet();
else if (t instanceof Query) ((Query)t).generateXSLTStylesheet(reloc); }
} //end for //end for
if ( getMain() != null ){ if ( getMain() != null ){
iProcessFactory = new TProcessFactory(defexterns,debug); iProcessFactory = new TProcessFactory(defexterns,debug);
iExecutionStructure = getMain().createMainProcess(iProcessFactory); iExecutionStructure = getMain().createMainProcess(iProcessFactory);
......
/** /**
* $Id: AddAtt.java,v 1.1 2002-11-06 14:08:21 serge Exp $ * $Id: AddAtt.java,v 1.2 2002-11-18 16:08:40 triolet Exp $
* *
* Transmorpher * Transmorpher
* *
...@@ -55,7 +55,7 @@ public class AddAtt implements Rule { ...@@ -55,7 +55,7 @@ public class AddAtt implements Rule {
file.writeln(6,"<!-- Adding attributes "+match+" -->"); file.writeln(6,"<!-- Adding attributes "+match+" -->");
file.write(6,"<xsl:attribute name=\""+match+"\">"); file.write(6,"<xsl:attribute name=\""+match+"\">");
file.write(value); file.write(value);
file.writeln(6,"</xsl:attribute>"); file.write("</xsl:attribute>");
file.writeln(""); file.writeln("");
} }
......
/** /**
* $Id: RuleSetParser.java,v 1.1 2002-11-06 14:08:21 serge Exp $ * $Id: RuleSetParser.java,v 1.2 2002-11-18 16:08:40 triolet Exp $
* *
* Transmorpher * Transmorpher
* *
...@@ -154,7 +154,7 @@ public class RuleSetParser extends FMParser{ ...@@ -154,7 +154,7 @@ public class RuleSetParser extends FMParser{
currentRule.addRule( (Rule)rule ); currentRule.addRule( (Rule)rule );
} }
} else if (localName.equals("addatt")) { } else if (localName.equals("addatt")) {
rule = (Rule)new AddTag(atts.getValue("match"),atts.getValue("value")); rule = (Rule)new AddAtt(atts.getValue("match"),atts.getValue("value"));
if ( currentRule == null ) { if ( currentRule == null ) {
((Ruleset)currentTransformation).addRule( (Rule)rule ); ((Ruleset)currentTransformation).addRule( (Rule)rule );
} else { } else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment