Examples of DTDElement


Examples of com.hp.gloze.DTDElement

      bd.setValue(
        "content",
        new DTDSequence(
          new XMLBean[] {
            // optional annotation element
            new DTDElement(schema.XSD_URI, "annotation", "0", "1"),
            // many elements
            new DTDElement(schema.XSD_URI, "element", "0", "unbounded")}));
    } catch (Exception e) {
      Gloze.logger.error(e.getMessage());
    }
    return bd;
  }
View Full Code Here

Examples of com.hp.gloze.DTDElement

        try {
          bd
            .setValue(
              "content",
              new DTDSequence(new XMLBean[] {
                new DTDElement(schema.XSD_URI, "annotation", "0", "1"),
                new DTDChoice(
                  new XMLBean[] {
                    new DTDElement(schema.XSD_URI, "restriction"),
                    new DTDElement(schema.XSD_URI, "extension")},
                  "0",
                  "1")
            }));
        } catch (Exception e) {
          Gloze.logger.error(e.getMessage());
View Full Code Here

Examples of com.wutka.dtd.DTDElement

      DTDParser parser = new DTDParser(in);
      DTD dtd = parser.parse();
      Object[] obj = dtd.getItems();
      for(int i=0;i<obj.length;i++){
        if(obj[i] instanceof DTDElement){
          DTDElement element = (DTDElement)obj[i];
          String name = element.getName();
          DTDItem item = element.getContent();
          boolean hasBody = true;
          if(item instanceof DTDEmpty){
            hasBody = false;
          }
          TagInfo tagInfo = new TagInfo(name,hasBody);
          Iterator ite = element.attributes.keySet().iterator();
         
          // set child tags
          if(item instanceof DTDSequence){
            DTDSequence seq = (DTDSequence)item;
            setChildTagName(tagInfo,seq.getItem());
          } else if(item instanceof DTDMixed){
            // #PCDATA
          }
         
          while(ite.hasNext()){
            String attrName = (String)ite.next();
            DTDAttribute attr = element.getAttribute(attrName);
           
            DTDDecl decl = attr.getDecl();
            boolean required = false;
            if(decl == DTDDecl.REQUIRED){
              required = true;
View Full Code Here

Examples of com.wutka.dtd.DTDElement

              DTDParser parser = new DTDParser(reader);
              DTD dtd = parser.parse();
              Object[] obj = dtd.getItems();
              for(int i=0;i<obj.length;i++){
                if(obj[i] instanceof DTDElement){
                  DTDElement element = (DTDElement)obj[i];
                  String name = element.getName();
                  comboDocumentRoot.add(name);
                }
              }
              comboDocumentRoot.select(0);
            }
          }
          if(getUseXSD()){
            // Load elements from XML Schema
            comboDocumentRoot.removeAll();
            DTDResolver resolver = new DTDResolver(new IDTDResolver[0],
                page1.getFile().getLocation().makeAbsolute().toFile().getParentFile());
            InputStream in = resolver.getInputStream(getSchemaURI());
            if(in!=null){
              SchemaGrammar grammer = (SchemaGrammar)new XMLSchemaLoader().loadGrammar(
                  new XMLInputSource(null,null,null,in,null));
              XSNamedMap map = grammer.getComponents(XSConstants.ELEMENT_DECLARATION);
              for(int i=0;i<map.getLength();i++){
                XSElementDeclaration element = (XSElementDeclaration)map.item(i);
                comboDocumentRoot.add(element.getName());
              }
            }
          }
        } catch(Exception ex){
          HTMLPlugin.openAlertDialog(ex.toString());
View Full Code Here

Examples of com.wutka.dtd.DTDElement

         if(removeLast)
         {
            Element el = (Element)elementStack.removeLast();
            if(el.started)
            {
               DTDElement started = el.element;
               content.endElement("", started.getName(), started.getName());
            }
         }
      }
   }
View Full Code Here

Examples of com.wutka.dtd.DTDElement

            processContainer(dtd, (DTDContainer)item);
         }
         else if(item instanceof DTDName)
         {
            DTDName name = (DTDName)item;
            DTDElement element = (DTDElement)dtd.elements.get(name.value);
            handleChildren(dtd, element, name.getCardinal());
         }
      }
   }
View Full Code Here

Examples of com.wutka.dtd.DTDElement

         ++firstNotStarted;

         while(firstNotStarted < elementStack.size())
         {
            el = (Element)elementStack.get(firstNotStarted++);
            DTDElement notStarted = el.element;

            if(log.isTraceEnabled())
            {
               log.trace("starting skipped> " + notStarted.getName());
            }

            content.startElement("", notStarted.getName(), notStarted.getName(), null);
            el.started = true;
         }
      }
   }
View Full Code Here

Examples of com.wutka.dtd.DTDElement

   {
      Hashtable roots = new Hashtable();
      Enumeration e = dtd.elements.elements();
      while(e.hasMoreElements())
      {
         DTDElement element = (DTDElement)e.nextElement();
         roots.put(element.name, element);
      }

      e = dtd.elements.elements();
      while(e.hasMoreElements())
      {
         DTDElement element = (DTDElement)e.nextElement();
         if(!(element.content instanceof DTDContainer))
         {
            continue;
         }
View Full Code Here

Examples of com.wutka.dtd.DTDElement

   {
      Hashtable roots = new Hashtable();
      Enumeration e = dtd.elements.elements();
      while(e.hasMoreElements())
      {
         DTDElement element = (DTDElement)e.nextElement();
         roots.put(element.name, element);
      }

      e = dtd.elements.elements();
      while(e.hasMoreElements())
      {
         DTDElement element = (DTDElement)e.nextElement();
         if(!(element.content instanceof DTDContainer))
         {
            continue;
         }
View Full Code Here

Examples of com.wutka.dtd.DTDElement

         if(removeLast)
         {
            Element el = (Element)elementStack.removeLast();
            if(el.started)
            {
               DTDElement started = el.element;
               content.endElement("", started.getName(), started.getName());
            }
         }
      }
   }
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.