Package net.n3.nanoxml

Examples of net.n3.nanoxml.IXMLParser


    protected static String createNewMovement(Connection c , String xmlMovement) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException, XMLException, IOException{

        System.out.println("[" + Shared.now() + "] Driver de conexiones " + Shared.lineNumber() " Crear movimiento");
        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());

        PreparedStatement stmtDetailsMovements = c.prepareStatement("insert into detalles_movimientos"
                    + "(identificador_movimiento,codigo_articulo,cantidad_articulo,tipo) values ( ? , ? , ? , ? )");
View Full Code Here


    }

    static void createItems(Connection c, String ansDescriptions, boolean checkReason) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException, XMLException {

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

        parser = null;
        reader = null;

        TreeSet<String> itemsNeededJustOnce = new TreeSet<String>();
View Full Code Here

        }
    }

    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 = ?");
View Full Code Here

    static String getInitialStock(Connection c, String xmlMovement) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException, XMLException, IOException{
        System.out.println("[" + Shared.now() + "] Driver de conexiones " + Shared.lineNumber() " Obtener stock inicial");
        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"
View Full Code Here

        Connection c = ConnectionDrivers.cpds.getConnection();

        System.out.println("[" + Shared.now() + "] Driver de conexiones " + Shared.lineNumber() " Actualizar lista de empleados");
        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;
View Full Code Here

    }

    static void updateFlagc(String daysFlagc, Connection c) throws ClassNotFoundException, InstantiationException, IllegalAccessException, XMLException, SQLException {
       
        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

    }

    static void updateItems(String descriptions, Connection c) throws ClassNotFoundException, InstantiationException, IllegalAccessException, XMLException, SQLException {
       
        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...");
View Full Code Here

      if (monitor != null)
        monitor.setStatusText(i18n.tr("Lese Datei ein"));

      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"));
     
View Full Code Here

   */
  public XmlElement parse( Reader input )
  {
    IXMLElement xml = null;
    try {
      IXMLParser parser = new StdXMLParser();
      parser.setBuilder( new StdXMLBuilder() );
      parser.setValidator( new NonValidator() );

      IXMLReader reader = new StdXMLReader( input );
      parser.setReader( reader );
      xml = ( IXMLElement )parser.parse();
    }
    catch ( Exception ex ) {
      if ( BuildProperties.DEBUG ) {
        DebugLogger.logError( "Unable to read/parse the xml: " + ex.getMessage());
        ex.printStackTrace();
View Full Code Here

            log.debug(new String(out.toByteArray()));
        // #endif

        try {
            IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
            IXMLReader reader = StdXMLReader.stringReader(new String(out.toByteArray(), "UTF8")); //$NON-NLS-1$
            parser.setReader(reader);
            IXMLElement rootElement = (IXMLElement) parser.parse();

            if (!rootElement.getName().equalsIgnoreCase("multistatus")) //$NON-NLS-1$
                throw new IOException(Messages.getString("MultiStatusResponse.invalidDavRootElement") + rootElement.getName()); //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of net.n3.nanoxml.IXMLParser

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.