1 package net.sf.saxon.style; 2 import net.sf.saxon.expr.Expression; 3 import net.sf.saxon.instruct.Doctype; 4 import net.sf.saxon.instruct.Executable; 5 import net.sf.saxon.om.Axis; 6 import net.sf.saxon.om.AttributeCollection; 7 import net.sf.saxon.value.EmptySequence; 8 import net.sf.saxon.trans.XPathException; 9 10 import javax.xml.transform.TransformerConfigurationException ; 11 12 15 16 public class SaxonDoctype extends StyleElement { 17 18 22 23 public boolean isInstruction() { 24 return true; 25 } 26 27 31 32 public boolean mayContainSequenceConstructor() { 33 return true; 34 } 35 36 public void prepareAttributes() throws XPathException { 37 38 AttributeCollection atts = getAttributeList(); 39 for (int a=0; a<atts.getLength(); a++) { 40 int nc = atts.getNameCode(a); 41 checkUnknownAttribute(nc); 42 } 43 44 } 45 46 public void validate() throws XPathException { 47 checkWithinTemplate(); 48 } 49 50 public Expression compile(Executable exec) throws XPathException { 51 Expression content = compileSequenceConstructor(exec, iterateAxis(Axis.CHILD), true); 52 if (content == null) { 53 content = EmptySequence.getInstance(); 54 } 55 Doctype inst = new Doctype(content); 56 return inst; 57 } 58 59 60 } 61 | Popular Tags |