Commit 5264c639 authored by Fabien Triolet's avatar Fabien Triolet
Browse files

Removed debug trace in TLoop.java, ModTag have a target attribute now.

parent 1f07196b
/*
* $Id: CSVXMLReader.java,v 1.1 2002-10-18 11:58:34 triolet Exp $
* $Id: CSVXMLReader.java,v 1.2 2003-01-15 12:46:43 triolet Exp $
*
* Transmorpher
*
......@@ -32,7 +32,7 @@ import org.xml.sax.helpers.*;
/**
* A class for parsing CSV (comma separated value) files. File datas are converted in
* SAX2 events.
* A simple CVS file can look like :
* A simple CSV file can look like :
* <pre>
* a,b,c
* d,e,f
......@@ -87,7 +87,7 @@ public class CSVXMLReader extends AbstractXMLReader {
ch.startDocument();
//<csvfile>
ch.startElement("", "cvsfile", "cvsfile", EMPTY_ATTR);
ch.startElement("", "csvfile", "csvfile", EMPTY_ATTR);
String curLine = null;
......
/**
* $Id: TLoop.java,v 1.4 2002-11-14 15:46:45 triolet Exp $
* $Id: TLoop.java,v 1.5 2003-01-15 12:46:43 triolet Exp $
*
* Transmorpher
*
......@@ -244,7 +244,7 @@ public final class TLoop extends TProcessComposite {
position = j;
}
}
System.out.println("Position in " + position);
//System.out.println("Position in " + position);
XML_Port port1 = new XML_Port(process.getNameIn(i), this, managers[position].buffer, position, XML_Port.IN);
XML_Port port2;
try {
......
/**
* $Id: ModTag.java,v 1.1 2002-11-06 14:08:21 serge Exp $
* $Id: ModTag.java,v 1.2 2003-01-15 12:46:43 triolet Exp $
*
* Transmorpher
*
......@@ -42,6 +42,8 @@ public class ModTag implements Rule {
public ArrayList rules = null;
public String match = null;
public String context = null;
public String target = null;
public ModTag(String m){
super();
......@@ -53,6 +55,11 @@ public class ModTag implements Rule {
this(m);
context = c;
}
public ModTag(String m, String t ,String c){
this(m,c);
target = t;
}
public void addRule( Rule r ){
rules.add((Object)r);
......@@ -61,6 +68,7 @@ public class ModTag implements Rule {
/** Prints the XML expression of the rule */
public void generateXML(){
System.out.print(" <modtag match=\""+match+"\"");
if ( target != null ) System.out.print(" target=\""+target+"\"");
if ( context != null ) System.out.print(" context=\""+context+"\"");
System.out.println(">");
for( int i = 0; i < rules.size(); i++ ){
......@@ -74,12 +82,16 @@ public class ModTag implements Rule {
file.write(2,"<xsl:template match=\"");
if( context != null ) file.write(context+"/");
file.writeln(match+"\">");
file.writeln(4,"<xsl:copy>");
if( target != null ) file.write(4,"<"+target+">");
else
file.writeln(4,"<xsl:copy>");
for( int i = 0; i < rules.size(); i++ ){
((Rule)rules.get(i)).generateInsideXSLTCode(file);
}
file.writeln(6,"<xsl:apply-templates select=\"*|@*|text()\"/>");
file.writeln(4,"</xsl:copy>");
if( target != null ) file.write(4,"</"+target+">");
else
file.writeln(4,"</xsl:copy>");
file.writeln(2,"</xsl:template>");
file.writeln("");
for( int i = 0; i < rules.size(); i++ ){
......
/**
* $Id: RuleSetParser.java,v 1.2 2002-11-18 16:08:40 triolet Exp $
* $Id: RuleSetParser.java,v 1.3 2003-01-15 12:46:43 triolet Exp $
*
* Transmorpher
*
......@@ -128,7 +128,7 @@ public class RuleSetParser extends FMParser{
rule = (Rule)new Flatten(atts.getValue("match"));
((Ruleset)currentTransformation).addRule( (Rule)rule );
} else if (localName.equals("modtag")) {
rule = new ModTag(atts.getValue("match"),atts.getValue("context"));
rule = new ModTag(atts.getValue("match"),atts.getValue("target"),atts.getValue("context"));
((Ruleset)currentTransformation).addRule( rule );
currentRule = (ModTag)rule;
} else if (localName.equals("mapatt")) {
......
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