[Logo] Mango Community
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Clarity requried ...http retreiver - binary - pick up 0 if element not found on page and 1 if it is  XML
Forum Index » How-To
Author Message
fclauson

Initiate

Joined: 21/05/2010 07:55:11
Messages: 56
Location: Ireland
Offline

Given that regex is very poor at stating something was not found what would be the best way of testing a web page with the following

if "ABC" found on page then return 1 else return 0

This message was edited 1 time. Last update was at 11/08/2010 10:06:37

mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1847
Offline

Hmm, there is a roundabout way, although it's not entirely clean...

If you leave the "ignore if missing" checkbox unchecked, you will get an event raised if the specified group is empty. You can then use this event to set the value of another point (say, a virtual point with "no change"), and go from there. I haven't tested this myself, but in theory it should be ok.

Best regards,
Matthew Lohbihler
fclauson

Initiate

Joined: 21/05/2010 07:55:11
Messages: 56
Location: Ireland
Offline

finally worked this out

HTTP page reads "This is a document"

use HTTP retreiver and point type binary
Regex : ".*(is.?) *"
do not use inverted commers (done for clarity here) and note space after the closing bracket which captures the space before the "a"

This regex returns TRUE

change regex to
".*(ix.?) *" (again note space a do not use inverted commas)
returns FALSE

if you need any help drop me a PM

Francis

fclauson

Initiate

Joined: 21/05/2010 07:55:11
Messages: 56
Location: Ireland
Offline

Having tried more combinations it is now apparrent that my previous email is not always true

Serotonin - can we have some clarity on how this is supposed to work specifically
1 - the test button - does this work exactly the same as when the product is running live (i.e. does it take account of the Binary 0 value)
2 - when it says "No value match made for point " could the message be clearer as to what the problem is as this error is returned for multiple errors I think
3 - what would be the quickest way of constructing a test harness to test out regex as implemented by Mango as getting regex working is a big pain

Many thanks
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1847
Offline

1 - Yes
2 - When Matcher.match returns false, that message is shown. Can you enumerate the multiple errors you think this is returned for?
3 - Personally, i use QuickREx, a plugin for Eclipse by Bastian Bergerhoff, and i recommend it. If you're not using Eclipse there are probably similar tools around. Find a Java-based one to be sure you're using the same pattern compiler/matcher as Mango.

Best regards,
Matthew Lohbihler
 
Forum Index » How-To
Go to:   
Powered by JForum 2.1.9 © JForum Team