ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <>
Subject RE: One-to-one file mapping
Date Wed, 18 Feb 2004 21:20:14 GMT
--- "Holbrook, R Cody (Cody)" <> wrote:
> 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?

You may be able to use ant-contrib's <for> task to
iterate over the list of xsd files.  In this case, you
could probably do something like this (untested):

<!-- create a file listing xsd files -->
<pathconvert property="xsdfiles"
        <fileset dir="${xsd}" includes="*.xsd" />

<echo file="xsdlist">${xsdfiles}</echo>

<!-- load it back, filtering for just prefixes; this
 may need tweaking -->
<loadfile srcfile="xsdlist" property="xsd">
        <replaceregex replace="\1" flags="g"
            pattern=".*([^${file.separator}]*).xsd" />

<!-- call xslt once per prefix -->
<for list="${xsd}" param="prefix"

        <xslt basedir="${xsd}" destdir="${xsd.gen}"
              out="@{prefix}.xsd" />


The first steps will be easier in the coming weeks
when we commit some changes to allow nested <mapper>s
in <pathconvert>.  Again, this is all coming from my
understanding of ant-contrib's iterative tasks rather
than any xslt knowledge... ;)


Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message