RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TWSDLItems.CompareName Method

Indicates whether two node names refer to the same element.

Pascal
function CompareName(const NodeName: DOMString; const OtherName: DOMString; const TNS: DOMString = ''): boolean;
C++
__fastcall boolean CompareName(const DOMString NodeName, const DOMString OtherName, const DOMString TNS = '');

Call CompareName to compare the names of two nodes to determine whether they match. CompareName compares the node names, taking into account any namespace prefix added to the node names. CompareName uses the namespace prefix to look up the corresponding namespace URI. If either node name does not have a namespace prefix, CompareName uses the TargetNamespace property for the first node name, and the supplied namespace for the second. CompareName can find a match between two node names that have different namespace prefixes, as long as both prefixes map to the same namespace URI. 

NodeName and OtherName are the two node names to compare. 

TNS is the target namespace for OtherName. If this is a nonempty string, it is used to replace the namespace of OtherName. If it is an empty string, OtherName uses the namespace associated with its namespace prefix, or the TargetNamespace property if it has no namespace prefix. 

CompareName returns true if the two names match, false if they differ (either in the local name, or in the namespace to which the names belong). 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!