THtmlNode() > Overloaded operators xHarbour Developers Network  

oTHtmlNode - <cTagName>

Closes a new HTML node

Syntax

- <cTagName>

Arguments

<cTagName>
This is a character string holding the HTML tag name of the self object.

Description

The overloaded minus operator accepts a THtmlNode object as left operand, and a character string holding the HTML tag name of the THtmlNode as right operand. If the right operand is not the HTML tag name, a runtime error occurs. Otherwise, the HTML node is closed and the parent node is returned. For example:

   oDoc       := THtmlDocument():new()
   oNode      := oDoc:body + "p"
   oNode:text := "This is "

   oNode      := oNode + "i"
   oNode:text := "italic "

   oNode      := oNode + "b"
   oNode:text := "and bold "

   oNode      := oNode - "b"
   oNode      := oNode - "i"

   oNode:text := "Text."

   ? oDoc:body:toString()
   ** output
   // <body>
   // <p>This is <i>italic <b>and bold </b></i>Text.
   // </body>

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe