url = entity.getPublicId();
url = entity.getPublicId();
uri = entity.getSystemId(); if (uri == null) { uri = entity.getPublicId();
url = entity.getPublicId();
url = entity.getPublicId();
&& entName.equals(nodeName)) { if (ent.getPublicId() != null || ent.getSystemId() != null || ent.getNotationName() != null) {
&& entName.equals(nodeName)) { if (ent.getPublicId() != null || ent.getSystemId() != null || ent.getNotationName() != null) {
public boolean enter (final Entity entity) { final String name = entity.getNodeName (); final String pid = entity.getPublicId (); final String sid = entity.getSystemId (); final String notation = entity.getNotationName (); buffer_.append ("<!ENTITY ").append (name); if (sid != null) { if (pid != null) buffer_.append (" PUBLIC \"").append (pid).append ("\" \"").append (UXML.escapeSystemQuot (sid)).append ("\">"); else buffer_.append (" SYSTEM \"").append (UXML.escapeSystemQuot (sid)).append ("\">"); if (notation != null) buffer_.append (" NDATA ").append (notation).append (">"); } else { buffer_.append (" \""); final XMLMaker entityMaker = new XMLMaker (); UDOMVisitor.traverseChildren (entity, entityMaker); buffer_.append (UXML.escapeEntityQuot (entityMaker.getText ())).append ("\"").append (">"); } return false; }
/** * Evaluate the function. * * @param pattern The context pattern. * @param args The evaluated arguments */ public Object eval(Node node, ExprEnvironment env, AbstractPattern pattern, ArrayList args) throws XPathException { if (args.size() < 1) return ""; String name = Expr.toString(args.get(0)); Document doc = node.getOwnerDocument(); DocumentType dtd = doc.getDoctype(); NamedNodeMap map = dtd.getEntities(); Entity entity = (Entity) map.getNamedItem(name); if (entity == null) return ""; else if (entity.getSystemId() != null && ! entity.getSystemId().equals("")) return entity.getSystemId(); else return entity.getPublicId(); } }
String publicId = e.getPublicId(); receiver.setUnparsedEntity(name, systemId, publicId);
String publicId = e.getPublicId(); receiver.setUnparsedEntity(name, systemId, publicId);
uri = entity.getSystemId(); if (uri == null) { uri = entity.getPublicId();
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; DocumentType docType; NamedNodeMap entityList; Entity entityNode; String publicId; doc = (Document) load("staff", false); docType = doc.getDoctype(); assertNotNull("docTypeNotNull", docType); entityList = docType.getEntities(); assertNotNull("entitiesNotNull", entityList); entityNode = (Entity) entityList.getNamedItem("ent1"); publicId = entityNode.getPublicId(); assertNull("entityGetPublicIdNullAssert", publicId); } /**
private void _handleEntities(DocumentType documenttype) { try { NamedNodeMap namednodemap = documenttype.getEntities(); int i = namednodemap.getLength(); for(int j = 0; j < i; j++) { Entity entity = (Entity)namednodemap.item(j); String s = entity.getPublicId(); String s1 = entity.getSystemId(); String s2 = entity.getNotationName(); if(s != null || s1 != null) _handleExternalEntity(entity.getNodeName(), s, s1, s2); else _handleInternalEntity(entity); } NamedNodeMap namednodemap1 = documenttype.getNotations(); int k = namednodemap1.getLength(); for(int l = 0; l < k; l++) { Notation notation = (Notation)namednodemap1.item(l); String s3 = notation.getPublicId(); String s4 = notation.getSystemId(); dtd_.notationDecl(notation.getNodeName(), s3, s4); } } catch(SAXException saxexception) { _errorReport(saxexception); } }
private void _handleEntities(DocumentType documenttype) { try { NamedNodeMap namednodemap = documenttype.getEntities(); int i = namednodemap.getLength(); for(int j = 0; j < i; j++) { Entity entity = (Entity)namednodemap.item(j); String s = entity.getPublicId(); String s1 = entity.getSystemId(); String s2 = entity.getNotationName(); if(s != null || s1 != null) _handleExternalEntity(entity.getNodeName(), s, s1, s2); else _handleInternalEntity(entity); } NamedNodeMap namednodemap1 = documenttype.getNotations(); int k = namednodemap1.getLength(); for(int l = 0; l < k; l++) { Notation notation = (Notation)namednodemap1.item(l); String s3 = notation.getPublicId(); String s4 = notation.getSystemId(); dtd_.notationDecl(notation.getNodeName(), s3, s4); } } catch(SAXException saxexception) { _errorReport(saxexception); } }
for (int i = 0; i < nEntities; i++) { Entity entity = (Entity) entities.item(i); String publicID = entity.getPublicId(); String systemID = entity.getSystemId(); String notationName = entity.getNotationName();
final String publicID = entity.getPublicId (); final String systemID = entity.getSystemId (); final String notationName = entity.getNotationName ();
for (int i = 0;i < nEntities;i++) { Entity entity = (Entity)entities.item(i); String publicID = entity.getPublicId(); String systemID = entity.getSystemId(); String notationName = entity.getNotationName();
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; DocumentType docType; NamedNodeMap entityList; Entity entityNode; String publicId; String systemId; String notation; doc = (Document) load("staff", false); docType = doc.getDoctype(); assertNotNull("docTypeNotNull", docType); entityList = docType.getEntities(); assertNotNull("entitiesNotNull", entityList); entityNode = (Entity) entityList.getNamedItem("ent5"); publicId = entityNode.getPublicId(); assertEquals("publicId", "entityURI", publicId); systemId = entityNode.getSystemId(); assertURIEquals("systemId", null, null, null, "entityFile", null, null, null, null, systemId); notation = entityNode.getNotationName(); assertEquals("notation", "notation1", notation); } /**
Entity oldEntity = (Entity) oldMap.item(i); EntityImpl newEntity = (EntityImpl) fDocumentImpl.createEntity(oldEntity.getNodeName()); newEntity.setPublicId(oldEntity.getPublicId()); newEntity.setSystemId(oldEntity.getSystemId()); newEntity.setNotationName(oldEntity.getNotationName());