Changeset 53
- Timestamp:
- 01/21/12 07:40:52 (4 months ago)
- Files:
-
- trunk/std/xmlp/linkdom.d (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/std/xmlp/linkdom.d
r52 r53 1758 1758 ChildNode lastChild_; 1759 1759 1760 /// Remove all links at once. Let the GC sort this out! 1761 void removeAll() 1762 { 1763 firstChild_ = null; 1764 lastChild_ = null; 1765 } 1766 1760 1767 /// remove 1761 1768 void removeLink(ChildNode ch) … … 2184 2191 return result; 2185 2192 } 2186 /// method 2193 /// Brutal replacement of all children with single text node 2194 override void setTextContent(DOMString txt) 2195 { 2196 children_.removeAll(); 2197 if (txt.length > 0) 2198 appendChild(new Text(txt)); 2199 } 2200 ///Recursive on Text-like data. Has no implementation of isTextNodeWhiteSpace 2187 2201 override const DOMString getTextContent() 2188 2202 { … … 2198 2212 switch(n.getNodeType()) 2199 2213 { 2200 case NodeType.Processing_Instruction_node: 2214 //case NodeType.Comment_node:// 2215 //case NodeType.Processing_Instruction_node: 2201 2216 case NodeType.CDATA_Section_node: 2202 case NodeType.Comment_node:2203 2217 case NodeType.Text_node: 2204 app.put(n.getNodeValue());2205 break;2206 2218 case NodeType.Element_node: 2207 2219 app.put(n.getTextContent()); … … 2235 2247 } 2236 2248 } 2237 2249 2250 /// This is none-DOM, put in because std.xml had it 2238 2251 @property const DOMString text() 2239 2252 { … … 2615 2628 id_ = text(id_[0..offset], s, id_[offset+count..$]); 2616 2629 } 2617 2630 /// Has text, so get it 2631 override DOMString getTextContent() 2632 { 2633 return id_; 2634 } 2635 /// Takes text, so set it 2636 override void setTextContent(DOMString txt) 2637 { 2638 id_ = txt; 2639 } 2618 2640 2619 2641 };
