Newbie

Dec 1, 2016 at 3:40 PM
I downloaded the product and loaded an XML file. Now I want to see the results filtered by some criteria. How do I do that? In the below example how do I find all <tkt> where <status> = 0
I have the schema as follows
<main>
   <sub1>
      <sub1a>
         <tkt>
             <number>
             <status>
         </tkt>
         <tkt>
             <number>
             <status>
         </tkt>
      </sub1a>
   </sub1>
</main>
Coordinator
Dec 1, 2016 at 6:11 PM
Welcome! First, the XML is slightly invalid. The number and status elements need to be closed:
<main>
   <sub1>
      <sub1a>
         <tkt>
             <number>0</number>
             <status>0</status>
         </tkt>
         <tkt>
             <number>1</number>
             <status>1</status>
         </tkt>
      </sub1a>
   </sub1>
</main>
I went ahead and entered some values for the number and status as well. Now that the XML will load in XML Explorer, we can use XPath to find/query:

http://www.w3schools.com/xml/xml_xpath.asp

In your case, this XPath query should find all tkt elements with status = 0:

//tkt[status='0']

Hope this helps, good luck!
Marked as answer by msinghny on 12/1/2016 at 2:19 PM
Dec 1, 2016 at 9:26 PM
jcoon wrote:
Welcome! First, the XML is slightly invalid. The number and status elements need to be closed:
<main>
   <sub1>
      <sub1a>
         <tkt>
             <number>0</number>
             <status>0</status>
         </tkt>
         <tkt>
             <number>1</number>
             <status>1</status>
         </tkt>
      </sub1a>
   </sub1>
</main>
I went ahead and entered some values for the number and status as well. Now that the XML will load in XML Explorer, we can use XPath to find/query:

http://www.w3schools.com/xml/xml_xpath.asp

In your case, this XPath query should find all tkt elements with status = 0:

//tkt[status='0']

Hope this helps, good luck!
jcoon: An embarrassed thank you :). I created the XML on the fly and did not do a good job. You however did a great job of answering it. So thank you again.