struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas E Enebo <en...@tc.umn.edu>
Subject Re: [PROPOSAL] Integrating Struts with XML Data
Date Mon, 09 Oct 2000 16:26:31 GMT
  Have you guys considered using XPATH as a syntax?  It is already
written (i.e. code exists) for XSLT, it is a standard, and it can 
uniquely identify elements and attributes.   It may have the shortcoming 
of losing some of the simplicity as in your proposal.

  I was going to say and people know the syntax, but I do not think
that many people really know it yet.  Although in the future who
knows?  Could be a major benefit.

  The W3C page on it is: http://www.w3.org/TR/xpath

-Tom

Craig R. McClanahan said as they defenestrated me:
> Colin Sampaleanu wrote:
> 
> > > -----Original Message-----
> > > From: Craig R. McClanahan [mailto:Craig.McClanahan@eng.sun.com]
> > > Sent: October 9, 2000 2:27 AM
> > > To: struts-dev@jakarta.apache.org
> > > Subject: [PROPOSAL] Integrating Struts with XML Data
> > >
> > > In the examples below, assume that a DOM object with the following
> > > 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 think:
> > > ...
> >
> > 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 'a'?
> 
> 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.
> 
> Craig
> 
> ====================
> See you at ApacheCon Europe <http://www.apachecon.com>!
> Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
> Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
>                                     Applications to Tomcat

-- 
+--------http://www.tc.umn.edu/~enebo --------+-mailto:enebo@tc.umn.edu -+
| Thomas E Enebo, Friend of the University    | ???????????????????????? |
| Phone: (612) 237-4607  Fax: (???) ???-????  | ???????????????????????? |

Mime
View raw message