Package org.infoset.xml.sax

Examples of org.infoset.xml.sax.SAXDocumentLoader.load()


  
   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());
      }
     
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(AdminXML.NM_SERVER)) {
         throw new XMLException("Expecting "+AdminXML.NM_SERVER+" but found "+top.getName());
      }
      String value = top.getAttributeValue("autoconf-check");
View Full Code Here

         charset = "UTF-8";
      }
      try {
         DocumentLoader loader = new SAXDocumentLoader();
         Reader r = new InputStreamReader(entity.getStream(),charset);
         Document doc = loader.load(r);
         r.close();
        
         // Find the entry
        
         try {
View Full Code Here

      }
      Document doc = null;
      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

                  progress.status = appResponse.getStatus().getCode();
               } else {
                  try {
                     Reader r = appResponse.getEntity().getReader();
                     DocumentLoader loader = new SAXDocumentLoader();
                     Document entryDoc = loader.load(r);
                     Entry entry = new Entry(entryDoc);
                     entry.index();
                     progress.entryId = entry.getId();
                     progress.status = appResponse.getStatus().getCode();
                     getLogger().info("Entry: "+progress.entryId+", status="+progress.status);
View Full Code Here

      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

   }
   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

            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

         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

         // 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

TOP
Copyright © 2018 www.massapi.com. 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.