You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-dev@ws.apache.org by "Matthes Rieke (JIRA)" <ji...@apache.org> on 2008/09/03 18:27:44 UTC

[jira] Created: (MUSE-293) XPath filter gets Namespaces from NotificationMessage

XPath filter gets Namespaces from NotificationMessage
-----------------------------------------------------

                 Key: MUSE-293
                 URL: https://issues.apache.org/jira/browse/MUSE-293
             Project: Muse
          Issue Type: Bug
          Components: Utilities - General, QName, and XML
    Affects Versions: 2.2.0
            Reporter: Matthes Rieke
            Assignee: Dan Jemiolo
            Priority: Minor


I have stumbled across a problem when trying to filter a NotificationMessage with an XPath expression containing namespace declarations (e.G. //om:Observation/om:procedure - where om is "http://www.opengis.net/om/1.0").
Perhaps I made some mistake while subscribing with this filter, but to me it seems, that the MessagePatternFilter just invokes XPathUtils.isMatch(). isMatch itself invokes XPathAPI.eval(context, xpath) [from apache xalan api] and that method has no parameter for the namespaceNode. This has the result that the XPath expression takes its namespaces from the NotificationMessage, which of course may differ from the ones specified in my subscribe request.

Also I noticed that namespaces in a MessagePatternFilter xml file (see below) just get erased when parsing the xml with the FilterFactory.

Filter to parse:
<wsnt:Filter xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
    <wsnt:MessageContent Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116"
        xmlns:om="http://www.opengis.net/om/1.0">
        //om:Observation/om:procedure/@xlink:href='urn:ogc:object:procedure:CITE:WeatherService:LGA'
    </wsnt:MessageContent>
</wsnt:Filter>


this gets parsed in the subscribe operation of NotificationProducer (I assume this is done before in the FilterFactory):
<wsnt:Filter xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
<wsnt:MessageContent Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116">//om:Observation/om:procedure/@xlink:href='urn:ogc:object:procedure:CITE:WeatherService:LGA'</wsnt:MessageContent>
</wsnt:Filter>


As you can see the namespace "om:...." is removed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Resolved: (MUSE-293) XPath filter gets Namespaces from NotificationMessage

Posted by "Chris Twiner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MUSE-293?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Twiner resolved MUSE-293.
-------------------------------

    Resolution: Fixed

Code added, tests temporarily in the cunningly named tests folder.

Attempts have been made to keep it binary compatible.

> XPath filter gets Namespaces from NotificationMessage
> -----------------------------------------------------
>
>                 Key: MUSE-293
>                 URL: https://issues.apache.org/jira/browse/MUSE-293
>             Project: Muse
>          Issue Type: Bug
>          Components: Utilities - General, QName, and XML
>    Affects Versions: 2.2.0
>            Reporter: Matthes Rieke
>            Assignee: Chris Twiner
>            Priority: Minor
>             Fix For: 2.2.1
>
>         Attachments: XPathFilterNamespaceTest.java
>
>
> I have stumbled across a problem when trying to filter a NotificationMessage with an XPath expression containing namespace declarations (e.G. //om:Observation/om:procedure - where om is "http://www.opengis.net/om/1.0").
> Perhaps I made some mistake while subscribing with this filter, but to me it seems, that the MessagePatternFilter just invokes XPathUtils.isMatch(). isMatch itself invokes XPathAPI.eval(context, xpath) [from apache xalan api] and that method has no parameter for the namespaceNode. This has the result that the XPath expression takes its namespaces from the NotificationMessage, which of course may differ from the ones specified in my subscribe request.
> Also I noticed that namespaces in a MessagePatternFilter xml file (see below) just get erased when parsing the xml with the FilterFactory.
> Filter to parse:
> <wsnt:Filter xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
>     <wsnt:MessageContent Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116"
>         xmlns:om="http://www.opengis.net/om/1.0">
>         //om:Observation/om:procedure/@xlink:href='urn:ogc:object:procedure:CITE:WeatherService:LGA'
>     </wsnt:MessageContent>
> </wsnt:Filter>
> this gets parsed in the subscribe operation of NotificationProducer (I assume this is done before in the FilterFactory):
> <wsnt:Filter xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
> <wsnt:MessageContent Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116">//om:Observation/om:procedure/@xlink:href='urn:ogc:object:procedure:CITE:WeatherService:LGA'</wsnt:MessageContent>
> </wsnt:Filter>
> As you can see the namespace "om:...." is removed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Commented: (MUSE-293) XPath filter gets Namespaces from NotificationMessage

Posted by "Chris Twiner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MUSE-293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12758270#action_12758270 ] 

Chris Twiner commented on MUSE-293:
-----------------------------------

NOTE this does not adjust either ProducerPropertiesFilter or TopicFilters use of XPathUtils.isMatch.  The reason being topicfilters shouldn't really be doing xpath filtering anyway (thats messagefilters job) and the other filter should probably be using the generated producer properties.

If either of these is an issue in the future it should be easy to remedy them.

> XPath filter gets Namespaces from NotificationMessage
> -----------------------------------------------------
>
>                 Key: MUSE-293
>                 URL: https://issues.apache.org/jira/browse/MUSE-293
>             Project: Muse
>          Issue Type: Bug
>          Components: Utilities - General, QName, and XML
>    Affects Versions: 2.2.0
>            Reporter: Matthes Rieke
>            Assignee: Chris Twiner
>            Priority: Minor
>             Fix For: 2.2.1
>
>         Attachments: XPathFilterNamespaceTest.java
>
>
> I have stumbled across a problem when trying to filter a NotificationMessage with an XPath expression containing namespace declarations (e.G. //om:Observation/om:procedure - where om is "http://www.opengis.net/om/1.0").
> Perhaps I made some mistake while subscribing with this filter, but to me it seems, that the MessagePatternFilter just invokes XPathUtils.isMatch(). isMatch itself invokes XPathAPI.eval(context, xpath) [from apache xalan api] and that method has no parameter for the namespaceNode. This has the result that the XPath expression takes its namespaces from the NotificationMessage, which of course may differ from the ones specified in my subscribe request.
> Also I noticed that namespaces in a MessagePatternFilter xml file (see below) just get erased when parsing the xml with the FilterFactory.
> Filter to parse:
> <wsnt:Filter xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
>     <wsnt:MessageContent Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116"
>         xmlns:om="http://www.opengis.net/om/1.0">
>         //om:Observation/om:procedure/@xlink:href='urn:ogc:object:procedure:CITE:WeatherService:LGA'
>     </wsnt:MessageContent>
> </wsnt:Filter>
> this gets parsed in the subscribe operation of NotificationProducer (I assume this is done before in the FilterFactory):
> <wsnt:Filter xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
> <wsnt:MessageContent Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116">//om:Observation/om:procedure/@xlink:href='urn:ogc:object:procedure:CITE:WeatherService:LGA'</wsnt:MessageContent>
> </wsnt:Filter>
> As you can see the namespace "om:...." is removed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Assigned: (MUSE-293) XPath filter gets Namespaces from NotificationMessage

Posted by "Chris Twiner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MUSE-293?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Twiner reassigned MUSE-293:
---------------------------------

    Assignee: Chris Twiner  (was: Dan Jemiolo)

> XPath filter gets Namespaces from NotificationMessage
> -----------------------------------------------------
>
>                 Key: MUSE-293
>                 URL: https://issues.apache.org/jira/browse/MUSE-293
>             Project: Muse
>          Issue Type: Bug
>          Components: Utilities - General, QName, and XML
>    Affects Versions: 2.2.0
>            Reporter: Matthes Rieke
>            Assignee: Chris Twiner
>            Priority: Minor
>         Attachments: XPathFilterNamespaceTest.java
>
>
> I have stumbled across a problem when trying to filter a NotificationMessage with an XPath expression containing namespace declarations (e.G. //om:Observation/om:procedure - where om is "http://www.opengis.net/om/1.0").
> Perhaps I made some mistake while subscribing with this filter, but to me it seems, that the MessagePatternFilter just invokes XPathUtils.isMatch(). isMatch itself invokes XPathAPI.eval(context, xpath) [from apache xalan api] and that method has no parameter for the namespaceNode. This has the result that the XPath expression takes its namespaces from the NotificationMessage, which of course may differ from the ones specified in my subscribe request.
> Also I noticed that namespaces in a MessagePatternFilter xml file (see below) just get erased when parsing the xml with the FilterFactory.
> Filter to parse:
> <wsnt:Filter xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
>     <wsnt:MessageContent Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116"
>         xmlns:om="http://www.opengis.net/om/1.0">
>         //om:Observation/om:procedure/@xlink:href='urn:ogc:object:procedure:CITE:WeatherService:LGA'
>     </wsnt:MessageContent>
> </wsnt:Filter>
> this gets parsed in the subscribe operation of NotificationProducer (I assume this is done before in the FilterFactory):
> <wsnt:Filter xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
> <wsnt:MessageContent Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116">//om:Observation/om:procedure/@xlink:href='urn:ogc:object:procedure:CITE:WeatherService:LGA'</wsnt:MessageContent>
> </wsnt:Filter>
> As you can see the namespace "om:...." is removed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Commented: (MUSE-293) XPath filter gets Namespaces from NotificationMessage

Posted by "Chris Twiner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MUSE-293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12628275#action_12628275 ] 

Chris Twiner commented on MUSE-293:
-----------------------------------

I'm working on this issue.

> XPath filter gets Namespaces from NotificationMessage
> -----------------------------------------------------
>
>                 Key: MUSE-293
>                 URL: https://issues.apache.org/jira/browse/MUSE-293
>             Project: Muse
>          Issue Type: Bug
>          Components: Utilities - General, QName, and XML
>    Affects Versions: 2.2.0
>            Reporter: Matthes Rieke
>            Assignee: Dan Jemiolo
>            Priority: Minor
>
> I have stumbled across a problem when trying to filter a NotificationMessage with an XPath expression containing namespace declarations (e.G. //om:Observation/om:procedure - where om is "http://www.opengis.net/om/1.0").
> Perhaps I made some mistake while subscribing with this filter, but to me it seems, that the MessagePatternFilter just invokes XPathUtils.isMatch(). isMatch itself invokes XPathAPI.eval(context, xpath) [from apache xalan api] and that method has no parameter for the namespaceNode. This has the result that the XPath expression takes its namespaces from the NotificationMessage, which of course may differ from the ones specified in my subscribe request.
> Also I noticed that namespaces in a MessagePatternFilter xml file (see below) just get erased when parsing the xml with the FilterFactory.
> Filter to parse:
> <wsnt:Filter xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
>     <wsnt:MessageContent Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116"
>         xmlns:om="http://www.opengis.net/om/1.0">
>         //om:Observation/om:procedure/@xlink:href='urn:ogc:object:procedure:CITE:WeatherService:LGA'
>     </wsnt:MessageContent>
> </wsnt:Filter>
> this gets parsed in the subscribe operation of NotificationProducer (I assume this is done before in the FilterFactory):
> <wsnt:Filter xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
> <wsnt:MessageContent Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116">//om:Observation/om:procedure/@xlink:href='urn:ogc:object:procedure:CITE:WeatherService:LGA'</wsnt:MessageContent>
> </wsnt:Filter>
> As you can see the namespace "om:...." is removed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Commented: (MUSE-293) XPath filter gets Namespaces from NotificationMessage

Posted by "Chris Twiner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MUSE-293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12758262#action_12758262 ] 

Chris Twiner commented on MUSE-293:
-----------------------------------

In order to maintain binary compatibility for the 2.2.1 release I'm adding a new constructor, the other will simply be deprecated.

> XPath filter gets Namespaces from NotificationMessage
> -----------------------------------------------------
>
>                 Key: MUSE-293
>                 URL: https://issues.apache.org/jira/browse/MUSE-293
>             Project: Muse
>          Issue Type: Bug
>          Components: Utilities - General, QName, and XML
>    Affects Versions: 2.2.0
>            Reporter: Matthes Rieke
>            Assignee: Chris Twiner
>            Priority: Minor
>             Fix For: 2.2.1
>
>         Attachments: XPathFilterNamespaceTest.java
>
>
> I have stumbled across a problem when trying to filter a NotificationMessage with an XPath expression containing namespace declarations (e.G. //om:Observation/om:procedure - where om is "http://www.opengis.net/om/1.0").
> Perhaps I made some mistake while subscribing with this filter, but to me it seems, that the MessagePatternFilter just invokes XPathUtils.isMatch(). isMatch itself invokes XPathAPI.eval(context, xpath) [from apache xalan api] and that method has no parameter for the namespaceNode. This has the result that the XPath expression takes its namespaces from the NotificationMessage, which of course may differ from the ones specified in my subscribe request.
> Also I noticed that namespaces in a MessagePatternFilter xml file (see below) just get erased when parsing the xml with the FilterFactory.
> Filter to parse:
> <wsnt:Filter xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
>     <wsnt:MessageContent Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116"
>         xmlns:om="http://www.opengis.net/om/1.0">
>         //om:Observation/om:procedure/@xlink:href='urn:ogc:object:procedure:CITE:WeatherService:LGA'
>     </wsnt:MessageContent>
> </wsnt:Filter>
> this gets parsed in the subscribe operation of NotificationProducer (I assume this is done before in the FilterFactory):
> <wsnt:Filter xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
> <wsnt:MessageContent Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116">//om:Observation/om:procedure/@xlink:href='urn:ogc:object:procedure:CITE:WeatherService:LGA'</wsnt:MessageContent>
> </wsnt:Filter>
> As you can see the namespace "om:...." is removed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Updated: (MUSE-293) XPath filter gets Namespaces from NotificationMessage

Posted by "Chris Twiner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MUSE-293?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Twiner updated MUSE-293:
------------------------------

    Attachment: XPathFilterNamespaceTest.java

This junit test includes the fixes in it.  They need to be moved out into the correct files (XmlUtils, XPathUtils and both of the MessagePattern files).

> XPath filter gets Namespaces from NotificationMessage
> -----------------------------------------------------
>
>                 Key: MUSE-293
>                 URL: https://issues.apache.org/jira/browse/MUSE-293
>             Project: Muse
>          Issue Type: Bug
>          Components: Utilities - General, QName, and XML
>    Affects Versions: 2.2.0
>            Reporter: Matthes Rieke
>            Assignee: Dan Jemiolo
>            Priority: Minor
>         Attachments: XPathFilterNamespaceTest.java
>
>
> I have stumbled across a problem when trying to filter a NotificationMessage with an XPath expression containing namespace declarations (e.G. //om:Observation/om:procedure - where om is "http://www.opengis.net/om/1.0").
> Perhaps I made some mistake while subscribing with this filter, but to me it seems, that the MessagePatternFilter just invokes XPathUtils.isMatch(). isMatch itself invokes XPathAPI.eval(context, xpath) [from apache xalan api] and that method has no parameter for the namespaceNode. This has the result that the XPath expression takes its namespaces from the NotificationMessage, which of course may differ from the ones specified in my subscribe request.
> Also I noticed that namespaces in a MessagePatternFilter xml file (see below) just get erased when parsing the xml with the FilterFactory.
> Filter to parse:
> <wsnt:Filter xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
>     <wsnt:MessageContent Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116"
>         xmlns:om="http://www.opengis.net/om/1.0">
>         //om:Observation/om:procedure/@xlink:href='urn:ogc:object:procedure:CITE:WeatherService:LGA'
>     </wsnt:MessageContent>
> </wsnt:Filter>
> this gets parsed in the subscribe operation of NotificationProducer (I assume this is done before in the FilterFactory):
> <wsnt:Filter xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
> <wsnt:MessageContent Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116">//om:Observation/om:procedure/@xlink:href='urn:ogc:object:procedure:CITE:WeatherService:LGA'</wsnt:MessageContent>
> </wsnt:Filter>
> As you can see the namespace "om:...." is removed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Commented: (MUSE-293) XPath filter gets Namespaces from NotificationMessage

Posted by "Chris Twiner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MUSE-293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12758397#action_12758397 ] 

Chris Twiner commented on MUSE-293:
-----------------------------------

coding done, checking tests into a temporary location (until a Maven friendly way is found).  In particular toXML writes out the correct namespace prefixes (allowing persistence of subscriptions etc).

> XPath filter gets Namespaces from NotificationMessage
> -----------------------------------------------------
>
>                 Key: MUSE-293
>                 URL: https://issues.apache.org/jira/browse/MUSE-293
>             Project: Muse
>          Issue Type: Bug
>          Components: Utilities - General, QName, and XML
>    Affects Versions: 2.2.0
>            Reporter: Matthes Rieke
>            Assignee: Chris Twiner
>            Priority: Minor
>             Fix For: 2.2.1
>
>         Attachments: XPathFilterNamespaceTest.java
>
>
> I have stumbled across a problem when trying to filter a NotificationMessage with an XPath expression containing namespace declarations (e.G. //om:Observation/om:procedure - where om is "http://www.opengis.net/om/1.0").
> Perhaps I made some mistake while subscribing with this filter, but to me it seems, that the MessagePatternFilter just invokes XPathUtils.isMatch(). isMatch itself invokes XPathAPI.eval(context, xpath) [from apache xalan api] and that method has no parameter for the namespaceNode. This has the result that the XPath expression takes its namespaces from the NotificationMessage, which of course may differ from the ones specified in my subscribe request.
> Also I noticed that namespaces in a MessagePatternFilter xml file (see below) just get erased when parsing the xml with the FilterFactory.
> Filter to parse:
> <wsnt:Filter xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
>     <wsnt:MessageContent Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116"
>         xmlns:om="http://www.opengis.net/om/1.0">
>         //om:Observation/om:procedure/@xlink:href='urn:ogc:object:procedure:CITE:WeatherService:LGA'
>     </wsnt:MessageContent>
> </wsnt:Filter>
> this gets parsed in the subscribe operation of NotificationProducer (I assume this is done before in the FilterFactory):
> <wsnt:Filter xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
> <wsnt:MessageContent Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116">//om:Observation/om:procedure/@xlink:href='urn:ogc:object:procedure:CITE:WeatherService:LGA'</wsnt:MessageContent>
> </wsnt:Filter>
> As you can see the namespace "om:...." is removed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org