XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
froz frozdickSubject: Newbie struggling with simple query
Author: froz frozdick
Date: 01 Jun 2007 08:10 AM
Originally Posted: 01 Jun 2007 08:09 AM
I've trimmed the files right back to simplify my problem and attached. In the data.xml doc there is potentially a number of elements tagged as <IP> per site. the vbs file also attached needs to query for an IP and have the value of the prefix tag returned. This all works fine where there is just one <IP> element but where I have a number of them, my query only seems to check the first one. I've obviously missed something blatantly obvious here.

Can anyone advise please. Thanks in advance.


Unknownsites.xml


Unknowntmp3.vbs

Postnext
(Deleted User) Subject: Newbie struggling with simple query
Author: (Deleted User)
Date: 04 Jun 2007 03:10 PM
Hi,
if I run the query //sites/site[ip='10.180.']/prefix in the XPath Query Window of Stylus Studio I get the expected NOR prefix. Could be a bug in the MSXML engine?

Alberto

Postnext
Ivan PedruzziSubject: Newbie struggling with simple query
Author: Ivan Pedruzzi
Date: 04 Jun 2007 10:34 PM

MSXML requires the two elements operands to be the same type, changing the expression as follow generates the expected result

strQuery = "/sites/site[ ip/text() = " & strIP & "]/prefix"


Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Posttop
froz frozdickSubject: Newbie struggling with simple query
Author: froz frozdick
Date: 05 Jun 2007 04:54 AM
Originally Posted: 05 Jun 2007 04:49 AM
>
>MSXML requires the two
>elements operands to be the
>same type, changing the
>expression as follow generates
>the expected result
>
>strQuery = "/sites/site[
>ip/text() = " & strIP
>& "]/prefix"
>
>
>Hope this helps
>Ivan Pedruzzi
>Stylus Studio Team

You sir are a legend. Thank you very much.

Can anyone point me at a good reference site for this topic or a decent book please? It seems all I'm missing here now is the equivalent of instr. I'm sure I've read somewhere that I can use beginswith to achieve this but I've not been able to find any example. Essentially all I want to do is locate the element that contains the value of strIP at position 1.

 
Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.