Package org.infoset.xml

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


      Element dateE = doc.getDocumentElement().getFirstElementNamed(XML.EDITED_NAME);
      if (dateE==null) {
         dateE = doc.getDocumentElement().addElement(XML.EDITED_NAME);
      }
      dateE.clear();
      dateE.addCharacters(toXSDDate(date));
   }
  
   public void update() {
      Element entryE = doc.getDocumentElement();
      Iterator<Element> categories = entryE.getElementsByName(XML.CATEGORY_NAME);
View Full Code Here


               Element categoryE = idPos<0 ? entryE.addElement(XML.CATEGORY_NAME) : entryE.addElement(idPos,XML.CATEGORY_NAME);
               if (scheme!=null) {
                  categoryE.setAttributeValue("scheme",scheme);
               }
               categoryE.setAttributeValue("term",name);
               categoryE.addCharacters(value);
            }
         } else {
            Element categoryE = idPos<0 ? entryE.addElement(XML.CATEGORY_NAME) : entryE.addElement(idPos,XML.CATEGORY_NAME);
            if (scheme!=null) {
               categoryE.setAttributeValue("scheme",scheme);
View Full Code Here

      top.addElement(ID_NAME).addCharacters("urn:uuid:"+id.toString());
      String dateString = toXSDDate(created);
      top.addElement(PUBLISHED_NAME).addCharacters(dateString);
      top.addElement(UPDATED_NAME).addCharacters(dateString);
      Element edited = top.addElement(EDITED_NAME);
      edited.addCharacters(dateString);
      edited.setPrefix("app");
      Element link = top.addElement(LINK_NAME);
      link.setAttributeValue("rel","edit");
      link.setAttributeValue("href","./_/"+id);
      if (authorName!=null) {
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

      throws IOException,XMLException
   {
      File dbConf = new File(dir,"db.conf");
      Document doc = InfosetFactory.getDefaultInfoset().createItemConstructor().createDocument();
      Element top = doc.createDocumentElement(AdminXML.NM_DATABASES);
      top.addCharacters("\n");
      for (DB db : dbList.values()) {
         Element database = top.addElement(AdminXML.NM_DATABASE);
         File compDir = new File(dir,db.getName());
         if (compDir.getCanonicalPath().equals(db.getDatabaseDir().getCanonicalPath())) {
            db.getDatabaseDir();
View Full Code Here

        
         // change the entry's edited element
         Element edited = doc.getDocumentElement().getFirstElementNamed(AtomResource.EDITED_NAME);
         if (edited!=null) {
            edited.clear();
            edited.addCharacters(toXSDDate(date));
         }
        
         // store the change.
         status = storage.storeEntry(feed.getPath(),feed.getUUID(),entry.getUUID(),doc);
         if (status.isSuccess()) {
View Full Code Here

        
         // 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);
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.