Package net.n3.nanoxml

Examples of net.n3.nanoxml.IXMLElement


    static void setPrices(Connection c, String ansPricesDiscounts) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException, XMLException {
        System.out.println("[" + Shared.now() + "] Driver de conexiones " + Shared.lineNumber() " Fijar precios");
        IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
        IXMLReader reader = StdXMLReader.stringReader(ansPricesDiscounts);
        parser.setReader(reader);
        IXMLElement xml = (IXMLElement) parser.parse();

        PreparedStatement stmtUpdate = c.prepareStatement("update articulo set descuento = ? where codigo = ? ");
        PreparedStatement stmtDelete = c.prepareStatement("delete from precio where codigo_de_articulo = ? and fecha = curdate() ");
        PreparedStatement stmtInsert = c.prepareStatement("insert into precio ( codigo_de_articulo , monto , fecha ) values ( ? , ? , curdate() ) ");
        PreparedStatement stmtItem = c.prepareStatement("select codigo from articulo where codigo = ?");
       
        XMLElement xmlI = null;
        Double dis = null;
        String disS = null;
        parser = null;
        reader = null;
        System.out.println("Comenzo a fijar los descuentos...");
        ResultSet rs = null;
        for (Object x : xml.getChildren()) {

            xmlI = (XMLElement)x;

            if ( xmlI.getAttribute("KONWA","").equals("%") ) {
                dis = -1*Double.parseDouble(xmlI.getAttribute("KBETR",""))/10;
 
View Full Code Here


        Shared.itemsNeeded = new LinkedList<XMLElement>();

        IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
        IXMLReader reader = StdXMLReader.stringReader(xmlMovement);
        parser.setReader(reader);
        IXMLElement xml = (IXMLElement) parser.parse();

        System.out.println(xml.getName());
        String lastMovement = null;

        PreparedStatement stmtDetailsMovements = c.prepareStatement("insert into detalles_movimientos"
                    + "(identificador_movimiento,codigo_articulo,cantidad_articulo,tipo) values ( concat(curdate(),\'-II\') , ? , ? , ? )");

        PreparedStatement stmtInsert = c.prepareStatement("insert ignore into movimiento_inventario (identificador , fecha , descripcion , codigo , almacen ) "
                    + "values (concat(curdate(),\'-II\') , now() , 'Stock Inicial' , concat(curdate(),\'-II\') , '')");
        stmtInsert.executeUpdate();

        PreparedStatement stmtItem = c.prepareStatement("insert ignore into articulo ( codigo , descripcion , fecha_registro , "
                    + "codigo_de_barras , modelo , unidad_venta, "
                    + "existencia_actual, bloqueado, imagen, descuento ) values (?,?,now(),?,?,?,0,0,?,?)");

        PreparedStatement stmtUpdateItem = c.prepareStatement("update articulo set descripcion = ?  , "
                    + "codigo_de_barras = ? , modelo = ? , unidad_venta = ? , "
                    + " descuento  = ? where codigo = ?");

        PreparedStatement stmtBarcode = c.prepareStatement("insert IGNORE into codigo_de_barras(codigo_de_articulo,codigo_de_barras) values(?,?)");

        PreparedStatement stmtMI = c.prepareStatement("insert into configuracion (`Key` , `Value` , nombre ) "
                + "values ( ?, ?, ?)");

        PreparedStatement stmtDeletePrice = c.prepareStatement("delete from precio where codigo_de_articulo = ? and fecha = curdate() ");
        PreparedStatement stmtInsertPrice = c.prepareStatement("insert into precio ( codigo_de_articulo , monto , fecha ) values ( ? , ? , curdate() ) ");

        for (Object x : xml.getChildren()) {
            XMLElement xmlI = (XMLElement)x;

            stmtUpdateItem.setString(1, xmlI.getAttribute("MAKTG",""));
            stmtUpdateItem.setString(2, xmlI.getAttribute("EAN11",""));
            stmtUpdateItem.setString(3, xmlI.getAttribute("MATKL",""));
View Full Code Here

        c.setAutoCommit(false);

        IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
        IXMLReader reader = StdXMLReader.stringReader(xmlEmployees);
        parser.setReader(reader);
        IXMLElement xml = (IXMLElement) parser.parse();

        PreparedStatement stmt = c.prepareStatement("truncate empleado");
        stmt.executeUpdate();
        for (Object x : xml.getChildren()) {
            XMLElement xmlI = (XMLElement)x;

            stmt = c.prepareStatement("insert into empleado (codigo,nombre_completo, departamento) values(?,?,?)");
            stmt.setString(1, xmlI.getAttribute("c",""));
            stmt.setString(2, xmlI.getAttribute("n",""));
View Full Code Here

       
        System.out.println("[" + Shared.now() + "] Driver de conexiones " + Shared.lineNumber() " updateFlagc ");
        IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
        IXMLReader reader = StdXMLReader.stringReader(daysFlagc);
        parser.setReader(reader);
        IXMLElement xml = (IXMLElement) parser.parse();

        PreparedStatement stmt = c.prepareStatement("update dia_operativo set compensado = 1 where concat(mid(fecha,1,4),mid(fecha,6,2),mid(fecha,9,2)) = ?");
        for (Object x : xml.getChildren()) {
            stmt.setString(1, ((XMLElement)x).getContent());
            stmt.executeUpdate();
        }
    }
View Full Code Here

        System.out.println("[" + Shared.now() + "] Driver de conexiones " + Shared.lineNumber() " updateItems");
        IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
        IXMLReader reader = StdXMLReader.stringReader(descriptions);
        parser.setReader(reader);
        System.out.println("Recibido " + descriptions);
        IXMLElement xml = (IXMLElement) parser.parse();

        parser = null;
        reader = null;

        System.out.println("[" + Shared.now() + "] Driver de conexiones " + Shared.lineNumber() " Justo antes de actualizar los articulos...");
        PreparedStatement stmtItem = c.prepareStatement("update articulo set descripcion = ? , "
                    + "codigo_de_barras = ? , modelo = ? , unidad_venta = ? "
                    + " where codigo = ?");
        PreparedStatement stmtBarcode = c.prepareStatement("update codigo_de_barras set codigo_de_barras = ? where codigo_de_articulo = ?");

        XMLElement xmlI = null;
        for (Object x : xml.getChildren()) {
            xmlI = (XMLElement)x;
            stmtItem.setString(1, xmlI.getAttribute("MAKTG",""));
            stmtItem.setString(2, xmlI.getAttribute("EAN11",""));
            stmtItem.setString(3, xmlI.getAttribute("MATKL",""));
            stmtItem.setString(4, xmlI.getAttribute("MSEH3",""));
View Full Code Here

      String encoding = settings.getString("moneyplex.encoding","ISO-8859-1");
      Logger.info("moneyplex encoding: " + encoding);
      IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
      parser.setReader(new StdXMLReader(new InputStreamReader(is,encoding)));
      IXMLElement root = (IXMLElement) parser.parse();
      Vector<IXMLElement> lines = root.getChildrenNamed("BUCHUNG");
     
      if (lines == null || lines.size() == 0)
        throw new ApplicationException(i18n.tr("Datei enth�lt keine Buchungen"));
     
      double factor = 100d / (double) lines.size();
View Full Code Here

    umsatz.setKonto(konto);
    umsatz.setDatum(datum);
    umsatz.setValuta(valuta);
   
    IXMLElement empfaenger = line.getFirstChildNamed("EMPFAENGER");
    if (empfaenger != null)
      umsatz.setGegenkontoName(getContent(empfaenger.getFirstChildNamed("NAME")));
    //
    ////////////////////////////////////////////////////////////////////////////
   
    // Checken, ob es eine Split-Buchung ist.
    IXMLElement split = line.getFirstChildNamed("SPLITT");
    if (split != null)
    {
      // Jepp, ist eine Splitt-Buchung. Dann duplizieren wir die Buchung anhand
      // der Anzahl von Splits
      Vector<IXMLElement> parts = split.getChildrenNamed("PART");
      if (parts == null || parts.size() == 0)
        throw new ApplicationException("Split-Auftrag ohne enthaltene Buchungen");
      for (IXMLElement p:parts)
      {
        Umsatz copy = umsatz.duplicate();
View Full Code Here

   * @param name The name of the new element
   * @return The created XmlElement
   */
  public XmlElement createElement( String name )
  {
    IXMLElement ele = element.createElement( name );
    return new NanoXmlElement( ele );
  }
View Full Code Here

   * @return The first instance of an XmlElement found at the specified path of
   * the implementing object
   */
  public XmlElement getFirstChildNamed( String name )
  {
    IXMLElement ele = element.getFirstChildNamed( name );

    return ele == null ? null : new NanoXmlElement( ele );
  }
View Full Code Here

   * read
   * @return The root XmlElement resulting from the parsing of the XML
   */
  public XmlElement parse( Reader input )
  {
    IXMLElement xml = null;
    try {
      IXMLParser parser = new StdXMLParser();
      parser.setBuilder( new StdXMLBuilder() );
      parser.setValidator( new NonValidator() );

View Full Code Here

TOP

Related Classes of net.n3.nanoxml.IXMLElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.