I have created 10 xml documents of different types like one has book details, other has movie details or news headlines etc. One of such xml document is books.xml which is as follows:
<bookstore>
<book category="COOKING">
<title lang="english">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>200.00</price>
</book>
<book category="CHILDREN">
<title lang="english">Harry Potter</title>
<author>J K. Rowling </author>
<year>2005</year>
<price>625.00</price>
</book>
</bookstore>
I want to count words entered by the user by searching them in all of the 10 xml documents. These words are nothing but the elements having attributes and their respective values.
For eg: user enters category
from above example one can see category is an attribute and written twice . So, according to this the output should be "2" and if this word category is present in other 9 docs, then the count is accordingly upgraded. How can I do it for single doc without specifying the element name. Its basically xml parsing , so how can I do it ? It's new to me and I'm facing some problems.
//////////////////////////////////////////////////////////////////////////////////
What if I want to use simple doc but not the schema?It's related to xml parsing, can you tell me how to use the nodelist object in dom model object.
please help.