Hi Craig,

Support for typed IDs hasn't been a priority, and there's no definite plan to actually implement this even though the framework has been designed to support it. Sorry,

 - Dennis

Dennis M. Sosnoski
SOA, Web Services, and XML
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-296-6194 - Wellington, NZ +64-4-298-6117



Craig Malone wrote:


In March 2004:

http://www.mail-archive.com/[email protected]/msg00019.html

Dennis wrote:

>>ID's have to be unique value across the xml document
>>independent of the attribute name as there is no support
>>for multiple sets of IDs in a XML document. So, what do
>>you mean by "manage several sets of IDs?"


>This is absolutely true for real XML IDs, which also have a
>number of other restrictions (including that they must start
>with a letter-type character). JiBX doesn't enforce this rule,
>though, and as long as you're not stating that they're IDs in
>a schema or DTD you can use JiBX's loose interpretation. Typed
>IDs is one of the features I've had planned for a while.


Does anyone know the status of support for Typed ID's?

I am using JiBX 1.0.1, and it appears that ID's must be still be
unique across all class types.

In case this is mean't to be working, the error I am finding is as follows:


With the following mapping (excerpt only):

<binding>

     <mapping name="leafTreeNode" class="....LeafTreeNode">
        <value name="name" ident="def" style="attribute"  .../>
        <value name="prompt" ident="ref" style="attribute" .../>
     </mapping>
<mapping name="yesNoPrompt" class="....YesNoPrompt">
        <value name="name" ident="def" style="attribute"  .../>
     </mapping>
</binding>

And XML of the form (excerpt also)

<root>
    ...
    <leafTreeNode name="Sample name 201" prompt="Sample name 201">
       ...
    </leafTreeNode>


    <yesNoPrompt name="Sample name 201">
       ...
    </yesNoPrompt>

</root>

I get a ClassCastException:

java.lang.ClassCastException at:
com...LeafTreeNode.JiBX_complete_jibx_unmarshalAttr_2_0(LeafTreeNode.java) at
...

It looks like the reference attribute (prompt="Sample name 201"),
instead of returning the reference to the "yesNoPrompt" object returns
a reference to the "leafTreeNode" object, which has the same value for its id.

This works fine if instead the XML looks like:

<root>
    ...
    <leafTreeNode name="Sample name 100" prompt="Sample name 201">
       ...
    </leafTreeNode>


  &n bsp; <yesNoPrompt name="Sample name 201">
       ...
    </yesNoPrompt>

</root>


When I had a quick look at the code, it seems methods such as "attributeExistingIDREF" and "defineID" in the unmarshaller take an index argument to provide seperation of class ids, however in the modified class files for my objects it looks like they are always
being called with an index of 0.

Is there still a restriction requiring unique ID across all classes in the same
document, or have I done something wrong?

Thanks for any help.

Craig

------------------------------------------------------------------------
On Yahoo!7
Messenger: Make free PC-to-PC calls to your friends overseas. <http://au.rd.yahoo.com/mail/tag/**http%3A%2F%2Fau.messenger.yahoo.com%2F>




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to