freaking1 / jing-trang

Automatically exported from code.google.com/p/jing-trang
Other
1 stars 0 forks source link

Ant task for Trang #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Should have a Trang ant task that transforms schemas like the Trang
application does.

Original issue reported on code.google.com by jjc.jclark.com on 18 Oct 2008 at 10:13

GoogleCodeExporter commented 9 years ago

Original comment by jjc.jclark.com on 18 Oct 2008 at 10:39

GoogleCodeExporter commented 9 years ago

Original comment by jjc.jclark.com on 22 Oct 2008 at 5:54

GoogleCodeExporter commented 9 years ago
I'd like to make a Maven plugin.

It would be much easier if Driver's "doMain" [1] method was public.  I can't use
"main" cause that will call System.exit(_).

Or maybe I'm just not seeing the correct way to access Trang in an embedded 
flow.  Am
I missing something?

Thanks,

Luke

[1]
http://code.google.com/p/jing-trang/source/browse/tags/V20081028/mod/trang/src/m
ain/com/thaiopensource/relaxng/translate/Driver.java#45

Original comment by lukewpat...@gmail.com on 11 Dec 2008 at 7:14

GoogleCodeExporter commented 9 years ago
Is that really going to be enough?  For example, aren't you going to want to 
have
errors reported via exceptions rather than being printed to System.err?

I would copy and paste for now.  Then when you're done and I've done an Ant 
Task we
can see whether there is any common functionality that can be factored out.

Original comment by jjc.jclark.com on 12 Dec 2008 at 12:34

GoogleCodeExporter commented 9 years ago
"For example, aren't you going to want to have errors reported via exceptions 
rather
than being printed to System.err?"

That's a good point.

I was just hoping that the console-driven flow and the plugin flow could go 
through
the same facade.  That would help ensure that the same set of functionality was
offered through the different routes.

"we can see whether there is any common functionality that can be factored out."

Sounds good.

Original comment by lukewpat...@gmail.com on 14 Dec 2008 at 8:11

GoogleCodeExporter commented 9 years ago
I was able to reuse and update the following ant task for trang:
http://www.dehora.net/code/trang/trangtask.html
It was coded against trang in 2003.
Making it work with version r2341 in svn was just a matter of adding a 
parameter (sax
resolver) in TrangTask when it calls InputFormat.load().
It handles exception properly (they're not just printed).
Seems to work for my purposes (rnc->xsd and rnc->rng). However I have not done 
any
further testing...
Diff file attached.

Original comment by fmjrey on 26 Mar 2010 at 12:19

Attachments:

GoogleCodeExporter commented 9 years ago
Here's a TrangTask.java derived from 
http://www.dehora.net/code/trang/trangtask.html
Replace TrangTask.jave from above download with attached file.
The new class:
- works with r2353
- adds a forceRebuild attribute
- adds a catalog attribute as described in issue #133

Original comment by fmjrey on 31 Dec 2010 at 9:40

Attachments:

GoogleCodeExporter commented 9 years ago
looks like a couple results turn up when searching for Maven plugins: 
http://jarvana.com/jarvana/search?search_type=class&java_class=Trang*

Original comment by lukewpat...@gmail.com on 8 Feb 2011 at 4:06

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
<property name="trang.dir" location="WebContent/WEB-INF/lib" />
    <property name="source.dir" location="WebContent/WEB-INF/schema/samples" />
    <property name="schema.dir" location="WebContent/WEB-INF/schema/xsd" />
<target name="generate" description="generates order schema">
        <delete dir="${schema.dir}" />
        <mkdir dir="${schema.dir}" />

        <java jar="${trang.dir}/trang-20091111.jar" fork="true">
            <arg value="${source.dir}/client-request.xml" />
            <arg value="${schema.dir}/client-request.xsd" />
        </java>

        <java jar="${trang.dir}/trang-20091111.jar" fork="true">
            <arg value="${source.dir}/client-response.xml" />
            <arg value="${schema.dir}/client-response.xsd" />
        </java>
    </target>

Original comment by nandk.2...@gmail.com on 18 Jun 2014 at 3:30