struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lacerda, Wellington (AFIS)" <>
Subject RE: [PROPOSAL] Integrating Struts with XML Data
Date Mon, 09 Oct 2000 15:57:57 GMT
What about making it compliant with Xform ?

Wellington Silva

		-----Original Message-----
		From:	Craig R. McClanahan
		Sent:	Monday, October 09, 2000 5:41 PM
		Subject:	Re: [PROPOSAL] Integrating Struts with XML

		Colin Sampaleanu wrote:

		> > -----Original Message-----
		> > From: Craig R. McClanahan
		> > Sent: October 9, 2000 2:27 AM
		> > To:
		> > Subject: [PROPOSAL] Integrating Struts with XML Data
		> >
		> > In the examples below, assume that a DOM object with the
		> > structure is attached to the bean name "bean":
		> >
		> >     <a b="1" c="2">
		> >         <d e="3" f="4"/>
		> >         <d e="5" f="6"/>
		> >     </a>
		> >     <a b="7" c="8">
		> >         <d e="9" f="10"/>
		> >         <d e="11" f="12"/>
		> >     </a>
		> >
		> > Here's the proposal -- please let me know what you
		> > ...
		> Looks quite usable.
		> I have one question. What happens though if you have a
child element that
		> has the same name as an attribute in the parent element?
		>      <a b="7" c="8">
		>          <b x="0" y="1"/>
		>          <d e="9" f="10"/>
		>          <d e="11" f="12"/>
		>      </a>
		> According to your proposal, a.b would refer to the
attribute 'b' of element
		> 'a'. How do I refer to the child element 'b' of element

		With the proposal as originally stated, you cannot.  I'm not
sure how to fix
		that without breaking the transparency between accessing
bean properties and
		XML elements/attributes.

		On the other hand, I'm not sure that it is going to be a
problem in practice.
		I would bet that most people will use element names like
"customer" or "order"
		and attribute names that match their bean property (or
database column) names
		-- clashes can happen, but are likely not to be common.

		On the gripping hand (if you're a "Mote in God's Eye" fan
:-), we could extend
		the syntax to deal with this -- but I don't have any good
ideas for how off the
		top of my head.


		See you at ApacheCon Europe <>!
		Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
		Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
		                                    Applications to Tomcat

View raw message