com.g11ntoolkit.xliffutil
Class applyXliff

java.lang.Object
  |
  +--com.g11ntoolkit.xliffutil.mergeXliff
        |
        +--com.g11ntoolkit.xliffutil.applyXliff

public class applyXliff
extends mergeXliff

Merge NXL and XL xliff files

Version:
$Revision: 1.11 $ $Date: 2005/08/05 00:49:01 $
Copyright © 2005, webMethods, Inc. All rights reserved.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

See License Agreement.

Author:
Masahiko Mori
See Also:
org.w3c.dom

Field Summary
protected  boolean _applyTarget
           
protected  java.lang.String _matchMode
           
protected  boolean _removeEmptyElm
           
static java.lang.String MATCHED_100
          100% match.
static java.lang.String MATCHED_COL
          line # isn't match.
static java.lang.String MATCHED_FILE
          x-key isn't match.
static java.lang.String MATCHED_NEW
          unmatch.
static java.lang.String MATCHED_STRING
          file name isn't match.
 
Fields inherited from class com.g11ntoolkit.xliffutil.mergeXliff
_DBG, _listener, _turnOnApproved
 
Constructor Summary
applyXliff()
          Create a new applyXliff.
 
Method Summary
protected  void addAltTrans(org.w3c.dom.Element dest, org.w3c.dom.Element src, java.lang.String match)
          Add alt-trans element
private  void addProp(org.w3c.dom.Element e, java.lang.String name, java.lang.String val)
          Add property element
 void apply(org.w3c.dom.Document in1, org.w3c.dom.Document in2)
          Merge 2nd document into 1st document.
 void apply(org.w3c.dom.Element file, org.w3c.dom.Node body)
          Merge 2nd document into 1st document.
 void apply(java.util.List in1, java.util.List in2)
          Merge 2nd document into 1st document.
static void main(java.lang.String[] args)
          Main
protected  org.w3c.dom.Node searchTU(org.w3c.dom.Node dest, org.w3c.dom.Node tu)
          Search TU from old document.
 void setTranslation(boolean b)
           
 
Methods inherited from class com.g11ntoolkit.xliffutil.mergeXliff
addNote, getDebugmode, getDestFile, getDestFile, merge, merge, merge, setDebugmode, setStatusListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_matchMode

protected java.lang.String _matchMode

MATCHED_100

public static final java.lang.String MATCHED_100
100% match.

See Also:
Constant Field Values

MATCHED_COL

public static final java.lang.String MATCHED_COL
line # isn't match.

See Also:
Constant Field Values

MATCHED_FILE

public static final java.lang.String MATCHED_FILE
x-key isn't match.

See Also:
Constant Field Values

MATCHED_STRING

public static final java.lang.String MATCHED_STRING
file name isn't match.

See Also:
Constant Field Values

MATCHED_NEW

public static final java.lang.String MATCHED_NEW
unmatch.

See Also:
Constant Field Values

_applyTarget

protected boolean _applyTarget

_removeEmptyElm

protected boolean _removeEmptyElm
Constructor Detail

applyXliff

public applyXliff()
Create a new applyXliff.

Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Main

Parameters:
args - XML File name
java.lang.Exception

setTranslation

public void setTranslation(boolean b)
Parameters:
b - Set 100% match translation flag

apply

public void apply(org.w3c.dom.Document in1,
                  org.w3c.dom.Document in2)
Merge 2nd document into 1st document.

Parameters:
in1 - master Document class
in2 - slave Document class

apply

public void apply(java.util.List in1,
                  java.util.List in2)
Merge 2nd document into 1st document.

Parameters:
in1 - master List class which contains XLIFF file elements
in2 - slave List class which contains XLIFF file elements

apply

public void apply(org.w3c.dom.Element file,
                  org.w3c.dom.Node body)
Merge 2nd document into 1st document.

Parameters:
file - file node of new XLIFF file
body - body node of old XLIFF file

searchTU

protected org.w3c.dom.Node searchTU(org.w3c.dom.Node dest,
                                    org.w3c.dom.Node tu)
Search TU from old document.

Parameters:
dest - file element of old XLIFF file
tu - TU element of new XLIFF file
Returns:
Matched old TU element

addAltTrans

protected void addAltTrans(org.w3c.dom.Element dest,
                           org.w3c.dom.Element src,
                           java.lang.String match)
                    throws javax.xml.transform.TransformerException
Add alt-trans element

Parameters:
dest - TU element of new XLIFF file
src - TU element of old XLIFF file
match - Match quality string
javax.xml.transform.TransformerException

addProp

private void addProp(org.w3c.dom.Element e,
                     java.lang.String name,
                     java.lang.String val)
Add property element

Parameters:
e - TU element of new XLIFF file
name - Property name
val - Property value