4D v16.3

DOM Find XML element by ID

Home

 
4D v16.3
DOM Find XML element by ID

DOM Find XML element by ID 


 

DOM Find XML element by ID ( elementRef ; id ) -> Function result 
Parameter Type   Description
elementRef  String in XML element reference
id  String in Value of ID attribute of element to look for
Function result  String in Reference of the element found (if applicable)

The DOM Find XML element by ID command searches within an XML document for the element whose id attribute equals the value passed in the id parameter.

In elementRef, pass the reference of an element in the XML document where you want to perform the search. You can pass the reference of the root element or any other element; the search does not take the position of elementRef into account and always searches the whole document. 

The command returns the XML reference of the element found as a result.

Warning: In XML, the id attribute associates a unique ID to each document element. The value of the id attribute must be a valid XML name and it must be unique among all the elements in the XML document (validity constraint). In order for the DOM Find XML element by ID command to work properly, this constraint must be complied with; otherwise, the result is random (the command returns the reference to the first element found in the document).



See also 

DOM Find XML element

 
PROPERTIES 

Product: 4D
Theme: XML DOM
Number: 1010

The OK variable is changed by the commandThis command can be run in preemptive processes

 
HISTORY 

Created: 4D v11 SQL

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)