GetElementsByTagName
Description
Retrieves all the elements in the XML document that have the
specified TagName.
Syntax
|
1 |
pbdom_object_name.GetElementsByTagName(string strTagName, ref pbdom_element pbdom_element_array[]) |
|
Argument |
Description |
|---|---|
|
strTagName |
The TagName of the elements to be searched |
|
pbdom_element_array[] |
A reference to a PBDOM_ELEMENT object array that |
Return value
Boolean.
GetElementsByTagName returns true for success and false if an
exception occurs.
Examples
Assume a PBDOM_DOCUMENT contains the following XML
fragment:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<book> <title>The Winter's Tale</title> <author>William Shakespeare</author> <price>7.95</price> <quantity>1</quantity> </book> <book> <title>Le Lecon</title> <author>Eugene Ionesco</author> <price>10.95</price> <quantity>1</quantity> </book> <book> <title>Deutsches Tempo</title> <author>Kurt Tucholsky</author> <price>13.95</price> <quantity>1</quantity> </book> |
The following statements extract the list of titles from the
document and display it in a multilineedit control:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
pbdom_document doc pbdom_element element[] // doc contains role elements boolean bb_bool bb_bool = doc.getelementsbytagname("title",element[]) integer ii_bound, i ii_bound = upperbound(element) for i = 1 to ii_bound mle_1.text += element[i].gettext() + "~r~n" next |
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest