[Webtest] XPath

Brandon Moore webtest@lists.canoo.com
Thu, 26 Jun 2003 18:22:32 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_0000_01C33C0F.EAF95290
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

I am trying to write an xpath expression to select the first image on a page
and check it's source attribute
The the body begins with a form which begins with an img. A later sibling of
the form is another image.
I'm using the xpath expression /html/head/following::img[1]/attribute::src,
which selects the correct tag
in XPath Explorer. Testing that local-name(/html/head/following::img[1])
equals body suceeds. The
following axis is supposed to be in document order (according to the XPath
spec), so we should get the
first image, but it looks like canoo puts the children of the following
nodes in depth first order.

Both canoo and XPath Explorer seem to order the descendant axis in document
order rather than
depth first order. /descendant::img[1] selects the immediate child of body
in preference to the
more distant descendant that appears earlier in document order.

Can anyone tell me what is happening here?

Brandon


------=_NextPart_000_0000_01C33C0F.EAF95290
Content-Type: text/html;
	name="com.commcode.cmis.view.servlets.Logon.html"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="com.commcode.cmis.view.servlets.Logon.html"















<META HTTP-EQUIV=3D"Pragma" CONTENT=3D"no-cache">






<!-- *********************************** bean tag =
********************************* -->

<!-- =
*************************************************************************=
***** -->


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<HTML>
<HEAD>

  	<META NAME=3D"author" CONTENT=3D"Commerce Codeworks, Inc., =
info@commcode.com">
    <META http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Diso-8859-1">
    <TITLE>CMIS: Shop Floor Logon</TITLE>

<script language=3D"JavaScript">

function validateClockNumber(productName){
	if(productName=3D=3Dnull || productName=3D=3D'' ||productName=3D=3D' ')
	{
		alert('Please enter a clock number');
		return false;
	}
	return true;
}

function validateOnSubmit()
{
	if(!validateClockNumber(document.FORM1.clockNumber.value))
			return false;
	document.FORM1.submit();
	return true;
}

</script>
<script Language=3D"JavaScript" SRC=3D"/newcmis/cmis.js">
</script>

</HEAD>

<BODY bgcolor=3D"#ffffff" link=3D"#666666" vlink=3D"#666666">
<!-- Begin standard CMIS header -->













<META HTTP-EQUIV=3D"Pragma" CONTENT=3D"no-cache">





<script language=3D"JavaScript">
function validateForm( formObject )
{
	if ( formObject.UserAction.value !=3D null && =
formObject.UserAction.value !=3D '' )=20
	    return true;
	else
	    return false;
}

function doSubmit( userActionValue, menuActionValue )
{
	document.FORM1.UserAction.value =3D userActionValue;
	document.FORM1.MenuAction.value =3D menuActionValue;
	if ( validateForm( document.FORM1 ) ) {
	    document.FORM1.submit();
	    return true;
	}
	else
	    return false;
}
</script>


<FORM NAME=3D"FORM1" METHOD=3D"POST" =
ACTION=3D"/newcmis/servlet/com.commcode.cmis.view.servlets.Logon" =
onSubmit=3D"return validateForm( document.FORM1 )">
<INPUT TYPE=3D"HIDDEN" NAME=3D"UserAction" VALUE=3D"Logon">
<INPUT TYPE=3D"HIDDEN" NAME=3D"MenuAction" VALUE=3D"">

<IMG SRC=3D"/newcmis/images/vlowhdr.gif" WIDTH=3D371 HEIGHT=3D39 =
BORDER=3D"0"><BR>
<IMG SRC=3D"/newcmis/images/gray.gif" WIDTH=3D"100%" HEIGHT=3D1 =
BORDER=3D"0">

<!-- End standard CMIS header -->
<table cellpadding=3D0 cellspacing=3D0 border=3D0>
<tr>
<td width=3D115 bgcolor=3D"#ffffff" valign=3Dtop align=3Dleft>
    <!-------------- begin MAIN NAVIGATION table (nested) =
--------------->
		<table width=3D"112" cellpadding=3D0 cellspacing=3D0 border=3D0>
    		<tr>
        		<td colspan=3D2 align=3Dleft>
            	<img src=3D"/newcmis/images/cmislogo.jpg" width=3D112 =
height=3D83 alt=3D"CMIS" border=3D"0" vspace=3D2>
	        	</td>
    		</tr>
			<tr height=3D1>
				<td><img src=3D"/newcmis/images/whtpix.gif" width=3D90 height=3D1 =
border=3D"0"></td>
				<td><img src=3D"/newcmis/images/whtpix.gif" width=3D22 height=3D1 =
border=3D"0"></td>
			</tr>
        	<TR width=3D"112">
				<TD ALIGN=3DRIGHT width=3D"90"><A HREF=3D"/newcmis/CMISMain.htm" =
ONMOUSEOVER=3D"MM_swapImage('document.cir_open0','0','/newcmis/images/cir=
_green.gif')" =
ONMOUSEOUT=3D"MM_swapImage('document.cir_open0','0','/newcmis/images/cir_=
open.gif')" ><IMG SRC=3D"/newcmis/images/cancel.gif" =
BORDER=3D0></A></TD>
				<TD align=3Dright width=3D"22"><IMG =
SRC=3D"/newcmis/images/cir_open.gif" WIDTH=3D14 HEIGHT=3D14 BORDER=3D"0" =
HSPACE=3D6 VSPACE=3D3 NAME=3D"cir_open0"></TD>
			</TR>
		</table>
	<!-------------- end MAIN NAVIGATION table (nested) --------------->
</td>
=09
<td width=3D15 align=3Dleft valign=3Dtop><img =
src=3D"/newcmis/images/gray.gif" width=3D1 height=3D1 border=3D"0"></td>
<td valign=3Dtop>
        <!-------------- begin main CONTENT table (nested) =
--------------->
        <table cellpadding=3D0 cellspacing=3D0 border=3D0>
        <tr>
        <td valign=3Dmiddle><font face=3D"arial" size=3D2 =
color=3D"#000000"><strong>SHOP FLOOR LOGON</strong></font></td>
        </tr>
        </table>
        <table cellpadding=3D1 cellspacing=3D0 border=3D0>
        <tr><td>&nbsp;</td></tr>
        <tr>
        <td nowrap><font face=3D"arial" size=3D2>Unit Code</font></td>
        <td rowspan=3D6><img src=3D"/newcmis/images/whtpix.gif" =
width=3D20 height=3D1 border=3D"0"></td>
        <td>
        <SELECT NAME=3D"unitCode">
        <OPTION VALUE=3D"**">**
<OPTION VALUE=3D"03">03
<OPTION VALUE=3D"73">73
<OPTION VALUE=3D"90">90
<OPTION VALUE=3D"A8">A8
<OPTION VALUE=3D"AX">AX
<OPTION VALUE=3D"C">C
<OPTION VALUE=3D"CC">CC
<OPTION VALUE=3D"CD">CD
<OPTION VALUE=3D"CE">CE
<OPTION VALUE=3D"CG">CG
<OPTION VALUE=3D"CJ">CJ
<OPTION VALUE=3D"CM">CM
<OPTION VALUE=3D"CQ">CQ
<OPTION VALUE=3D"CS">CS
<OPTION VALUE=3D"CZ">CZ
<OPTION VALUE=3D"DM">DM
<OPTION VALUE=3D"DW">DW
<OPTION VALUE=3D"DY">DY
<OPTION VALUE=3D"EV">EV
<OPTION VALUE=3D"EX">EX
<OPTION VALUE=3D"FF">FF
<OPTION VALUE=3D"GX">GX
<OPTION VALUE=3D"HX">HX
<OPTION VALUE=3D"ID">ID
<OPTION VALUE=3D"J">J
<OPTION VALUE=3D"KT">KT
<OPTION VALUE=3D"KV">KV
<OPTION VALUE=3D"L">L
<OPTION VALUE=3D"LV">LV
<OPTION VALUE=3D"MX">MX
<OPTION VALUE=3D"NF">NF
<OPTION VALUE=3D"NJ">NJ
<OPTION VALUE=3D"NW">NW
<OPTION VALUE=3D"NX">NX
<OPTION VALUE=3D"P">P
<OPTION VALUE=3D"P1">P1
<OPTION VALUE=3D"PE">PE
<OPTION VALUE=3D"PW">PW
<OPTION VALUE=3D"RE">RE
<OPTION VALUE=3D"RF">RF
<OPTION VALUE=3D"RG">RG
<OPTION VALUE=3D"RW">RW
<OPTION VALUE=3D"RX">RX
<OPTION VALUE=3D"SE">SE
<OPTION VALUE=3D"T8">T8
<OPTION VALUE=3D"TC">TC
<OPTION VALUE=3D"TK">TK
<OPTION VALUE=3D"TX">TX
<OPTION VALUE=3D"UP">UP
<OPTION VALUE=3D"UZ">UZ
<OPTION VALUE=3D"V3">V3
<OPTION VALUE=3D"VE">VE
<OPTION VALUE=3D"VG">VG
<OPTION VALUE=3D"VJ">VJ
<OPTION VALUE=3D"VM">VM
<OPTION VALUE=3D"VP">VP
<OPTION VALUE=3D"WC">WC
<OPTION VALUE=3D"WM">WM
<OPTION VALUE=3D"WN">WN
<OPTION VALUE=3D"WS">WS
<OPTION VALUE=3D"WX">WX
<OPTION VALUE=3D"WZ">WZ
<OPTION VALUE=3D"YZ">YZ
<OPTION VALUE=3D"Z">Z

        </SELECT>
	</td>
        </tr>
        <tr>
        <td nowrap><font face=3D"arial" size=3D2>Clock =
Number</font></td>
        <td  colspan=3D3>
        <input type=3D"text" name=3D"clockNumber" size=3D"6" value=3D"" =
maxlength=3D"5" onFocus=3D"this.select()" ></td>
        </tr>
        <tr>
        <td height=3D10></td>
        </tr>
        <tr>
        <td>&nbsp;</td>
        </tr>
        <tr>
        <td height=3D40 valign=3Dbottom align=3Dleft><input =
type=3D"SUBMIT" name=3D"logon" value=3D"Logon">&nbsp;&nbsp;&nbsp;<input =
type=3D"reset"></td>
        </tr>
        </table>
        <table cellpadding=3D1 cellspacing=3D0 border=3D0>
        <tr>
        <td align=3Dright><img src=3D"/newcmis/images/gray.gif" =
width=3D660 height=3D1 border=3D"0" vspace=3D10></td>
        </tr>
        </table>
</td>
</tr>
</table>
</FORM>
<!-- jdo footer -->
<img src=3D"/newcmis/images/gray.gif" width=3D"100%" height=3D1 =
border=3D"0">

<CENTER>
<table border=3D0>
	<tr>
		<td width=3D57 align=3D"right">
			<a href=3D"http://www.deere.com">
				<img src=3D"/newcmis/images/smbwtm.gif" border=3D"0" width=3D"57" =
height=3D"55"></a>
		</td>
		<td width=3D300><font size=3D"-1">
		<em>Please send comments via the <A HREF=3D"javascript:var a =3D =
window.open( '/newcmis/CMISFeedbackForm.jsp?action=3Dnew', =
'feedbackForm', 'width=3D640, height=3D480, status=3Dyes, =
resizeable=3Dtrue');">CMIS Feedback Form</A>.</em><br>
		Version 2.0.1708<br>Copyright &#169; 2001-2003 Commerce Codeworks, =
Inc.<br>All rights reserved.
		</font></td>
		<td align=3Dright><a href=3D"http://www.dx.deere.com">
			<img src=3D"/newcmis/images/jdologo.gif" width=3D159 height=3D26 =
border=3D"0"></a>
		</td>
	</tr>
</table>
</center>
</BODY>
</HTML>


------=_NextPart_000_0000_01C33C0F.EAF95290--