Hi Eric,
If I'm reading this correctly, you want to use custom ITS rules to extract XML into an XLIFF 2.0 file. In that case, it looks like you're doing some extra work -- you're parsing a DOM and passing it to ITSEngine, which is basically reimplementing what net.sf.okapi.filters.its.ITSFilter does. You can write code that
- Instantiate an ITSFilter instance and configure it with your configuration using
filter.getParameters().fromString(...String loaded from your params file)
- Creates a RawDocument instance (basically a wrapper around a File) and pass it to filter.open()
- Create a net.sf.okapi.filters.xliff2.XLIFF2FilterWriter that is writing out to a stream/file/whatever.
- Use the ITSFilter like an iterator to get back a filtered events stream. These can be passed directly to the handleEvent() method of your XLIFF2FilterWriter.
This should produce an XLIFF 2.0 file for you.
It's also possible to do this in Rainbow without doing any coding at all, although if you're embedding this in another app, that probably isn't easier. (Tikal can also do this, except that it only writes to xliff 1.2, not xliff 2.0).
ct