-XALANROOT=/projects/apache/xml-xalan/java
+XALANROOT=/usr/local/java/xalan2
-CLASSPATH=$(CLASSBASE):$(XALANROOT)/build/xalan.jar:$(XALANROOT)/bin/xml-apis.jar:$(XALANROOT)/bin/xercesImpl.jar:/usr/local/jaxp-1.1/jaxp.jar:/usr/local/jaxp-1.1/parser.jar
+CLASSPATH=$(CLASSBASE):$(XALANROOT)/bin/xalan.jar:$(XALANROOT)/bin/xml-apis.jar:$(XALANROOT)/bin/xercesImpl.jar:/usr/local/jwsdp-1.3/jaxp/lib/jaxp-api.jar
all: $(CLASSFILES)
-@for f in $(SUBDIRS); do \
done
jar: all
- jar cf ../../xalan2.jar `find com -name "*.class" -print`
+ jar cf ../../xalan25.jar `find com -name "*.class" -print`
%.class : %.java
javac -classpath $(CLASSPATH) \
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
import org.w3c.dom.*;
-import org.apache.xpath.DOMHelper;
+import org.apache.xml.utils.DOMHelper;
import org.apache.xml.utils.DOMBuilder;
import org.apache.xml.utils.AttList;
import com.nwalsh.xalan.Callout;
package com.nwalsh.xalan;
+import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.SAXException;
import org.w3c.dom.*;
import org.apache.xml.utils.DOMBuilder;
public class FormatUnicodeCallout extends FormatCallout {
int unicodeMax = 0;
int unicodeStart = 0;
+ String unicodeFont = "";
- public FormatUnicodeCallout(int start, int max, boolean fo) {
+ public FormatUnicodeCallout(String font, int start, int max, boolean fo) {
+ unicodeFont = font;
unicodeMax = max;
unicodeStart = start;
stylesheetFO = fo;
try {
if (label == null && num <= unicodeMax) {
+ AttributesImpl inAttr = new AttributesImpl();
+ String ns = "";
+ String prefix = "";
+ String inName = "";
+
+ if (!unicodeFont.equals("")) {
+ if (stylesheetFO) {
+ ns = foURI;
+ prefix = "fo:";
+ inName = "inline";
+ inAttr.addAttribute("", "", "font-family", "CDATA", unicodeFont);
+ } else {
+ inName = "font";
+ inAttr.addAttribute("", "", "face", "CDATA", unicodeFont);
+ }
+ }
+
char chars[] = new char[1];
chars[0] = (char) (unicodeStart + num - 1);
startSpan(rtf);
+ if (!unicodeFont.equals("")) {
+ rtf.startElement(ns, inName, prefix+inName, inAttr);
+ }
rtf.characters(chars, 0, 1);
+ if (!unicodeFont.equals("")) {
+ rtf.endElement(ns, inName, prefix+inName);
+ }
endSpan(rtf);
} else {
formatTextCallout(rtf, callout);
return "";
}
} catch (TransformerException te) {
- System.out.println("Transformer exception getting value of $" + varName);
+ // Nevermind the warning
+ // System.out.println("Transformer exception getting value of $" + varName);
return "";
}
}
} else if (Params.getBoolean(context, "callout.unicode")) {
int uStart = Params.getInt(context, "callout.unicode.start.character");
int uMax = Params.getInt(context, "callout.unicode.number.limit");
+ String uFont = Params.getString(context, "callout.unicode.font");
return insertUnicodeCallouts(areaspecNodeSet, xalanNI, defaultColumn,
- uStart, uMax, useFO);
+ uFont, uStart, uMax, useFO);
} else if (Params.getBoolean(context, "callout.dingbats")) {
int dMax = 10;
return insertDingbatCallouts(areaspecNodeSet, xalanNI, defaultColumn,
public DocumentFragment insertUnicodeCallouts (NodeIterator areaspecNodeSet,
NodeIterator xalanNI,
int defaultColumn,
+ String uFont,
int uStart,
int uMax,
boolean useFO) {
- FormatUnicodeCallout fuc = new FormatUnicodeCallout(uStart, uMax, useFO);
+ FormatUnicodeCallout fuc = new FormatUnicodeCallout(uFont, uStart, uMax, useFO);
return insertCallouts(areaspecNodeSet, xalanNI, defaultColumn, fuc);
}