class XmlOutputMeta extends BaseTransformMeta implements ITransformMeta<XmlOutput, XmlOutputData> {

  @Override public void loadXml( Node transformNode, IHopMetadataProvider metadataProvider ) throws HopXmlException {
    try {
      setEncoding( XmlHandler.getTagValue( transformNode, "encoding" ) );
      setNameSpace( XmlHandler.getTagValue( transformNode, "name_space" ) );
      setMainElement( XmlHandler.getTagValue( transformNode, "xml_main_element" ) );
      setRepeatElement( XmlHandler.getTagValue( transformNode, "xml_repeat_element" ) );

      setFileName( XmlHandler.getTagValue( transformNode, "file", "name" ) );
      setExtension( XmlHandler.getTagValue( transformNode, "file", "extention" ) );
      setServletOutput( "Y".equalsIgnoreCase( XmlHandler.getTagValue( transformNode, "file", "servlet_output" ) ) );

      setDoNotOpenNewFileInit( "Y".equalsIgnoreCase( XmlHandler.getTagValue( transformNode, "file",
        "do_not_open_newfile_init" ) ) );
      setTransformNrInFilename( "Y".equalsIgnoreCase( XmlHandler.getTagValue( transformNode, "file", "split" ) ) );
      setDateInFilename( "Y".equalsIgnoreCase( XmlHandler.getTagValue( transformNode, "file", "add_date" ) ) );
      setTimeInFilename( "Y".equalsIgnoreCase( XmlHandler.getTagValue( transformNode, "file", "add_time" ) ) );
      setSpecifyFormat( "Y".equalsIgnoreCase( XmlHandler.getTagValue( transformNode, "file", "SpecifyFormat" ) ) );
      setOmitNullValues( "Y".equalsIgnoreCase( XmlHandler.getTagValue( transformNode, "file", "omit_null_values" ) ) );
      setDateTimeFormat( XmlHandler.getTagValue( transformNode, "file", "date_time_format" ) );

      setAddToResultFiles( "Y".equalsIgnoreCase( XmlHandler.getTagValue( transformNode, "file", "add_to_result_filenames" ) ) );

      setZipped( "Y".equalsIgnoreCase( XmlHandler.getTagValue( transformNode, "file", "zipped" ) ) );
      setSplitEvery( Const.toInt( XmlHandler.getTagValue( transformNode, "file", "splitevery" ), 0 ) );

      Node fields = XmlHandler.getSubNode( transformNode, "fields" );
      int nrfields = XmlHandler.countNodes( fields, "field" );

      allocate( nrfields );

      for ( int i = 0; i < nrfields; i++ ) {
        Node fnode = XmlHandler.getSubNodeByNr( fields, "field", i );

        outputFields[ i ] = new XmlField();
        String contentTypeString =
          Const.NVL( XmlHandler.getTagValue( fnode, "content_type" ), ContentType.Element.name() );
        outputFields[ i ].setContentType( ContentType.valueOf( contentTypeString ) );
        String fieldName = XmlHandler.getTagValue( fnode, "name" );
        outputFields[ i ].setFieldName( fieldName );
        String elementName = XmlHandler.getTagValue( fnode, "element" );
        outputFields[ i ].setElementName( elementName == null ? "" : elementName );
        outputFields[ i ].setType( XmlHandler.getTagValue( fnode, "type" ) );
        outputFields[ i ].setFormat( XmlHandler.getTagValue( fnode, "format" ) );
        outputFields[ i ].setCurrencySymbol( XmlHandler.getTagValue( fnode, "currency" ) );
        outputFields[ i ].setDecimalSymbol( XmlHandler.getTagValue( fnode, "decimal" ) );
        outputFields[ i ].setGroupingSymbol( XmlHandler.getTagValue( fnode, "group" ) );
        outputFields[ i ].setNullString( XmlHandler.getTagValue( fnode, "nullif" ) );
        outputFields[ i ].setLength( Const.toInt( XmlHandler.getTagValue( fnode, "length" ), -1 ) );
        outputFields[ i ].setPrecision( Const.toInt( XmlHandler.getTagValue( fnode, "precision" ), -1 ) );
      }
    } catch ( Exception e ) {
      throw new HopXmlException( "Unable to load step info from XML", e );
    }
  }

  public  XmlOutputMeta();

}