Site Navigation:


A simple binding example

This sample's code is located in the package {@link org.otvl.sbxbsamp.simple}.

The SoftBean object model

The sample's object model is provided here:

The target XML format

<House address="Autivielle">


<Room id="1">



<Window id="0">left</Window>

<Window id="1">right</Window>




<Room id="2">



<Window id="0">center</Window>




The binding specification

Basic rules for writing a binding specification

The binding specification is a collection of numbered rules. A rule applies to a binding name (here "hbs") and a class to be bound.

Each rule has the following syntax:


The XML-path can be specified as following:

  • @attribute: an XML attribute of the current element

  • element: the name of a sub-element

  • .(dot): the text content of the current element, when using the API the empty string "" must be used instead of . (dot).

If a binding name follows the XmlPath, then a sub-object has to be handled with the corresponding binding specification. If not, then the property is a simple property on the current object.