Tests namespace. @throws Exception if the test fails
()
| 126 | * @throws Exception if the test fails |
| 127 | */ |
| 128 | @Test |
| 129 | public void namespace() throws Exception { |
| 130 | final String content |
| 131 | = "<?xml version='1.0'?>\n" |
| 132 | + "<RDF xmlns='http://www.w3.org/1999/02/22-rdf-syntax-ns#' " |
| 133 | + "xmlns:em='http://www.mozilla.org/2004/em-rdf#'>" |
| 134 | + "<Description about='urn:mozilla:install-manifest'>" |
| 135 | + "<em:name>My Plugin</em:name>" |
| 136 | + "</Description>\n" |
| 137 | + "</RDF>"; |
| 138 | |
| 139 | final XmlPage xmlPage = testDocument(content, MimeType.TEXT_XML); |
| 140 | final Node node = xmlPage.getXmlDocument().getFirstChild().getFirstChild().getFirstChild(); |
| 141 | assertEquals("em:name", node.getNodeName()); |
| 142 | assertEquals("name", node.getLocalName()); |
| 143 | assertEquals("http://www.mozilla.org/2004/em-rdf#", node.getNamespaceURI()); |
| 144 | } |
| 145 | |
| 146 | /** |
| 147 | * Tests a simple valid XML document. |
no test coverage detected