1 package com.icl.saxon.style; 2 import com.icl.saxon.tree.AttributeCollection; 3 import com.icl.saxon.*; 4 import com.icl.saxon.expr.*; 5 import com.icl.saxon.output.*; 6 import javax.xml.transform.*; 7 8 import java.io.*; 9 import java.util.*; 10 11 14 15 public class SAXONDoctype extends StyleElement { 16 17 21 22 public boolean isInstruction() { 23 return true; 24 } 25 26 30 31 public boolean mayContainTemplateBody() { 32 return true; 33 } 34 35 public void prepareAttributes() throws TransformerConfigurationException { 36 37 AttributeCollection atts = getAttributeList(); 38 for (int a=0; a<atts.getLength(); a++) { 39 int nc = atts.getNameCode(a); 40 checkUnknownAttribute(nc); 41 } 42 43 } 44 45 public void validate() throws TransformerConfigurationException { 46 checkWithinTemplate(); 47 } 48 49 public void process(Context context) throws TransformerException 50 { 51 Controller c = context.getController(); 52 Outputter old = c.getOutputter(); 53 Properties props = old.getOutputProperties(); 54 55 DTDEmitter emitter = new DTDEmitter(); 56 emitter.setUnderlyingEmitter(old.getEmitter()); 57 58 c.changeOutputDestination(props, emitter); 59 60 processChildren(context); 61 62 c.resetOutputDestination(old); 63 64 } 66 67 } 68 | Popular Tags |