[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Can not select outer node

Subject: Can not select outer node
From: "Sean Tiley" <sean.tiley@xxxxxxxxx>
Date: Thu, 24 Jan 2008 22:25:07 -0500
 Can not select outer node
Hi there,
I have the following xml structure

<testsuite>
    <table>
        <tr>
            <td>Dummy Table</td>
        </tr>
    </table>

    <table>
        <tr>
            <td>Test Case ID</td>
            <td>Description</td>
            <td>Expected Result</td>
            <td>Actual Result</td>
            <td>Date Executed</td>
            <td>PASS / Fail</td>
            <td>Regression Test Suite</td>
        </tr>
        <tr>
            <td>01</td>
            <td>This test case verifies successful login</td>
            <td>System successfully authenticates the user and
displays user home page if valid username and password are
provided</td>
            <td>As Expected</td>
            <td>2008/01/23</td>
            <td>PASS</td>
            <td/>
        </tr>
        <tr>
            <td>02</td>
            <td>This test case verifies field validation when the
username is omitted during login
                attempts</td>
            <td>System remains on login page with the message
"Username is required" displayed</td>
            <td>System remained on login page but message displayed
was "UserID is required"</td>
            <td>2008/01/23</td>
            <td>FAIL</td>
            <td/>
        </tr>
        <tr>
            <td>03</td>
            <td>This test case verifies field validation when the
password is omitted during login
                attempts</td>
            <td>System remains on login page with the message
"Password is required" displayed</td>
            <td>As Expected</td>
            <td>2008/01/23</td>
            <td>PASS</td>
            <td/>
        </tr>
    </table>
</testsuite>

What I am trying to do analyze a test resut file.
The test cases and results are in a <table/> element within an xml file.
There can be many <table/> elements in the document. I know the only
one I am interested in
is the <table/> with the value "Test Case ID" in the first column of
the first row.

I am trying to get this table so I can process it by grabbing each row
and extracting the desired info.

I have tried //table/tr[starts-with(td,"Test Case ID")]
Which returns the first <tr/> in the correct table but I need the entire table.

I think using table[1] somehow should work, but clearly I am not getting this
as when I try //table[1]/tr[starts-with(td,"Test Case ID")] nothing is returned.

Any help or ideas would be great.

I would prefer not to be given the answer, but a push/shove in the
right direction would be most beneficial.

Thank you in advance

-- 
Sean Tiley
sean.tiley@xxxxxxxxx

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.