Lets See What Is DOM.
DOM stands for document object model which is interpreted by browser and presents the DOM in better human understandable html format. DOM is hierarchy structure of webelements.
Lets see simple DOM presented in html format.
<html><head><body><tr><td><input type="text" value="Debasish" /></td><td><input type="text" value="Subhasish" /></td></tr></body></head></html>.
If you see above html, it will look like XML. Only difference between html and XML is html has fixed set of tags and tags are not case sensitive. Does not matter, if one writes "tr" or "Tr" or "TR". Its all same for html. But, XML tags are case sensitive. So, in general, XML does have user defined tags which is case sensitive(CASE SENSITIVE) where as html tags are not case sensitive(CASE INSENSITIVE).
Impact Of XPath On:
DOM: outcome of //input is same as //Input. The output is same as //INPUT. So, xpath in case of DOM is not case sensitive. But, attriubtes such as id,name are case sensitive.
XPath Operators Are Case Sensitive:
But, xpath operators are case sensitive.
Ex: In above case, what will be xpath to look for inputbox with value=Debasish. The xpath would be as shown below.
//Input[contains(@value,'Debasish')]
As shown above. "contains" is the operator which searches for Input box with value="Debasish".
If "contains" is written as "Contains"(capital C), it will search nothing. Rather, it will syntax error.
So, it confirms xpath operators are case sensitive.
XML: <Names><Name>Debasish</Name><Name>Subhasish</Name></Names>
<Name> is not same as <name>. <Name> is different node and <name> is different node.
outcome of xpath=//Name will return two nodes/Elements
<Name>Debasish</Name>
<Name>Subhasish</Name>
If XML is: <Names><Name>Debasish</Name><name>Subhasish</name></Names>
outcome of xpath=//Name will return one node/Element
<Name>Debasish</Name>
outcome of xpath=//name will return one node/Element
<name>Subhasish</name>
This confirms, XML is case sensitive. So, as xpath on those xmls.
DOM stands for document object model which is interpreted by browser and presents the DOM in better human understandable html format. DOM is hierarchy structure of webelements.
Lets see simple DOM presented in html format.
<html><head><body><tr><td><input type="text" value="Debasish" /></td><td><input type="text" value="Subhasish" /></td></tr></body></head></html>.
If you see above html, it will look like XML. Only difference between html and XML is html has fixed set of tags and tags are not case sensitive. Does not matter, if one writes "tr" or "Tr" or "TR". Its all same for html. But, XML tags are case sensitive. So, in general, XML does have user defined tags which is case sensitive(CASE SENSITIVE) where as html tags are not case sensitive(CASE INSENSITIVE).
Impact Of XPath On:
DOM: outcome of //input is same as //Input. The output is same as //INPUT. So, xpath in case of DOM is not case sensitive. But, attriubtes such as id,name are case sensitive.
XPath Operators Are Case Sensitive:
But, xpath operators are case sensitive.
Ex: In above case, what will be xpath to look for inputbox with value=Debasish. The xpath would be as shown below.
//Input[contains(@value,'Debasish')]
As shown above. "contains" is the operator which searches for Input box with value="Debasish".
If "contains" is written as "Contains"(capital C), it will search nothing. Rather, it will syntax error.
So, it confirms xpath operators are case sensitive.
XML: <Names><Name>Debasish</Name><Name>Subhasish</Name></Names>
<Name> is not same as <name>. <Name> is different node and <name> is different node.
outcome of xpath=//Name will return two nodes/Elements
<Name>Debasish</Name>
<Name>Subhasish</Name>
If XML is: <Names><Name>Debasish</Name><name>Subhasish</name></Names>
outcome of xpath=//Name will return one node/Element
<Name>Debasish</Name>
outcome of xpath=//name will return one node/Element
<name>Subhasish</name>
This confirms, XML is case sensitive. So, as xpath on those xmls.
No comments:
Post a Comment