> > Here's a suggested solution:
> >
> > * Each application should have its own xwork.xml file that is placed
at
> > the root level of the project.  For example,
> > com/indigoegg/myproject/xwork.xml for a project with a root of
> > com.indigoegg.myproject
> >
> > * Allow xwork.xml to include other xml files via the follow (or
similar)
> > construct:
> >
> > <package namespace="subapp">
> >   <subapp name="com.indigoegg.myproject"/>
> > </package>
> >
> > * These included configuration files should be able to to, in turn
call
> > other configuration files to allow creation of applications by
> > composition.
> >
> > * The subapp need only be aware of its defined namespace.  For
example,
> > if an Action from the subapp calls
> >
> >     ActionInvocation invocation = new ActionInvocation("/", "login")
> > ;
> >
> > They should get a reference to /subapp/login essentially.
> >
> > * In addition to the <subapp> tag, there should also be an <include>
> > tag, peered with <package>, to allow developers to break up large
> > xwork.xml files.
> 
> Why not use the standard XML way to include files in other files, i.e.
> using entities? The above seems a bit like reinventing the wheel.

I've used entities to include XML files before and I don't them for the
following reasons:

* It's difficult to figure out exactly where a problem occurs if it's in
line 347 of the combined file.  Since everything is referenced through
entities, you have to figure out which file and which real line you're
dealing with.

* It doesn't allow you to take advantage of XML editors like IDEA that
are DTD aware as your included entities are only XML snippets.  Here's
an example of what I mean:

[--- a.xml ---]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document [
  <!ENTITY section1 SYSTEM "b.xml">
]>

<document>
  &section1;
</document>

[--- b.xml ---]
<?xml version="1.0"?>

<document>
  <ack/>
</document>

The unrolled a.xml is 

<document>
  <document>
    <ack/>
  </document>
</document>

which is not what you want.

--
Matt Ho
Principal
Indigo Egg, Inc.
http://www.indigoegg.com/






-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to