Thanks Ilya.
I'm not using dynamic binding.
The application does next things:
1. Receive the xml document, unmarshall it to the object graph and process this graph.
2. If the error happens in the object node the result should contain the location of the corresponding XML node.
 
For example, the validation error happens for the field Foo.key. The result should contain the location where the error happens in the xml document. I know how to discover XML tag for the class Foo using BindingFactory.getMappedClasses (). Based on this functionality and using preset() it seems to be possible to build XPATH location for every java object node. (Other solution is can be keeping in every java object the start/end positions of the stream parser.)
 
Ideally the result should contain exact position of the XML element where the error is happened. There is no knowledge of the java 'key' (see example) field outside of the application. The user expects see 'Identifier' xml tag as cause of the error and should have possibility to locate it easily in the xml document.
 
I believe this mapping information is used by marshalling in runtime. I just not sure if it's accessible in the runtime.
 
Regards.
Vitaliy
 
 

 
On 10/5/06, Vitaliy Rukavishnikov <[EMAIL PROTECTED]> wrote:
Hi,
 
Is there any way in runtime to get a xml tag name knowing a field name? 
For example,
 
class Foo{
   private String key;
}
 
Binding.
...
<value name='Identifier' field='key' usage='optional' />
...
 
The goal is to discover the xml tag "Identifier" based on the name of the field "key".
I was unable to find anything in BindingFactory or those information behind the scenes.
 
Thanks a lot.
Vitaliy

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to