Package org.infoset.xml

Examples of org.infoset.xml.Element.addCharacters()


            log.info("Creating feed "+target.feed);
            try {
               Document doc = InfosetFactory.getDefaultInfoset().createItemConstructor().createDocument();
               Element feed = doc.createDocumentElement(FeedClient.FEED_NAME);
               Element title = feed.addElement(FeedClient.TITLE_NAME);
               title.addCharacters(target.dir.getName());
               Status status = feedClient.create(doc);
               if (!status.isSuccess()) {
                  log.log(Level.SEVERE,"Cannot create feed "+target.feed+" due to error "+status.getCode());
                  continue;
               }
View Full Code Here


                  toRemove.add(e);
               }
            } else if (e.getName().equals(UPDATED_NAME)) {
               modifiedDone = true;
               e.clear();
               e.addCharacters(toXSDDate(modified));
            } else if (e.getName().equals(ENTRY_NAME)) {
               toRemove.add(e);
            }
         }
      }
View Full Code Here

         if (c instanceof Element) {
            Element e = (Element)c;
            if (e.getName().equals(ID_NAME)) {
               idDone = true;
               e.clear();
               e.addCharacters("urn:uuid:"+id.toString());
            } else if (e.getName().equals(PUBLISHED_NAME) && created!=null) {
               createdDone = true;
               /*
               e.clear();
               e.addCharacters(toXSDDate(created));
View Full Code Here

               modifiedDone = true;
            } else if (e.getName().equals(EDITED_NAME)) {
               editedDone = true;
               e.clear();
               e.setPrefix("app");
               e.addCharacters(toXSDDate(modified));
            } else if (e.getName().equals(AUTHOR_NAME)) {
               author = e;
            } else if (e.getName().equals(LINK_NAME)) {
               String rel = e.getAttributeValue("rel");
               if ("edit".equals(rel)) {
View Full Code Here

      if (!modifiedDone) {
         entry.addElement(0,UPDATED_NAME).addCharacters(toXSDDate(modified));
      }
      if (!editedDone) {
         Element e = entry.addElement(0,EDITED_NAME);
         e.addCharacters(toXSDDate(modified));
         e.setPrefix("app");
      }
      if (!createdDone && created!=null) {
         entry.addElement(0,PUBLISHED_NAME).addCharacters(toXSDDate(created));
      }
View Full Code Here

         } else {
            idE = doc.getDocumentElement().addElement(0,XML.ID_NAME);
         }
      }
      idE.clear();
      idE.addCharacters(uri);
   }
  
   public String getTitle() {
      Element titleE = doc.getDocumentElement().getFirstElementNamed(XML.TITLE_NAME);
      return titleE==null ? null : titleE.getText();
View Full Code Here

         } else {
            titleE = doc.getDocumentElement().addElement(0,XML.TITLE_NAME);
         }
      }
      titleE.clear();
      titleE.addCharacters(text);
   }
  
   public String getSummary() {
      Element summaryE = doc.getDocumentElement().getFirstElementNamed(XML.SUMMARY_NAME);
      return summaryE==null ? null : summaryE.getText();
View Full Code Here

         } else {
            summaryE = doc.getDocumentElement().addElement(0,XML.SUMMARY_NAME);
         }
      }
      summaryE.clear();
      summaryE.addCharacters(text);
   }

   public Map<URI,Term> getTerms() {
      return terms==null ? null : Collections.unmodifiableMap(terms);
   }
View Full Code Here

      Element dateE = doc.getDocumentElement().getFirstElementNamed(XML.UPDATED_NAME);
      if (dateE==null) {
         dateE = doc.getDocumentElement().addElement(XML.UPDATED_NAME);
      }
      dateE.clear();
      dateE.addCharacters(toXSDDate(date));
   }
  
   public Date getPublished()
      throws ParseException
   {
View Full Code Here

      Element dateE = doc.getDocumentElement().getFirstElementNamed(XML.PUBLISHED_NAME);
      if (dateE==null) {
         dateE = doc.getDocumentElement().addElement(XML.PUBLISHED_NAME);
      }
      dateE.clear();
      dateE.addCharacters(toXSDDate(date));
   }
  
   public Date getEdited()
      throws ParseException
   {
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.