You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Guillaume Sauthier (JIRA)" <ji...@apache.org> on 2010/11/04 11:29:42 UTC
[jira] Created: (FELIX-2685) Wrong Element name when XML namespace
contains ':'
Wrong Element name when XML namespace contains ':'
--------------------------------------------------
Key: FELIX-2685
URL: https://issues.apache.org/jira/browse/FELIX-2685
Project: Felix
Issue Type: Bug
Components: iPOJO
Affects Versions: iPOJO-1.6.0
Reporter: Guillaume Sauthier
Here here my metadata.xml
{noformat}
<session name="session"
type="stateful"
base="my-super-base"
xmlns="http://jasmine.ow2.org/rules/1.0.0" />
{noformat}
Notice that the XML namespace is "http://jasmine.ow2.org/rules/1.0.0".
When I parse the Element/Attribute structure generated from this XML, i cannot access my "configuration" element.
An Element.toString() gives the fiollowing result:
{noformat}
//jasmine.ow2.org/rules/1.0.0:knowledge-base name="my-super-base"
//jasmine.ow2.org/rules/1.0.0:configuration
//jasmine.ow2.org/rules/1.0.0:property name="drools.multiThreadEvaluation" value="true"
//jasmine.ow2.org/rules/1.0.0:property name="drools.eventProcessingMode" value="stream"
{noformat}
Element name is "//jasmine.ow2.org/rules/1.0.0:configuration", not only "configuration" :'(
The problem is probably due to a bug in ManifestMetadataParser.parseElements(String), where we considere that the namespace stops at the first ':' character.
The easiest solution will probably to gather the composite element name (namespace+name) completely, and then get the index of the last ':', then split the string.
WDYT ?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (FELIX-2685) Wrong Element name when XML namespace
contains ':'
Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2685?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Clement Escoffier updated FELIX-2685:
-------------------------------------
Fix Version/s: iPOJO-1.8.0
> Wrong Element name when XML namespace contains ':'
> --------------------------------------------------
>
> Key: FELIX-2685
> URL: https://issues.apache.org/jira/browse/FELIX-2685
> Project: Felix
> Issue Type: Bug
> Components: iPOJO
> Affects Versions: iPOJO-1.6.0
> Reporter: Guillaume Sauthier
> Fix For: iPOJO-1.8.0
>
>
> Here here my metadata.xml
> {noformat}
> <session name="session"
> type="stateful"
> base="my-super-base"
> xmlns="http://jasmine.ow2.org/rules/1.0.0" />
> {noformat}
> Notice that the XML namespace is "http://jasmine.ow2.org/rules/1.0.0".
> When I parse the Element/Attribute structure generated from this XML, i cannot access my "configuration" element.
> An Element.toString() gives the fiollowing result:
> {noformat}
> //jasmine.ow2.org/rules/1.0.0:knowledge-base name="my-super-base"
> //jasmine.ow2.org/rules/1.0.0:configuration
> //jasmine.ow2.org/rules/1.0.0:property name="drools.multiThreadEvaluation" value="true"
> //jasmine.ow2.org/rules/1.0.0:property name="drools.eventProcessingMode" value="stream"
> {noformat}
> Element name is "//jasmine.ow2.org/rules/1.0.0:configuration", not only "configuration" :'(
> The problem is probably due to a bug in ManifestMetadataParser.parseElements(String), where we considere that the namespace stops at the first ':' character.
> The easiest solution will probably to gather the composite element name (namespace+name) completely, and then get the index of the last ':', then split the string.
> WDYT ?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Reopened: (FELIX-2685) Wrong Element name when XML namespace
contains ':'
Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2685?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Clement Escoffier reopened FELIX-2685:
--------------------------------------
Assignee: Clement Escoffier
Oups, sorry. I will fix it later this week.
> Wrong Element name when XML namespace contains ':'
> --------------------------------------------------
>
> Key: FELIX-2685
> URL: https://issues.apache.org/jira/browse/FELIX-2685
> Project: Felix
> Issue Type: Bug
> Components: iPOJO
> Affects Versions: iPOJO-1.6.0
> Reporter: Guillaume Sauthier
> Assignee: Clement Escoffier
> Fix For: iPOJO-1.8.0
>
>
> Here here my metadata.xml
> {noformat}
> <session name="session"
> type="stateful"
> base="my-super-base"
> xmlns="http://jasmine.ow2.org/rules/1.0.0" />
> {noformat}
> Notice that the XML namespace is "http://jasmine.ow2.org/rules/1.0.0".
> When I parse the Element/Attribute structure generated from this XML, i cannot access my "configuration" element.
> An Element.toString() gives the fiollowing result:
> {noformat}
> //jasmine.ow2.org/rules/1.0.0:knowledge-base name="my-super-base"
> //jasmine.ow2.org/rules/1.0.0:configuration
> //jasmine.ow2.org/rules/1.0.0:property name="drools.multiThreadEvaluation" value="true"
> //jasmine.ow2.org/rules/1.0.0:property name="drools.eventProcessingMode" value="stream"
> {noformat}
> Element name is "//jasmine.ow2.org/rules/1.0.0:configuration", not only "configuration" :'(
> The problem is probably due to a bug in ManifestMetadataParser.parseElements(String), where we considere that the namespace stops at the first ':' character.
> The easiest solution will probably to gather the composite element name (namespace+name) completely, and then get the index of the last ':', then split the string.
> WDYT ?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (FELIX-2685) Wrong Element name when XML
namespace contains ':'
Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2685?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12930244#action_12930244 ]
Clement Escoffier commented on FELIX-2685:
------------------------------------------
I've updated the trunk to use a lastIndexOf instead of indexOf. It works on your example. Please tell me if you agree with this change.
> Wrong Element name when XML namespace contains ':'
> --------------------------------------------------
>
> Key: FELIX-2685
> URL: https://issues.apache.org/jira/browse/FELIX-2685
> Project: Felix
> Issue Type: Bug
> Components: iPOJO
> Affects Versions: iPOJO-1.6.0
> Reporter: Guillaume Sauthier
> Assignee: Clement Escoffier
> Fix For: iPOJO-1.8.0
>
>
> Here here my metadata.xml
> {noformat}
> <session name="session"
> type="stateful"
> base="my-super-base"
> xmlns="http://jasmine.ow2.org/rules/1.0.0" />
> {noformat}
> Notice that the XML namespace is "http://jasmine.ow2.org/rules/1.0.0".
> When I parse the Element/Attribute structure generated from this XML, i cannot access my "configuration" element.
> An Element.toString() gives the fiollowing result:
> {noformat}
> //jasmine.ow2.org/rules/1.0.0:knowledge-base name="my-super-base"
> //jasmine.ow2.org/rules/1.0.0:configuration
> //jasmine.ow2.org/rules/1.0.0:property name="drools.multiThreadEvaluation" value="true"
> //jasmine.ow2.org/rules/1.0.0:property name="drools.eventProcessingMode" value="stream"
> {noformat}
> Element name is "//jasmine.ow2.org/rules/1.0.0:configuration", not only "configuration" :'(
> The problem is probably due to a bug in ManifestMetadataParser.parseElements(String), where we considere that the namespace stops at the first ':' character.
> The easiest solution will probably to gather the composite element name (namespace+name) completely, and then get the index of the last ':', then split the string.
> WDYT ?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (FELIX-2685) Wrong Element name when XML namespace
contains ':'
Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2685?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Clement Escoffier resolved FELIX-2685.
--------------------------------------
Resolution: Fixed
> Wrong Element name when XML namespace contains ':'
> --------------------------------------------------
>
> Key: FELIX-2685
> URL: https://issues.apache.org/jira/browse/FELIX-2685
> Project: Felix
> Issue Type: Bug
> Components: iPOJO
> Affects Versions: iPOJO-1.6.0
> Reporter: Guillaume Sauthier
> Fix For: iPOJO-1.8.0
>
>
> Here here my metadata.xml
> {noformat}
> <session name="session"
> type="stateful"
> base="my-super-base"
> xmlns="http://jasmine.ow2.org/rules/1.0.0" />
> {noformat}
> Notice that the XML namespace is "http://jasmine.ow2.org/rules/1.0.0".
> When I parse the Element/Attribute structure generated from this XML, i cannot access my "configuration" element.
> An Element.toString() gives the fiollowing result:
> {noformat}
> //jasmine.ow2.org/rules/1.0.0:knowledge-base name="my-super-base"
> //jasmine.ow2.org/rules/1.0.0:configuration
> //jasmine.ow2.org/rules/1.0.0:property name="drools.multiThreadEvaluation" value="true"
> //jasmine.ow2.org/rules/1.0.0:property name="drools.eventProcessingMode" value="stream"
> {noformat}
> Element name is "//jasmine.ow2.org/rules/1.0.0:configuration", not only "configuration" :'(
> The problem is probably due to a bug in ManifestMetadataParser.parseElements(String), where we considere that the namespace stops at the first ':' character.
> The easiest solution will probably to gather the composite element name (namespace+name) completely, and then get the index of the last ':', then split the string.
> WDYT ?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (FELIX-2685) Wrong Element name when XML namespace
contains ':'
Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2685?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Clement Escoffier resolved FELIX-2685.
--------------------------------------
Resolution: Fixed
> Wrong Element name when XML namespace contains ':'
> --------------------------------------------------
>
> Key: FELIX-2685
> URL: https://issues.apache.org/jira/browse/FELIX-2685
> Project: Felix
> Issue Type: Bug
> Components: iPOJO
> Affects Versions: iPOJO-1.6.0
> Reporter: Guillaume Sauthier
> Assignee: Clement Escoffier
> Fix For: iPOJO-1.8.0
>
>
> Here here my metadata.xml
> {noformat}
> <session name="session"
> type="stateful"
> base="my-super-base"
> xmlns="http://jasmine.ow2.org/rules/1.0.0" />
> {noformat}
> Notice that the XML namespace is "http://jasmine.ow2.org/rules/1.0.0".
> When I parse the Element/Attribute structure generated from this XML, i cannot access my "configuration" element.
> An Element.toString() gives the fiollowing result:
> {noformat}
> //jasmine.ow2.org/rules/1.0.0:knowledge-base name="my-super-base"
> //jasmine.ow2.org/rules/1.0.0:configuration
> //jasmine.ow2.org/rules/1.0.0:property name="drools.multiThreadEvaluation" value="true"
> //jasmine.ow2.org/rules/1.0.0:property name="drools.eventProcessingMode" value="stream"
> {noformat}
> Element name is "//jasmine.ow2.org/rules/1.0.0:configuration", not only "configuration" :'(
> The problem is probably due to a bug in ManifestMetadataParser.parseElements(String), where we considere that the namespace stops at the first ':' character.
> The easiest solution will probably to gather the composite element name (namespace+name) completely, and then get the index of the last ':', then split the string.
> WDYT ?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (FELIX-2685) Wrong Element name when XML
namespace contains ':'
Posted by "Guillaume Sauthier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2685?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12929505#action_12929505 ]
Guillaume Sauthier commented on FELIX-2685:
-------------------------------------------
hmmm
That was not exactly what I was expecting :)
The namespace should ends at the last ':', not the first one
So when I have this in the XML:
<rules:configuration xmlns:rules="http://jasmine.ow2.org/rules/1.0.0" />
I have this in the metadata format
http://jasmine.ow2.org/rules/1.0.0:configuration {}
And I expect such an Element:
Element @name=configuration @namespace=http://jasmine.ow2.org/rules/1.0.0
So, just changing from n.indexOf(':') to n.lastIndexOf(':') should do the trick.
Thanks
> Wrong Element name when XML namespace contains ':'
> --------------------------------------------------
>
> Key: FELIX-2685
> URL: https://issues.apache.org/jira/browse/FELIX-2685
> Project: Felix
> Issue Type: Bug
> Components: iPOJO
> Affects Versions: iPOJO-1.6.0
> Reporter: Guillaume Sauthier
> Fix For: iPOJO-1.8.0
>
>
> Here here my metadata.xml
> {noformat}
> <session name="session"
> type="stateful"
> base="my-super-base"
> xmlns="http://jasmine.ow2.org/rules/1.0.0" />
> {noformat}
> Notice that the XML namespace is "http://jasmine.ow2.org/rules/1.0.0".
> When I parse the Element/Attribute structure generated from this XML, i cannot access my "configuration" element.
> An Element.toString() gives the fiollowing result:
> {noformat}
> //jasmine.ow2.org/rules/1.0.0:knowledge-base name="my-super-base"
> //jasmine.ow2.org/rules/1.0.0:configuration
> //jasmine.ow2.org/rules/1.0.0:property name="drools.multiThreadEvaluation" value="true"
> //jasmine.ow2.org/rules/1.0.0:property name="drools.eventProcessingMode" value="stream"
> {noformat}
> Element name is "//jasmine.ow2.org/rules/1.0.0:configuration", not only "configuration" :'(
> The problem is probably due to a bug in ManifestMetadataParser.parseElements(String), where we considere that the namespace stops at the first ':' character.
> The easiest solution will probably to gather the composite element name (namespace+name) completely, and then get the index of the last ':', then split the string.
> WDYT ?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (FELIX-2685) Wrong Element name when XML
namespace contains ':'
Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2685?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12928957#action_12928957 ]
Clement Escoffier commented on FELIX-2685:
------------------------------------------
Fixed in trunk.
> Wrong Element name when XML namespace contains ':'
> --------------------------------------------------
>
> Key: FELIX-2685
> URL: https://issues.apache.org/jira/browse/FELIX-2685
> Project: Felix
> Issue Type: Bug
> Components: iPOJO
> Affects Versions: iPOJO-1.6.0
> Reporter: Guillaume Sauthier
> Fix For: iPOJO-1.8.0
>
>
> Here here my metadata.xml
> {noformat}
> <session name="session"
> type="stateful"
> base="my-super-base"
> xmlns="http://jasmine.ow2.org/rules/1.0.0" />
> {noformat}
> Notice that the XML namespace is "http://jasmine.ow2.org/rules/1.0.0".
> When I parse the Element/Attribute structure generated from this XML, i cannot access my "configuration" element.
> An Element.toString() gives the fiollowing result:
> {noformat}
> //jasmine.ow2.org/rules/1.0.0:knowledge-base name="my-super-base"
> //jasmine.ow2.org/rules/1.0.0:configuration
> //jasmine.ow2.org/rules/1.0.0:property name="drools.multiThreadEvaluation" value="true"
> //jasmine.ow2.org/rules/1.0.0:property name="drools.eventProcessingMode" value="stream"
> {noformat}
> Element name is "//jasmine.ow2.org/rules/1.0.0:configuration", not only "configuration" :'(
> The problem is probably due to a bug in ManifestMetadataParser.parseElements(String), where we considere that the namespace stops at the first ':' character.
> The easiest solution will probably to gather the composite element name (namespace+name) completely, and then get the index of the last ':', then split the string.
> WDYT ?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (FELIX-2685) Wrong Element name when XML namespace
contains ':'
Posted by "Guillaume Sauthier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2685?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Guillaume Sauthier closed FELIX-2685.
-------------------------------------
It's OK for me.
Thanks
> Wrong Element name when XML namespace contains ':'
> --------------------------------------------------
>
> Key: FELIX-2685
> URL: https://issues.apache.org/jira/browse/FELIX-2685
> Project: Felix
> Issue Type: Bug
> Components: iPOJO
> Affects Versions: iPOJO-1.6.0
> Reporter: Guillaume Sauthier
> Assignee: Clement Escoffier
> Fix For: iPOJO-1.8.0
>
>
> Here here my metadata.xml
> {noformat}
> <session name="session"
> type="stateful"
> base="my-super-base"
> xmlns="http://jasmine.ow2.org/rules/1.0.0" />
> {noformat}
> Notice that the XML namespace is "http://jasmine.ow2.org/rules/1.0.0".
> When I parse the Element/Attribute structure generated from this XML, i cannot access my "configuration" element.
> An Element.toString() gives the fiollowing result:
> {noformat}
> //jasmine.ow2.org/rules/1.0.0:knowledge-base name="my-super-base"
> //jasmine.ow2.org/rules/1.0.0:configuration
> //jasmine.ow2.org/rules/1.0.0:property name="drools.multiThreadEvaluation" value="true"
> //jasmine.ow2.org/rules/1.0.0:property name="drools.eventProcessingMode" value="stream"
> {noformat}
> Element name is "//jasmine.ow2.org/rules/1.0.0:configuration", not only "configuration" :'(
> The problem is probably due to a bug in ManifestMetadataParser.parseElements(String), where we considere that the namespace stops at the first ':' character.
> The easiest solution will probably to gather the composite element name (namespace+name) completely, and then get the index of the last ':', then split the string.
> WDYT ?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.