Package org.infoset.xml

Examples of org.infoset.xml.Document


         // 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
         Element edited = doc.getDocumentElement().getFirstElementNamed(AtomResource.EDITED_NAME);
         if (edited!=null) {
            edited.clear();
            edited.addCharacters(toXSDDate(date));
         }
        
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
         Element edited = doc.getDocumentElement().getFirstElementNamed(AtomResource.EDITED_NAME);
         if (edited!=null) {
            edited.clear();
            edited.addCharacters(toXSDDate(date));
         }
         Element content = doc.getDocumentElement().getFirstElementNamed(AtomResource.CONTENT_NAME);
         content.setAttributeValue("src",slug);
        
         Iterator<Element> links = doc.getDocumentElement().getElementsByName(AtomResource.LINK_NAME);
         while (links.hasNext()) {
            Element link = links.next();
            if ("edit-media".equals(link.getAttributeValue("rel"))) {
               link.setAttributeValue("href", slug);
            }
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");
      if (value!=null) {
View Full Code Here

TOP

Related Classes of org.infoset.xml.Document

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.