  | |  | One-to-one file mapping | One-to-one file mapping 2004-02-18 - By Holbrook, R Cody (Cody)
Back
*edit, fixed typos on my part...
Matt,
Thanks for the interest in the problem. I apologize for overlapping. Essentially, here 's what I 'm currently doing. A XML file (containing documentation) is passed through a stylesheet (XSL) to create a new XSL. The XSDs are run through the new stylesheet and result in XSDs with documentation. The XSDs run through the castor target generate java code. The java also has the documentation. Simply run javadoc against the newly generated java and you 've got product documentation in HTML format.
That 's all well and good, but as the code base has grown, the original documentation has grown into something that will soon be unmanageable.
So here 's what I 'm looking to do. Let 's say that I have 10 XSDs. I know each one 's name and will not change them. Originally, one XML was used to hold the documentation for all 10 XSDs, but now, I want to break the file up into 10 pieces. Each XML filename will look exactly like it 's XSD counter part (a.xml contains documentation only for a.xsd, same with b.xml:b.xsd, etc.). These XML files have already been created.
What I need ant to do is match these files up correctly. So using the process I 've established, here 's what will happen:
b.xml goes through stylesheet to become b.xsl (this already happens to all XML in ${documentation})
b.xsd is passed through b.xsl to become a new b.xsd containing the documentation from b.xml.
Here 's what a single target would look like:
<target name= "create-xsl " depends= "create-src " description= "Create xsl from xml " >
<xslt basedir= "${documentation} " destdir= "${xsl.gen} " style= "${xsl}/stylesheet.xsl " extension= ".xsl " >
</xslt >
</target >
<target name= "create-xsd " depends= "create-xsl " description= "Create xsd using xsl " >
<xslt basedir= "${xsd} " destdir= "${xsd.gen} " style= "${xsl.gen}/b.xsl " extension= ".xsd "
includes= "b.xsd " > </xslt >
</target >
So here you can see that the create-xsl target isn 't interested in file names. It simply passes all XML files in ${documentation} through stylesheet.xsl to create more XSL files.
Target create-xsd, however, needs to be told exactly what XSL and XSD to use. This works, and I could just make a create-xsd target for each XSD I need processed. But there are several 100 and that makes for a big build.xml. Also, new XSDs are added every week or so, making maintenance of the build file frequent and tedious work.
What I don 't understand how to do is how to change the create-xsd target to make it do perfect matches of the XSL identified in style and the XSD identified in includes. Wildcards don 't work (ie *.xsl, *.xsd) because each XSL runs against each XSD and it 's a messy and long process! Any ideas?
Thanks,
Cody Holbrook
--- "Holbrook, R Cody (Cody) " <rch7@(protected) > wrote:
> Is there a good way, without making a bevy of
> targets to cover all the xml files, to match 1-to-1
> XML-to-XSD (a.xml only interacts with a.xsd, etc.)?
Cody:
Without my having any experience working with the xslt
task, can you elaborate a little on what you want to
happen per a,b,...,z file pair?
Thanks,
Matt
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
|
|
 |