Package net.n3.nanoxml

Examples of net.n3.nanoxml.IXMLParser


  {
    BufferedOutputStream os =
      new BufferedOutputStream(new FileOutputStream(file));
    try
    {
      XMLWriter wtr = new XMLWriter(os);
      wtr.write(_rootElement, true);
    }
    finally
    {
      os.close();
    }
View Full Code Here


        IXMLElement root = new XMLElement(WebDAVConstants.PROPFIND_ELEM, WebDAVConstants.XML_DAV_NAMESPACE);
        root.addChild(new XMLElement(WebDAVConstants.ALLPROP_ELEM));

        StringWriter xml = new StringWriter();
        XMLWriter writer = new XMLWriter(xml);
        writer.write(root);

        String str = WebDAVConstants.XML_TEMPLATE + "\r\n" + xml.toString(); //$NON-NLS-1$
        byte[] content = str.getBytes("UTF8"); //$NON-NLS-1$

        request.setHeaderField("Content-Length", String.valueOf(content.length)); //$NON-NLS-1$
View Full Code Here

       LogBuffer.println("Not printing config to file, file is null.");
       return;
     }
     try {
       OutputStream os = new FileOutputStream(file);
       XMLWriter w = new XMLWriter(os);
       w.write(root.root);
       changed = false;
       LogBuffer.println("Successfully stored config file " + file);
     } catch (Exception e) {
       LogBuffer.logException(e);
       System.out.println("Caught exception " + e);
View Full Code Here

    if (!configXml.exists()) {
      LogUtils.info(pathToFile + " does not exist yet");
      return;
    }
    try {
      final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
      inputStream = new BufferedInputStream(new FileInputStream(configXml));
      final IXMLReader reader = new StdXMLReader(inputStream);
      parser.setReader(reader);
      final XMLElement loader = (XMLElement) parser.parse();
      final Vector<XMLElement> formats = loader.getChildren();
      for (XMLElement elem : formats) {
        final String type = elem.getAttribute("type", null);
        final String style = elem.getAttribute("style", null);
        final String name = elem.getAttribute("name", null);
View Full Code Here

  void loadConditions(final DefaultComboBoxModel filterConditionModel, final String pathToFilterFile,
      final boolean showPopupOnError)
          throws IOException {
    try {
      final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
      File filterFile = new File(pathToFilterFile);
      final IXMLReader reader = new StdXMLReader(new BufferedInputStream(new FileInputStream(filterFile)));
      parser.setReader(reader);
      reader.setSystemID(filterFile.toURL().toString());
      final XMLElement loader = (XMLElement) parser.parse();
      final Vector<XMLElement> conditions = loader.getChildren();
      for (int i = 0; i < conditions.size(); i++) {
        final ASelectableCondition condition = getConditionFactory().loadCondition(conditions.get(i));
        if(condition != null){
          filterConditionModel.addElement(condition);
View Full Code Here

    File[] addonXmlFiles = addOnsDir.listFiles(new FilenameFilter() {
      public boolean accept(File dir, String name) {
        return name.endsWith(".plugin.xml");
      }
    });
    final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
    for (File file : addonXmlFiles) {
      BufferedInputStream inputStream = null;
      try {
        inputStream = new BufferedInputStream(new FileInputStream(file));
        final IXMLReader reader = new StdXMLReader(inputStream);
        parser.setReader(reader);
        registerInstalledAddOn(new AddOnProperties(AddOnType.PLUGIN, (XMLElement) parser.parse()));
      }
      catch (final Exception e) {
        LogUtils.warn("error parsing " + file, e);
      }
      finally {
View Full Code Here

  }
 
  private void createXSLTExportActions( final String xmlDescriptorFile) {
    InputStream xmlDescriptorStream = null;
    try {
      final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
      final URL resource = ResourceController.getResourceController().getResource(xmlDescriptorFile);
      xmlDescriptorStream = resource.openStream();
      final IXMLReader reader = new StdXMLReader(xmlDescriptorStream);
      parser.setReader(reader);
      final XMLElement xml = (XMLElement) parser.parse();
      final Enumeration<XMLElement> actionDescriptors = xml.enumerateChildren();
      while (actionDescriptors.hasMoreElements()) {
        final XMLElement descriptor = actionDescriptors.nextElement();
        final String name = descriptor.getAttribute("name", null);
        final XMLElement xmlProperties = descriptor.getFirstChildNamed("properties");
View Full Code Here

    if (!configXml.exists()) {
      LogUtils.info(pathToFile + " does not exist yet");
      return;
    }
    try {
      final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
      final IXMLReader reader = new StdXMLReader(new BufferedInputStream(new FileInputStream(configXml)));
      parser.setReader(reader);
      final XMLElement loader = (XMLElement) parser.parse();
      final Vector<XMLElement> scannerElements = loader.getChildren();
      for (XMLElement elem : scannerElements) {
        scanners.add(parseScanner(elem));
      }
      boolean haveDefault = false;
View Full Code Here

      @Override
            public boolean accept(File dir, String name) {
        return name.endsWith(".script.xml");
      }
    });
    final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
    for (File file : addonXmlFiles) {
      BufferedInputStream inputStream = null;
      try {
        inputStream = new BufferedInputStream(new FileInputStream(file));
        final IXMLReader reader = new StdXMLReader(inputStream);
        parser.setReader(reader);
        final ScriptAddOnProperties addOn = new ScriptAddOnProperties((XMLElement) parser.parse());
        addOn.setAddOnPropertiesFile(file);
        AddOnsController.getController().registerInstalledAddOn(addOn);
      }
      catch (final Exception e) {
        LogUtils.warn("error parsing " + file, e);
View Full Code Here

    String marshalled = ResourceController.getResourceController().getProperty(window_preference_storage_property);
    return unmarschall(marshalled, dialog);
  }
  protected XMLElement unmarschall(final String marshalled, final JDialog dialog) {
    if (marshalled != null) {
      final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
      final IXMLReader xmlReader = new StdXMLReader(new StringReader(marshalled));
      parser.setReader(xmlReader);
      try {
        final XMLElement storage = (XMLElement) parser.parse();
        if (storage != null) {
          x = Integer.parseInt(storage.getAttribute("x", "-1"));
          y = Integer.parseInt(storage.getAttribute("y", "-1"));
          width = Integer.parseInt(storage.getAttribute("width", "-1"));
          height = Integer.parseInt(storage.getAttribute("height", "-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.