| <?xml version="1.0" standalone="no"?> |
| <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" |
| "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> |
| |
| |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| <!-- ========================================================================= --> |
| <!-- --> |
| <!-- @author vincent.hardy@sun.com --> |
| <!-- @version $Id$ --> |
| <!-- ========================================================================= --> |
| |
| <svg xmlns="http://www.w3.org/2000/svg" |
| xmlns:xlink="http://www.w3.org/1999/xlink" |
| xmlns:test="http://xml.apache.org/batik/test" |
| width="350" height="350" onload="runTest(evt)" > |
| |
| <test:testResult id="testResult" /> |
| |
| <script type="text/ecmascript"> |
| var testNS = "http://xml.apache.org/batik/test"; |
| |
| function runTest() { |
| var result = document.getElementById("testResult"); |
| var t = document.getElementById("text"); |
| t.setAttributeNS("http://foo.com", "foo:bar", "barValue"); |
| var an = t.getAttributeNodeNS("http://foo.com", "bar"); |
| t.removeAttributeNode(an); |
| |
| t.setAttribute("fake-attribute","fake-value"); |
| an = t.getAttributeNode("fake-attribute"); |
| t.removeAttributeNode(an); |
| |
| if ( !t.hasAttributeNS("http://foo.com", "bar") && |
| !t.hasAttribute("fake-attribute") ) |
| { |
| t.setAttributeNS(null, "fill", "#0F0"); |
| result.setAttributeNS(null, "result", "passed"); |
| } |
| } |
| |
| </script> |
| |
| <text id="text" x="50%" y="50%" text-anchor="middle" fill="red">This string is red if test failed, green otherwise</text> |
| |
| </svg> |