2 new revisions:

Revision: 0105c12b3ef9
Branch:   default
Author:   Robot Framework Developers ([email protected])
Date:     Thu Oct 18 06:41:17 2012
Log:      XMLlib: More kw docs....
http://code.google.com/p/robotframework/source/detail?r=0105c12b3ef9

Revision: b788500f79b1
Branch:   default
Author:   Robot Framework Developers ([email protected])
Date:     Thu Oct 18 06:43:12 2012
Log:      Automated merge with https://robotframework.googlecode.com/hg/
http://code.google.com/p/robotframework/source/detail?r=b788500f79b1

==============================================================================
Revision: 0105c12b3ef9
Branch:   default
Author:   Robot Framework Developers ([email protected])
Date:     Thu Oct 18 06:41:17 2012
Log:      XMLlib: More kw docs.

Update issue 1234
Documented `Clear Element`.
http://code.google.com/p/robotframework/source/detail?r=0105c12b3ef9

Modified:
 /src/robot/libraries/XML.py

=======================================
--- /src/robot/libraries/XML.py Thu Oct 18 04:23:10 2012
+++ /src/robot/libraries/XML.py Thu Oct 18 06:41:17 2012
@@ -782,6 +782,8 @@
         | Element Text Should Be | ${XML} | new text | xpath=first    |
         | Set Element Text       | ${XML} | tail=&   | xpath=html/p/b |
| Element Text Should Be | ${XML} | Text with bold&italics. | xpath=html/p | normalize_whitespace=yes | + | Set Element Text | ${XML} | slanted | !! | xpath=html/p/i | + | Element Text Should Be | ${XML} | Text with bold&slanted!! | xpath=html/p | normalize_whitespace=yes |

         New in Robot Framework 2.7.5.
         """
@@ -958,6 +960,31 @@
                     return parent

     def clear_element(self, source, xpath='.', clear_tail=False):
+        """Clears the contents of the specified element.
+
+        The element to clear is specified using `source` and `xpath`. They
+        have exactly the same semantics as with `Get Element` keyword.
+        The given `source` structure  is modified and also returned.
+
+ Clearing the element means removing its text, attributes, and children. + Element's tail text is not removed by default, but that can be changed
+        by giving `clear_tail` a true value (e.g. any non-empty string).
+        See `Element attributes` section for more information about tail in
+        general.
+
+        Examples using `${XML}` structure from `Example`:
+        | Clear Element            | ${XML}   | xpath=first |
+        | ${first} = | Get Element | ${XML}   | xpath=first |
+        | Elements Should Be Equal | ${first} | <first/>    |
+ | Clear Element | ${XML} | xpath=html/p/b | clear_tail=yes | + | Element Text Should Be | ${XML} | Text with italics. | xpath=html/p | normalize_whitespace=yes |
+        | Clear Element            | ${XML}   |
+        | Elements Should Be Equal | ${XML}   | <example/> |
+
+        Use `Remove Element` to remove the whole element.
+
+        New in Robot Framework 2.7.5.
+        """
         source = self.get_element(source)
         element = self.get_element(source, xpath)
         tail = element.tail

==============================================================================
Revision: b788500f79b1
Branch:   default
Author:   Robot Framework Developers ([email protected])
Date:     Thu Oct 18 06:43:12 2012
Log:      Automated merge with https://robotframework.googlecode.com/hg/
http://code.google.com/p/robotframework/source/detail?r=b788500f79b1

Modified:
 /src/robot/libraries/XML.py

=======================================
--- /src/robot/libraries/XML.py Thu Oct 18 05:45:15 2012
+++ /src/robot/libraries/XML.py Thu Oct 18 06:43:12 2012
@@ -782,6 +782,8 @@
         | Element Text Should Be | ${XML} | new text | xpath=first    |
         | Set Element Text       | ${XML} | tail=&   | xpath=html/p/b |
| Element Text Should Be | ${XML} | Text with bold&italics. | xpath=html/p | normalize_whitespace=yes | + | Set Element Text | ${XML} | slanted | !! | xpath=html/p/i | + | Element Text Should Be | ${XML} | Text with bold&slanted!! | xpath=html/p | normalize_whitespace=yes |

         New in Robot Framework 2.7.5.
         """
@@ -960,6 +962,31 @@
                     return parent

     def clear_element(self, source, xpath='.', clear_tail=False):
+        """Clears the contents of the specified element.
+
+        The element to clear is specified using `source` and `xpath`. They
+        have exactly the same semantics as with `Get Element` keyword.
+        The given `source` structure  is modified and also returned.
+
+ Clearing the element means removing its text, attributes, and children. + Element's tail text is not removed by default, but that can be changed
+        by giving `clear_tail` a true value (e.g. any non-empty string).
+        See `Element attributes` section for more information about tail in
+        general.
+
+        Examples using `${XML}` structure from `Example`:
+        | Clear Element            | ${XML}   | xpath=first |
+        | ${first} = | Get Element | ${XML}   | xpath=first |
+        | Elements Should Be Equal | ${first} | <first/>    |
+ | Clear Element | ${XML} | xpath=html/p/b | clear_tail=yes | + | Element Text Should Be | ${XML} | Text with italics. | xpath=html/p | normalize_whitespace=yes |
+        | Clear Element            | ${XML}   |
+        | Elements Should Be Equal | ${XML}   | <example/> |
+
+        Use `Remove Element` to remove the whole element.
+
+        New in Robot Framework 2.7.5.
+        """
         source = self.get_element(source)
         element = self.get_element(source, xpath)
         tail = element.tail

Reply via email to