1 52 53 package freemarker.ext.dom; 54 55 import org.w3c.dom.*; 56 import freemarker.template.*; 57 58 class DocumentTypeModel extends NodeModel { 59 60 public DocumentTypeModel(DocumentType docType) { 61 super(docType); 62 } 63 64 public String getAsString() { 65 return ((ProcessingInstruction) node).getData(); 66 } 67 68 public TemplateSequenceModel getChildren() throws TemplateModelException { 69 throw new TemplateModelException("entering the child nodes of a DTD node is not currently supported"); 70 } 71 72 public TemplateModel get(String key) throws TemplateModelException { 73 throw new TemplateModelException("accessing properties of a DTD is not currently supported"); 74 } 75 76 public String getNodeName() { 77 return "@document_type$" + ((DocumentType) node).getNodeName(); 78 } 79 80 public boolean isEmpty() { 81 return true; 82 } 83 } | Popular Tags |