Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » Does XMLBinding use XPath?
Does XMLBinding use XPath? [message #932606] Thu, 04 October 2012 09:00 Go to next message
Hazem ELRAFFIEE is currently offline Hazem ELRAFFIEEFriend
Messages: 61
Registered: September 2012
Member
Hello everyone Smile I just wonder if XMLBinding use XPath for addressing different tags.

For example:
<tagA>
    <tagB key1="value1" />
</tagA>


If I want "key1" to be a Property in the class "ITagA.java", can I just write:

@XmlBinding ( path = "tagB/@key1" )

??

more generally, is it possible to make "key1" a Property for "ITagA.java" instead of creating a class for "tagB"?

And if I have to create a class for "tagB", how can I put "key1" as a Property Editor in the Composite of "tagA"?

Thnx in advance Smile

[Updated on: Thu, 04 October 2012 09:03]

Report message to a moderator

Re: Does XMLBinding use XPath? [message #933142 is a reply to message #932606] Thu, 04 October 2012 19:33 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 952
Registered: July 2009
Senior Member
It isn't an actual XPath, but the XML binding annotations do support paths. In your example, @XmlBinding( path = "tagB/@key1" ) is supported, so it is certainly possible to flatten your model structure.

If you choose not to flatten, you would use an ImpliedElementProperty to bind to container XML elements that don't in themselves have semantic value. In sdef, you would use the "with" construct to traverse into an ImplementElementProperty as part of a form definition.

If anything above is unclear, don't hesitate to ask for clarification.

- Konstantin

Re: Does XMLBinding use XPath? [message #936646 is a reply to message #933142] Mon, 08 October 2012 07:29 Go to previous messageGo to next message
Hazem ELRAFFIEE is currently offline Hazem ELRAFFIEEFriend
Messages: 61
Registered: September 2012
Member
Konstantin Komissarchik wrote on Thu, 04 October 2012 15:33

If you choose not to flatten, you would use an ImpliedElementProperty to bind to container XML elements that don't in themselves have semantic value. In sdef, you would use the "with" construct to traverse into an ImplementElementProperty as part of a form definition.

If anything above is unclear, don't hesitate to ask for clarification.

- Konstantin



Thank you for quick response Smile

For the "with" construct, can I use the same way to walk through the model? I mean like: <path>parent/child</path> ?
Re: Does XMLBinding use XPath? [message #937037 is a reply to message #936646] Mon, 08 October 2012 15:46 Go to previous message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 952
Registered: July 2009
Senior Member
Quote:
For the "with" construct, can I use the same way to walk through the model? I mean like: <path>parent/child</path> ?


Yes, the with construct supports model paths.

- Konstantin
Previous Topic:Announcing Sapphire 0.5.3 Release
Next Topic:Is it possible to use buried xml tree nodes in diagram
Goto Forum:
  


Current Time: Fri Nov 28 12:51:21 GMT 2014

Powered by FUDForum. Page generated in 0.03426 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software