Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. <?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
  2.  
  3. <!--
  4.  
  5. Copyright (c) 2001-2003 World Wide Web Consortium,
  6. (Massachusetts Institute of Technology, Institut National de
  7. Recherche en Informatique et en Automatique, Keio University).  All
  8. Rights Reserved.  This program is distributed under the W3C's Software
  9. Intellectual Property License.  This program is distributed in the
  10. hope that it will be useful, but WITHOUT ANY WARRANTY; without even
  11. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  12. PURPOSE.  
  13.  
  14. See W3C License http://www.w3.org/Consortium/Legal/ for more details.
  15.  
  16. -->
  17. <!DOCTYPE test SYSTEM "dom2.dtd">
  18. <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-2" name="removeAttributeNS02">
  19. <metadata>
  20. <title>removeAttributeNS02</title>
  21. <creator>NIST</creator>
  22. <description>
  23.     The "removeAttributeNS(namespaceURI,localName)" removes an attribute by
  24.    local name and namespace URI.  If the removed attribute has a
  25.    default value it is immediately replaced.  The replacing attribute has the same
  26.    namespace URI and local name, as well as the original prefix.
  27.    
  28.    Retrieve the attribute named "emp:local" from emp:address
  29.    node, then remove the "emp:local"
  30.    attribute by invoking the "removeAttributeNS(namespaceURI,localName)" method.
  31.    The "emp:local" attribute has a default value defined in the
  32.    DTD file, that value should immediately replace the old
  33.    value.
  34. </description>
  35. <contributor>Mary Brady</contributor>
  36. <date qualifier="created">2001-08-17</date>
  37. <subject resource="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElRemAtNS"/>
  38. <subject resource="http://www.w3.org/Bugs/Public/show_bug.cgi?id=238"/>
  39. </metadata>
  40. <!--  this test requires namespace awareness and validation   -->
  41. <implementationAttribute name="namespaceAware" value="true"/>
  42. <implementationAttribute name="validating" value="true"/>
  43. <var name="doc" type="Document"/>
  44. <var name="elementList" type="NodeList"/>
  45. <var name="testAddr" type="Node"/>
  46. <var name="addrAttr" type="Attr"/>
  47. <var name="attr" type="DOMString"/>
  48. <var name="namespaceURI" type="DOMString"/>
  49. <var name="localName" type="DOMString"/>
  50. <var name="prefix" type="DOMString"/>
  51. <load var="doc" href="staffNS" willBeModified="true"/>
  52. <getElementsByTagName interface="Document" obj="doc" var="elementList" tagname="&quot;emp:address&quot;"/>
  53. <item interface="NodeList" obj="elementList" var="testAddr" index="0"/>
  54. <removeAttributeNS obj="testAddr" namespaceURI='"http://www.nist.gov"' localName='"local1"'/>
  55. <getElementsByTagName interface="Document" obj="doc" var="elementList" tagname="&quot;emp:address&quot;"/>
  56. <item interface="NodeList" obj="elementList" var="testAddr" index="0"/>
  57. <getAttributeNodeNS obj="testAddr" var="addrAttr" namespaceURI='"http://www.nist.gov"' localName='"local1"'/>
  58. <getAttributeNS obj="testAddr" var="attr" namespaceURI='"http://www.nist.gov"' localName='"local1"'/>
  59. <namespaceURI obj="addrAttr" var="namespaceURI"/>
  60. <localName obj="addrAttr" var="localName"/>
  61. <prefix obj="testAddr" var="prefix"/>
  62. <assertEquals actual="attr" expected='"FALSE"' ignoreCase="false" id="attr"/>
  63. <assertEquals actual="namespaceURI" expected='"http://www.nist.gov"' ignoreCase="false" id="uri"/>
  64. <assertEquals actual="localName" expected='"local1"' ignoreCase="false" id="lname"/>
  65. <assertEquals actual="prefix" expected='"emp"' ignoreCase="false" id="prefix"/>
  66. </test>
  67.