Re: How generate one file for each class in xml using xslt and java?
I forgot to close the <xsl:variable> element. It should be:
<xsl:variable name="fileName" select="concat(@className, '.java')"/>
"ted" <tedNOSPAM94107@yahoo.com> wrote in message
news:hUV7b.7385$PE6.4278@newsread3.news.pas.earthl ink.net...[color=blue]
> Take a look at the Saxon parser. It processes the <xsl:result-document>
> element which will output to multiple documents.
>
> Put something like this in your xsl:
>
> <xsl:for-each select="yourClass">
> <xsl:variable name="fileName" select="concat(@className, '.java')">
> <xsl:result-document href="$fileName">
> <!-- put your Java code here -->
> </xsl:result-document>
> </xsl:for-each>
>
>
>
> "Petterson Mikael" <mikael.petterson@era.ericsson.se> wrote in message
> news:3F5D7C58.900AC05D@era.ericsson.se...[color=green]
> > Hi,
> >
> > I have one xml file with many class elements. For each class element I
> > need to generate a new new java file.As it is now I get ( my output )
> > all classes in one file. Do I control this in the code for the
> > transformer or in the xsl-template? Where can I find information about
> > this?
> >
> > Your help is very much appreciated,
> >
> > file://Mikael[/color]
>
>[/color] |