Exemplo n.º 1
0
 /* (non-Javadoc)
  * @see org.xml.sax.helpers.DefaultHandler#startDocument()
  */
 @Override
 public void startDocument() throws SAXException {
   super.startDocument();
   for (DefaultHandler delegate : delegates) {
     delegate.startDocument();
   }
 }
Exemplo n.º 2
0
 @Override
 public void startDocument() throws SAXException {
   super.startDocument();
   catTree = new CategoryTree("root");
   partiesList = new ArrayList<>();
   builder = new StringBuilder();
 }
Exemplo n.º 3
0
  @Override
  public void startDocument() throws SAXException {

    super.startDocument();

    noticias = new ArrayList<Noticia>();
    sbTexto = new StringBuilder();
  }
Exemplo n.º 4
0
  @Override
  public void startDocument() throws SAXException {

    super.startDocument();

    dXML = new ArrayList<Dictionary<String, String>>();

    sbItem = new StringBuilder();
  }
Exemplo n.º 5
0
  // * Cette méthode est appelée par le parser une et une seule
  // * fois au démarrage de l'analyse de votre flux xml.
  // * Elle est appelée avant toutes les autres méthodes de l'interface,
  // * à l'exception unique, évidemment, de la méthode setDocumentLocator.
  // * Cet événement devrait vous permettre d'initialiser tout ce qui doit
  // * l'être avant ledébut du parcours du document.
  @Override
  public void startDocument() throws SAXException {
    super.startDocument();
    solcities = new ArrayList();
    currentCity = new City();

    inSolCities = false;
    inSolMe = false;
    inTopCities = false;
  }
Exemplo n.º 6
0
 @Override
 public void startDocument() throws SAXException {
   super.startDocument();
   this.mPOIs = new ArrayList<ORSPOI>();
 }
Exemplo n.º 7
0
 @Override
 public void startDocument() throws SAXException {
   super.startDocument();
   databaseHandler = DatabaseHandler.getInstance();
 }
Exemplo n.º 8
0
 @Override
 public void startDocument() throws SAXException {
   super.startDocument();
   mapTable = new HashMap<String, String>();
 }
Exemplo n.º 9
0
 @Override
 public void startDocument() throws SAXException {
   // TODO Auto-generated method stub
   super.startDocument();
 }
 @Override
 public void startDocument() throws SAXException {
   super.startDocument();
   alertes = new ArrayList<Alert>();
   contenu = new StringBuilder();
 }
Exemplo n.º 11
0
 @Override
 public void startDocument() throws SAXException {
   super.startDocument();
   books = new ArrayList<Weather>();
   builder = new StringBuilder();
 }
Exemplo n.º 12
0
  /*
   * Actual implementation of the rendering process. When a function in this
   * module is called, this method is executed with the given inputs. @param
   * Sequence[] args (XSL-FO, mime-type, parameters) @param Sequence
   * contextSequence (default sequence)
   *
   * @see org.exist.xquery.BasicFunction#eval(org.exist.xquery.value.Sequence[],
   *      org.exist.xquery.value.Sequence)
   */
  public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
    // gather input XSL-FO document
    // if no input document (empty), return empty result as we need data to
    // process
    if (args[0].isEmpty()) return Sequence.EMPTY_SEQUENCE;
    Item inputNode = args[0].itemAt(0);

    // get mime-type
    String mimeType = args[1].getStringValue();

    // get parameters
    Properties parameters = new Properties();
    if (!args[2].isEmpty()) {
      parameters = ModuleUtils.parseParameters(((NodeValue) args[2].itemAt(0)).getNode());
    }

    try {
      // setup a transformer handler
      TransformerHandler handler =
          TransformerFactoryAllocator.getTransformerFactory(context.getBroker())
              .newTransformerHandler();
      Transformer transformer = handler.getTransformer();

      // set the parameters if any
      if (parameters.size() > 0) {
        Enumeration keys = parameters.keys();
        while (keys.hasMoreElements()) {
          String name = (String) keys.nextElement();
          String value = parameters.getProperty(name);
          transformer.setParameter(name, value);
        }
      }

      // setup the FopFactory
      FopFactory fopFactory = FopFactory.newInstance();
      if (args.length == 4 && args[3] != null && !args[3].isEmpty()) {
        FopConfigurationBuilder cfgBuilder = new FopConfigurationBuilder(context.getBroker());
        Configuration cfg = cfgBuilder.buildFromItem(args[3].itemAt(0));
        fopFactory.setUserConfig(cfg);
      }

      // setup the foUserAgent, using given parameters held in the
      // transformer handler
      FOUserAgent foUserAgent =
          setupFOUserAgent(fopFactory.newFOUserAgent(), parameters, transformer);

      // create new instance of FOP using the mimetype, the created user
      // agent, and the output stream
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      Fop fop = fopFactory.newFop(mimeType, foUserAgent, baos);

      // Obtain FOP's DefaultHandler
      DefaultHandler dh = fop.getDefaultHandler();

      // process the XSL-FO
      dh.startDocument();
      inputNode.toSAX(context.getBroker(), dh, new Properties());
      dh.endDocument();

      // return the result
      return new Base64Binary(baos.toByteArray());
    } catch (TransformerException te) {
      throw new XPathException(te);
    } catch (SAXException se) {
      throw new XPathException(se);
    }
  }
Exemplo n.º 13
0
 @Override
 public void startDocument() throws SAXException {
   super.startDocument();
   mLyricIds.clear();
 }
 @Override
 public void startDocument() throws SAXException {
   this.nsSpec = null;
   this.start = true;
   super.startDocument();
 }
Exemplo n.º 15
0
 /** 用来标识解析开始 */
 @Override
 public void startDocument() throws SAXException {
   super.startDocument();
   System.out.println("SAX解析开始");
 }
 @Override
 public void startDocument() throws SAXException {
   super.startDocument();
   Log.i("YAHOO SAXPARSER", "Start document");
 }
Exemplo n.º 17
0
 @Override
 public void startDocument() throws SAXException {
   super.startDocument();
   fields = new ArrayList<Field>();
 }
Exemplo n.º 18
0
 @Override
 public void startDocument() throws SAXException {
   super.startDocument();
   emojis = new ArrayList<ChatEmoji>();
   builder = new StringBuilder();
 }
Exemplo n.º 19
0
 @Override
 public void startDocument() throws SAXException {
   super.startDocument();
 }
Exemplo n.º 20
0
 @Override
 public void startDocument() throws SAXException {
   super.startDocument();
   mFeeds = new ArrayList<Feed>();
   mBuilder = new StringBuilder();
 }
 @Override
 public void startDocument() throws SAXException {
   super.startDocument();
   stories = new ArrayList<NewsStory>();
   xmlInnerText = new StringBuilder();
 }
Exemplo n.º 22
0
 @Override
 public void startDocument() throws SAXException {
   super.startDocument();
   mContentList = new ArrayList<Item>();
   Logger.w(TAG, "startDocument()");
 }