[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Even if you're not ... was If you're going to the W3C meet


Re:  Even if you're not ... was If you're going to the W3C meet
On Sat, 29 Jan 2005 10:02:17 -0500, Alan Gutierrez
<alan-xml-dev@e...> wrote:

<snip/>

>    I'm not sure how to ask the question. Let's say you have a file
>    that's a project.
> 
>    <project>
>      <source>
>        <name>main</name>
>        <dir>src/main</dir>
>        <category>dist</category>
>      </source>
>    </project>
> 
>    Project directory:
> 
>      /project
>          /src
>              /java
>              /resource
> 
>    Use the above to generate an Ant script. I run a transform and I
>    have javac, junit, javadoc, jar, svn, and distrubute tasks.
> 
>    How do I allow a user to plug in a new set of tasks to generate?
> 
>    This is a general problem I'm having, how do you create hooks,
>    callbacks, er, how do you create an XSLT framework?

One way to do this would be to make it data driven.  In the framework
class you build some variable that is the master list of tasks and
some well defined calls to initialize the list and then process it. 
Any framework class can then modify the list as needed and then pass
control back.  Eg, in the framework:

<xsl:variable name="tasks">
 <javac/><junit/><javadoc/><jar/><svn/><distrubute/>
</xsl:variable>

<xsl:template name="init">
  <xsl:apply-templates select="tasks" mode="process/>
</xsl:template>

Then the users of the framework implement "init" with a higher
priority and call the same modal templates. They add their own task
specific templates with the same mode as needed.  Of course, with this
approach you're also likely looking at adding some parameter that is
the real data to be passed from the main call, to the init and then on
to the processing tasks....

-- 
Peter Hunsberger

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.