[jboss-dev-forums] [Design of JBossXB] - Re: Attributes problem

adrian@jboss.org do-not-reply at jboss.com
Fri Mar 7 04:52:55 EST 2008


"alex.loubyansky at jboss.com" wrote : "adrian at jboss.org" wrote : The @XmlChild from some other part of the group
  |   | needs to replace the CDATA. The CDATA and subelements are mutually
  |   | exclusive. You can't have
  |   | 
  |   |   | <key class="java.lang.Integer">12
  |   |   |    <list ...>
  |   |   | </key>
  |   |   | 
  |   | 
  |   | It doesn't make sense. :-)
  | 
  | Ok, if that doesn't make sense we can throw an exception. My question is then does the following make sense? Not in the given MC example but in general. Can this be useful?
  | 
  | 
  |   | <wrapper attr="val1">
  |   |    <child ...>
  |   | </wrapper>
  |   | <wrapper attr="val2">
  |   |    <wildcard-content ...>
  |   | </wrapper>
  |   | <wrapper attr="val3">12</wrapper>
  |   | 
  | 
  | My point was it didn't matter what the content of wrapper was, the attr should still be set in the same way.

With the current rules it will parse the attribute and set it on the CDATA type
(StringValueMetaData). But since there is no CDATA, it is child element
instead, the attribute will be discarded and the child type used e.g. ListValueMetaData.

We don't currently throw an exception for this. The spurious attribute is just ignored.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4134786#4134786

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4134786



More information about the jboss-dev-forums mailing list