Java Code Examples for org.w3c.dom.DocumentType#getNotations()
The following examples show how to use
org.w3c.dom.DocumentType#getNotations() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DOMResultBuilder.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
public void doctypeDecl(DocumentType node) throws XNIException { /** Create new DocumentType node for the target. */ if (fDocumentImpl != null) { DocumentType docType = fDocumentImpl.createDocumentType(node.getName(), node.getPublicId(), node.getSystemId()); final String internalSubset = node.getInternalSubset(); /** Copy internal subset. */ if (internalSubset != null) { ((DocumentTypeImpl) docType).setInternalSubset(internalSubset); } /** Copy entities. */ NamedNodeMap oldMap = node.getEntities(); NamedNodeMap newMap = docType.getEntities(); int length = oldMap.getLength(); for (int i = 0; i < length; ++i) { 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()); newMap.setNamedItem(newEntity); } /** Copy notations. */ oldMap = node.getNotations(); newMap = docType.getNotations(); length = oldMap.getLength(); for (int i = 0; i < length; ++i) { Notation oldNotation = (Notation) oldMap.item(i); NotationImpl newNotation = (NotationImpl) fDocumentImpl.createNotation(oldNotation.getNodeName()); newNotation.setPublicId(oldNotation.getPublicId()); newNotation.setSystemId(oldNotation.getSystemId()); newMap.setNamedItem(newNotation); } append(docType); } }
Example 2
Source File: DOMResultBuilder.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public void doctypeDecl(DocumentType node) throws XNIException { /** Create new DocumentType node for the target. */ if (fDocumentImpl != null) { DocumentType docType = fDocumentImpl.createDocumentType(node.getName(), node.getPublicId(), node.getSystemId()); final String internalSubset = node.getInternalSubset(); /** Copy internal subset. */ if (internalSubset != null) { ((DocumentTypeImpl) docType).setInternalSubset(internalSubset); } /** Copy entities. */ NamedNodeMap oldMap = node.getEntities(); NamedNodeMap newMap = docType.getEntities(); int length = oldMap.getLength(); for (int i = 0; i < length; ++i) { 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()); newMap.setNamedItem(newEntity); } /** Copy notations. */ oldMap = node.getNotations(); newMap = docType.getNotations(); length = oldMap.getLength(); for (int i = 0; i < length; ++i) { Notation oldNotation = (Notation) oldMap.item(i); NotationImpl newNotation = (NotationImpl) fDocumentImpl.createNotation(oldNotation.getNodeName()); newNotation.setPublicId(oldNotation.getPublicId()); newNotation.setSystemId(oldNotation.getSystemId()); newMap.setNamedItem(newNotation); } append(docType); } }
Example 3
Source File: DOMResultBuilder.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public void doctypeDecl(DocumentType node) throws XNIException { /** Create new DocumentType node for the target. */ if (fDocumentImpl != null) { DocumentType docType = fDocumentImpl.createDocumentType(node.getName(), node.getPublicId(), node.getSystemId()); final String internalSubset = node.getInternalSubset(); /** Copy internal subset. */ if (internalSubset != null) { ((DocumentTypeImpl) docType).setInternalSubset(internalSubset); } /** Copy entities. */ NamedNodeMap oldMap = node.getEntities(); NamedNodeMap newMap = docType.getEntities(); int length = oldMap.getLength(); for (int i = 0; i < length; ++i) { 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()); newMap.setNamedItem(newEntity); } /** Copy notations. */ oldMap = node.getNotations(); newMap = docType.getNotations(); length = oldMap.getLength(); for (int i = 0; i < length; ++i) { Notation oldNotation = (Notation) oldMap.item(i); NotationImpl newNotation = (NotationImpl) fDocumentImpl.createNotation(oldNotation.getNodeName()); newNotation.setPublicId(oldNotation.getPublicId()); newNotation.setSystemId(oldNotation.getSystemId()); newMap.setNamedItem(newNotation); } append(docType); } }
Example 4
Source File: DOMResultBuilder.java From JDKSourceCode1.8 with MIT License | 5 votes |
public void doctypeDecl(DocumentType node) throws XNIException { /** Create new DocumentType node for the target. */ if (fDocumentImpl != null) { DocumentType docType = fDocumentImpl.createDocumentType(node.getName(), node.getPublicId(), node.getSystemId()); final String internalSubset = node.getInternalSubset(); /** Copy internal subset. */ if (internalSubset != null) { ((DocumentTypeImpl) docType).setInternalSubset(internalSubset); } /** Copy entities. */ NamedNodeMap oldMap = node.getEntities(); NamedNodeMap newMap = docType.getEntities(); int length = oldMap.getLength(); for (int i = 0; i < length; ++i) { 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()); newMap.setNamedItem(newEntity); } /** Copy notations. */ oldMap = node.getNotations(); newMap = docType.getNotations(); length = oldMap.getLength(); for (int i = 0; i < length; ++i) { Notation oldNotation = (Notation) oldMap.item(i); NotationImpl newNotation = (NotationImpl) fDocumentImpl.createNotation(oldNotation.getNodeName()); newNotation.setPublicId(oldNotation.getPublicId()); newNotation.setSystemId(oldNotation.getSystemId()); newMap.setNamedItem(newNotation); } append(docType); } }
Example 5
Source File: DOMResultBuilder.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public void doctypeDecl(DocumentType node) throws XNIException { /** Create new DocumentType node for the target. */ if (fDocumentImpl != null) { DocumentType docType = fDocumentImpl.createDocumentType(node.getName(), node.getPublicId(), node.getSystemId()); final String internalSubset = node.getInternalSubset(); /** Copy internal subset. */ if (internalSubset != null) { ((DocumentTypeImpl) docType).setInternalSubset(internalSubset); } /** Copy entities. */ NamedNodeMap oldMap = node.getEntities(); NamedNodeMap newMap = docType.getEntities(); int length = oldMap.getLength(); for (int i = 0; i < length; ++i) { 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()); newMap.setNamedItem(newEntity); } /** Copy notations. */ oldMap = node.getNotations(); newMap = docType.getNotations(); length = oldMap.getLength(); for (int i = 0; i < length; ++i) { Notation oldNotation = (Notation) oldMap.item(i); NotationImpl newNotation = (NotationImpl) fDocumentImpl.createNotation(oldNotation.getNodeName()); newNotation.setPublicId(oldNotation.getPublicId()); newNotation.setSystemId(oldNotation.getSystemId()); newMap.setNamedItem(newNotation); } append(docType); } }
Example 6
Source File: DOMResultBuilder.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public void doctypeDecl(DocumentType node) throws XNIException { /** Create new DocumentType node for the target. */ if (fDocumentImpl != null) { DocumentType docType = fDocumentImpl.createDocumentType(node.getName(), node.getPublicId(), node.getSystemId()); final String internalSubset = node.getInternalSubset(); /** Copy internal subset. */ if (internalSubset != null) { ((DocumentTypeImpl) docType).setInternalSubset(internalSubset); } /** Copy entities. */ NamedNodeMap oldMap = node.getEntities(); NamedNodeMap newMap = docType.getEntities(); int length = oldMap.getLength(); for (int i = 0; i < length; ++i) { 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()); newMap.setNamedItem(newEntity); } /** Copy notations. */ oldMap = node.getNotations(); newMap = docType.getNotations(); length = oldMap.getLength(); for (int i = 0; i < length; ++i) { Notation oldNotation = (Notation) oldMap.item(i); NotationImpl newNotation = (NotationImpl) fDocumentImpl.createNotation(oldNotation.getNodeName()); newNotation.setPublicId(oldNotation.getPublicId()); newNotation.setSystemId(oldNotation.getSystemId()); newMap.setNamedItem(newNotation); } append(docType); } }
Example 7
Source File: DOMResultBuilder.java From Bytecoder with Apache License 2.0 | 5 votes |
public void doctypeDecl(DocumentType node) throws XNIException { /** Create new DocumentType node for the target. */ if (fDocumentImpl != null) { DocumentType docType = fDocumentImpl.createDocumentType(node.getName(), node.getPublicId(), node.getSystemId()); final String internalSubset = node.getInternalSubset(); /** Copy internal subset. */ if (internalSubset != null) { ((DocumentTypeImpl) docType).setInternalSubset(internalSubset); } /** Copy entities. */ NamedNodeMap oldMap = node.getEntities(); NamedNodeMap newMap = docType.getEntities(); int length = oldMap.getLength(); for (int i = 0; i < length; ++i) { 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()); newMap.setNamedItem(newEntity); } /** Copy notations. */ oldMap = node.getNotations(); newMap = docType.getNotations(); length = oldMap.getLength(); for (int i = 0; i < length; ++i) { Notation oldNotation = (Notation) oldMap.item(i); NotationImpl newNotation = (NotationImpl) fDocumentImpl.createNotation(oldNotation.getNodeName()); newNotation.setPublicId(oldNotation.getPublicId()); newNotation.setSystemId(oldNotation.getSystemId()); newMap.setNamedItem(newNotation); } append(docType); } }
Example 8
Source File: DOMResultBuilder.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public void doctypeDecl(DocumentType node) throws XNIException { /** Create new DocumentType node for the target. */ if (fDocumentImpl != null) { DocumentType docType = fDocumentImpl.createDocumentType(node.getName(), node.getPublicId(), node.getSystemId()); final String internalSubset = node.getInternalSubset(); /** Copy internal subset. */ if (internalSubset != null) { ((DocumentTypeImpl) docType).setInternalSubset(internalSubset); } /** Copy entities. */ NamedNodeMap oldMap = node.getEntities(); NamedNodeMap newMap = docType.getEntities(); int length = oldMap.getLength(); for (int i = 0; i < length; ++i) { 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()); newMap.setNamedItem(newEntity); } /** Copy notations. */ oldMap = node.getNotations(); newMap = docType.getNotations(); length = oldMap.getLength(); for (int i = 0; i < length; ++i) { Notation oldNotation = (Notation) oldMap.item(i); NotationImpl newNotation = (NotationImpl) fDocumentImpl.createNotation(oldNotation.getNodeName()); newNotation.setPublicId(oldNotation.getPublicId()); newNotation.setSystemId(oldNotation.getSystemId()); newMap.setNamedItem(newNotation); } append(docType); } }
Example 9
Source File: DocumentTypeTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
@Test public void testGetNotations() throws Exception { DocumentType documentType = createDOM("DocumentType03.xml").getDoctype(); NamedNodeMap nm = documentType.getNotations(); assertEquals(nm.getLength(), 2); // should return 2 because the notation // name is repeated and // it considers only the first // occurence assertEquals(nm.item(0).getNodeName(), "gs"); assertEquals(nm.item(1).getNodeName(), "name"); }
Example 10
Source File: DOMResultBuilder.java From hottub with GNU General Public License v2.0 | 5 votes |
public void doctypeDecl(DocumentType node) throws XNIException { /** Create new DocumentType node for the target. */ if (fDocumentImpl != null) { DocumentType docType = fDocumentImpl.createDocumentType(node.getName(), node.getPublicId(), node.getSystemId()); final String internalSubset = node.getInternalSubset(); /** Copy internal subset. */ if (internalSubset != null) { ((DocumentTypeImpl) docType).setInternalSubset(internalSubset); } /** Copy entities. */ NamedNodeMap oldMap = node.getEntities(); NamedNodeMap newMap = docType.getEntities(); int length = oldMap.getLength(); for (int i = 0; i < length; ++i) { 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()); newMap.setNamedItem(newEntity); } /** Copy notations. */ oldMap = node.getNotations(); newMap = docType.getNotations(); length = oldMap.getLength(); for (int i = 0; i < length; ++i) { Notation oldNotation = (Notation) oldMap.item(i); NotationImpl newNotation = (NotationImpl) fDocumentImpl.createNotation(oldNotation.getNodeName()); newNotation.setPublicId(oldNotation.getPublicId()); newNotation.setSystemId(oldNotation.getSystemId()); newMap.setNamedItem(newNotation); } append(docType); } }
Example 11
Source File: DOMResultBuilder.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public void doctypeDecl(DocumentType node) throws XNIException { /** Create new DocumentType node for the target. */ if (fDocumentImpl != null) { DocumentType docType = fDocumentImpl.createDocumentType(node.getName(), node.getPublicId(), node.getSystemId()); final String internalSubset = node.getInternalSubset(); /** Copy internal subset. */ if (internalSubset != null) { ((DocumentTypeImpl) docType).setInternalSubset(internalSubset); } /** Copy entities. */ NamedNodeMap oldMap = node.getEntities(); NamedNodeMap newMap = docType.getEntities(); int length = oldMap.getLength(); for (int i = 0; i < length; ++i) { 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()); newMap.setNamedItem(newEntity); } /** Copy notations. */ oldMap = node.getNotations(); newMap = docType.getNotations(); length = oldMap.getLength(); for (int i = 0; i < length; ++i) { Notation oldNotation = (Notation) oldMap.item(i); NotationImpl newNotation = (NotationImpl) fDocumentImpl.createNotation(oldNotation.getNodeName()); newNotation.setPublicId(oldNotation.getPublicId()); newNotation.setSystemId(oldNotation.getSystemId()); newMap.setNamedItem(newNotation); } append(docType); } }
Example 12
Source File: DOMResultBuilder.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public void doctypeDecl(DocumentType node) throws XNIException { /** Create new DocumentType node for the target. */ if (fDocumentImpl != null) { DocumentType docType = fDocumentImpl.createDocumentType(node.getName(), node.getPublicId(), node.getSystemId()); final String internalSubset = node.getInternalSubset(); /** Copy internal subset. */ if (internalSubset != null) { ((DocumentTypeImpl) docType).setInternalSubset(internalSubset); } /** Copy entities. */ NamedNodeMap oldMap = node.getEntities(); NamedNodeMap newMap = docType.getEntities(); int length = oldMap.getLength(); for (int i = 0; i < length; ++i) { 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()); newMap.setNamedItem(newEntity); } /** Copy notations. */ oldMap = node.getNotations(); newMap = docType.getNotations(); length = oldMap.getLength(); for (int i = 0; i < length; ++i) { Notation oldNotation = (Notation) oldMap.item(i); NotationImpl newNotation = (NotationImpl) fDocumentImpl.createNotation(oldNotation.getNodeName()); newNotation.setPublicId(oldNotation.getPublicId()); newNotation.setSystemId(oldNotation.getSystemId()); newMap.setNamedItem(newNotation); } append(docType); } }
Example 13
Source File: AbstractXmlDocumentType.java From JVoiceXML with GNU Lesser General Public License v2.1 | 4 votes |
/** * {@inheritDoc} */ public final NamedNodeMap getNotations() { final DocumentType type = getDocumentType(); return type.getNotations(); }