Package org.infoset.xml

Examples of org.infoset.xml.DocumentLoader


      throws ConfigurationException
   {
      Map<String,DB> dbList = new HashMap<String,DB>();
      File dbConf = new File(dir,"db.conf");
      if (dbConf.exists()) {
         DocumentLoader loader = new SAXDocumentLoader();
         try {
            Document doc =loader.load(dbConf.toURI());
            Iterator<Element> databases = doc.getDocumentElement().getElementsByName(AdminXML.NM_DATABASE);
            while (databases.hasNext()) {
               Element databaseE = databases.next();
               URI href = databaseE.getBaseURI().resolve(databaseE.getAttributeValue("href"));
               if (!href.getScheme().equals("file")) {
View Full Code Here


            // avoid thread creation because reading an output representation requires a thread
            StringWriter sw = new StringWriter();
            rep.write(sw);
            rep.release();
            DocumentLoader loader = new SAXDocumentLoader();
            loader.generate(new StringReader(sw.toString()), new RemoveDocumentFilter(dest));

         }
      } catch (Exception ex) {
         throw new XMLException("Exception while getting ancestors.",ex);
      }
View Full Code Here

         // Should be an entry
         Document doc = null;
         if (entity instanceof InfosetRepresentation) {
            doc = ((InfosetRepresentation)entity).getDocument();
         } else {
            DocumentLoader loader = new SAXDocumentLoader();
            try {
               Reader r = new InputStreamReader(entity.getStream(),charset);
               doc = loader.load(r);
               r.close();
            } catch (IOException ex) {
               getResponse().setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
               return new StringRepresentation("I/O error while parsing document: "+ex.getMessage());
            } catch (XMLException ex) {
View Full Code Here

      String charset = entity.getMediaType().getParameters().getValues("charset");
      if (charset==null) {
         charset = "UTF-8";
      }
      try {
         DocumentLoader loader = new SAXDocumentLoader();
         Reader r = new InputStreamReader(entity.getStream(),charset);
         Document doc = loader.load(r);
         r.close();
        
         try {
            app.updateFeed(feed,doc);
            getResponse().setStatus(Status.SUCCESS_NO_CONTENT);
View Full Code Here

         Representation entryRep = app.getEntryRepresentation(feedBaseURI,feed,entry.getUUID());
         // avoid a thread with the entry's output representation
         StringWriter sw = new StringWriter();
         entryRep.write(sw);
         entryRep.release();
         DocumentLoader loader = new SAXDocumentLoader();
         Document doc = loader.load(new StringReader(sw.toString()));
        
         // mark the entry as edited
         Date date = media.getEntry().edited();
        
         // change the entry's edited element
View Full Code Here

         Representation entryRep = app.getEntryRepresentation(feedBaseURI,feed,entry.getUUID());
         // avoid a thread with the entry's output representation
         StringWriter sw = new StringWriter();
         entryRep.write(sw);
         entryRep.release();
         DocumentLoader loader = new SAXDocumentLoader();
         Document doc = loader.load(new StringReader(sw.toString()));
        
         // mark the entry as edited
         Date date = media.getEntry().edited();
        
         // change the entry's edited element
View Full Code Here

     
   }
   public void load(URI location)
      throws IOException,XMLException
   {
      DocumentLoader loader = new SAXDocumentLoader();
      Document doc = loader.load(location);
      Element top = doc.getDocumentElement();
      if (!top.getName().equals(SERVER)) {
         throw new XMLException("Expecting "+SERVER+" but found "+top.getName());
      }
      String value = top.getAttributeValue("autoconf-check");
View Full Code Here

TOP

Related Classes of org.infoset.xml.DocumentLoader

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.