Subject: [xsl] XSLT for Extensibility From: Alan <alan-xsl-list@xxxxxxxxx> Date: Sat, 29 Jan 2005 13:47:34 -0500 |
How does one design in XSLT for extensibility? I know how to design an API, but not on in XSLT. I'm not sure how to ask the question. So I'll try an example. (I'm not really looking for a build solution, but an XSLT as API discussion.) -- 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. You could transform the project document into simple javac, junit, javadoc, and jar tasks. How do you allow the user to plug in new tasks? This is a general problem I'm having, how do you create hooks, callbacks, er, how do you create an XSLT framework? -- I asked elsewhere, and pipelines were suggested, so I'll permit myself two steps. Here's a notion. <project> <name>foo</name> <source> <name>main</name> <dir>src/main</dir> <category>dist</category> </source> <task> <name>javac</name> <name>javadoc</name> <name>antlr</name> <name>jar</name> </task> </project> I can transform the above into a script that looks like: <xsl:stylesheet> <xsl:import href="taskdef/javac.xslt"/> <xsl:import href="taskdef/javadoc.xslt"/> <xsl:import href="taskdef/antlr.xslt"/> <xsl:import href="taskdef/jar.xslt"/> <xsl:template match="project"> <project name="foo" default="default"> <xsl:apply-templates select="." mode="javac"/> <xsl:apply-templates select="." mode="javadoc"/> <xsl:apply-templates select="." mode="antlr"/> <xsl:apply-templates select="." mode="jar"/> </project> </xsl:template> </xsl:stylesheet> Then I can use that stylesheet as the the style to transform my project into an Ant build file. What other methods are there for creating a a pluggble XSLT framework? -- Alan Gutierrez - alan@xxxxxxxxx
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Grouping within sub eleme, G. Ken Holman | Thread | Re: [xsl] XSLT for Extensibility, Dimitre Novatchev |
Re: [xsl] grouping, sorting and sel, chunga srevenge | Date | Re: [xsl] XSLT for Extensibility, Dimitre Novatchev |
Month |