Hi Matthes,

The first example should be wrapped in a Filter element.

To create a filter you are best using the MessagePatternFilter class,
unfortunately this also implies that you must not use prefixes unless
they are matching the WSDMs namespaces.

This is an area of XPath that is pretty terrible unfortunately.

Either way use MessagePatternFilter as an example and the toString
function will show you what the content should look like.

cheers,
Chris 

-----Original Message-----
From: Matthes R. [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 16, 2008 4:30 PM
To: [email protected]
Subject: Creating an XPath-filter for a subscription

Hi all,

i'm stuck with a (quite simple?) problem. I want to create a Filter
using simple XPath-expression:

<?xml version="1.0" encoding="UTF-8"?>
<wsnt:MessageContent
    Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116";
    xmlns:om="http://www.opengis.net/om/1.0";
    xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"; xmlns:xlink="
http://www.w3.org/1999/xlink";>

//om:Observation/om:procedure/@xlink:href='urn:ogc:object:procedure:CITE
:WeatherService:LGA'
</wsnt:MessageContent>

Reading this file with XmlUtils to a org.w3c.dom.Document works well.
But then creating the filter with

Filter f =
FilterFactory.getInstance().newInstance(doc.getDocumentElement());

results in the following representation of Filter:

<wsnt:Filter xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2";>
    <wsnt:MessageContent Dialect="
http://www.w3.org/TR/1999/REC-xpath-19991116";>*</wsnt:MessageContent>
</wsnt:Filter>

Perhaps I did not realize the right way of creating the XPath-Filter?

Best Regards,
Matthes

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to