You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Frank Budinsky (JIRA)" <tu...@ws.apache.org> on 2006/08/30 16:07:23 UTC

[jira] Commented: (TUSCANY-675) XPATH doesnt support dots in names (treats them as indices) in Java Implementation

    [ http://issues.apache.org/jira/browse/TUSCANY-675?page=comments#action_12431586 ] 
            
Frank Budinsky commented on TUSCANY-675:
----------------------------------------

This is a well known, but unfortunate "feature" of SDO 2.01. The "." character is a reserved character in SDO paths, so you can't access properties with names that include "." in a path expression. For now, you would need to do something like this instead:

DataObject comp = scaObj.getDataObject("component[1]");
DataObject impJava = comp.getDataObject(comp.getInstanceProperty("implentation.java"));

Another possiblity is that we could add alias names for properties with "." in their name. For example "implementation_java". Then clients could access it like this:

DataObject impJava = scaObj.getDataObject("component[1]/implementation_java");

Hopefully the SDO 2.1 spec , which is attempting to fix some of the problems in the 2.01 spec, will provide a good "standard" way to handle this relatively common problem when working with XSD based models.



> XPATH doesnt support dots in names (treats them as indices) in Java Implementation
> ----------------------------------------------------------------------------------
>
>                 Key: TUSCANY-675
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-675
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M2
>         Environment: All
>            Reporter: Hasan Muhammad
>
> When you try to do the following:
> DataObject impJava = scaObj.getDataObject("component[1]/implementation.java");
> It results in the following exception:
> java.lang.NumberFormatException: For input string: "java"
>                 at java.lang.NumberFormatException.forInputString(NumberFormatException.java:63)
>                 at java.lang.Integer.parseInt(Integer.java:481)
>                 at java.lang.Integer.parseInt(Integer.java:531)
>                 at org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.process(DataObjectUtil.java:2097)
>                 at org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.init(DataObjectUtil.java:1918)
>                 at org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.create(DataObjectUtil.java:1838)
>                 at org.apache.tuscany.sdo.util.DataObjectUtil.get(DataObjectUtil.java:738)
>                 at org.apache.tuscany.sdo.impl.DataObjectImpl.get(DataObjectImpl.java:213)
>                 at org.apache.tuscany.sdo.impl.DataObjectImpl.getDataObject(DataObjectImpl.java:323)
>                 at com.ibm.ws.sca2.module.loader.test.SDOLoaderTest.main(SDOLoaderTest.java:60)
> It is clear that it is trying to treat the string after "." as an index..

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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