NamedNodeMap entities = doctype.getEntities(); String internalSubset = doctype.getInternalSubset(); if (internalSubset == null) {
NamedNodeMap entities = doctype.getEntities(); if(null == entities) return url;
NamedNodeMap entities = doctype.getEntities(); if(null == entities) return url;
DocumentType doctype = _document.getDoctype(); if (doctype != null) { NamedNodeMap entities = doctype.getEntities();
NamedNodeMap entities = doctype.getEntities(); if(null == entities) return url;
NamedNodeMap entities = doctype.getEntities(); if(null == entities) return url;
NamedNodeMap entities = docType.getEntities(); for (int i = 0; i < entities.getLength(); i++) { Entity ent = (Entity) entities.item(i);
NamedNodeMap entities = docType.getEntities(); for (int i = 0; i < entities.getLength(); i++) { Entity ent = (Entity) entities.item(i);
// some trivial example XML String xml = "<!DOCTYPE example [ <!ENTITY foo 'bar'> ]><example><foo>&foo;</foo></example>"; InputStream is = new ByteArrayInputStream(xml.getBytes()); // parse DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document doc = builder.parse(is); DocumentType docType = doc.getDoctype(); // retrieve the entity - works fine Entity foo = (Entity) docType.getEntities().getNamedItem("foo"); for(int i = 0; i < foo.getChildNodes().getLength(); i++) { System.out.println(foo.getChildNodes().item(i)); }
public DOMNamedNodeMap getEntities() { return wrap(_delegate.getEntities()); }
/** * Extracts NamedNodeMap of entities. We need this to validate * elements and attributes of type xs:ENTITY, xs:ENTITIES or * types dervied from them. */ private void setupEntityMap(Document doc) { if (doc != null) { DocumentType docType = doc.getDoctype(); if (docType != null) { fEntities = docType.getEntities(); return; } } fEntities = null; }
/** * Extracts NamedNodeMap of entities. We need this to validate * elements and attributes of type xs:ENTITY, xs:ENTITIES or * types dervied from them. */ private void setupEntityMap(Document doc) { if (doc != null) { DocumentType docType = doc.getDoctype(); if (docType != null) { fEntities = docType.getEntities(); return; } } fEntities = null; }
/** * Extracts NamedNodeMap of entities. We need this to validate * elements and attributes of type xs:ENTITY, xs:ENTITIES or * types dervied from them. */ private void setupEntityMap(Document doc) { if (doc != null) { DocumentType docType = doc.getDoctype(); if (docType != null) { fEntities = docType.getEntities(); return; } } fEntities = null; }
protected void write(DocumentType docType) throws java.io.IOException { //System.out.println("! FOUND DOCTYPE for "+docType.getName()); if (docTypePublic != null || docTypeSystem != null) { // The header printing has already taken care of the DOCTYPE. return; } write(docType.getName(), docType.getPublicId(), docType.getSystemId(), docType.getEntities()); }
@Override public boolean isEqualNode(Node node) { if (node.getNodeType() != Node.DOCUMENT_TYPE_NODE) return false; DocumentType other = (DocumentType) node; if (!isEq(getPublicId(), other.getPublicId())) return false; if (!isEq(getSystemId(), other.getSystemId())) return false; NamedNodeMap thisEnts = getEntities(); NamedNodeMap nodeEnts = other.getEntities(); int len = thisEnts.getLength(); if (len != nodeEnts.getLength()) return false; for (int i = 0; i < len; i++) { if (!thisEnts.item(i).isEqualNode(nodeEnts.item(i))) return false; } return true; }
public boolean isParsedEntity(EntityReference entityreference) { String s = entityreference.getNodeName(); Document document = entityreference.getOwnerDocument(); DocumentType documenttype = document.getDoctype(); if(documenttype == null) return false; NamedNodeMap namednodemap = documenttype.getEntities(); Entity entity = (Entity)namednodemap.getNamedItem(s); if(entity == null) return false; else return entity.getNotationName() == null; }
public boolean isParsedEntity (final EntityReference entityRef) { final String name = entityRef.getNodeName (); final Document doc = entityRef.getOwnerDocument (); final DocumentType doctype = doc.getDoctype (); if (doctype == null) return false; final NamedNodeMap entities = doctype.getEntities (); final Entity entity = (Entity) entities.getNamedItem (name); if (entity == null) return false; return entity.getNotationName () == null; } }
public boolean isParsedEntity(EntityReference entityRef) { String name = entityRef.getNodeName(); Document doc = entityRef.getOwnerDocument(); DocumentType doctype = doc.getDoctype(); if (doctype == null) { return (false); } NamedNodeMap entities = doctype.getEntities(); Entity entity = (Entity)entities.getNamedItem(name); if (entity == null) { return (false); } return (entity.getNotationName() == null); } }
public void visit(DocumentType type) { if (action(type)) { visit(type.getEntities()); visit(type.getNotations()); } }
public void visit(DocumentType type) { if (action(type)) { visit(type.getEntities()); visit(type.getNotations()); } }