Package org.xml.sax

Examples of org.xml.sax.ContentHandler.startElement()


            // add the jcr:primaryTye
            attrs = new AttributesImpl();
            attrs.addAttribute(Name.NS_SV_URI, "name", "sv:name", "CDATA", JcrConstants.JCR_PRIMARYTYPE);
            attrs.addAttribute(Name.NS_SV_URI, "type", "sv:type", "CDATA", "Name");
            handler.startElement(Name.NS_SV_URI, "property", "sv:property", attrs);
            handler.startElement(Name.NS_SV_URI, "value", "sv:value", EMPTY_ATTRS);
            handler.characters(type.toCharArray(), 0, type.length());
            handler.endElement(Name.NS_SV_URI, "value", "sv:value");
            handler.endElement(Name.NS_SV_URI, "property", "sv:property");

            if (mixins.length > 0) {
View Full Code Here


            if (mixins.length > 0) {
                // add the jcr:mixinTypes
                attrs = new AttributesImpl();
                attrs.addAttribute(Name.NS_SV_URI, "name", "sv:name", "CDATA", JcrConstants.JCR_MIXINTYPES);
                attrs.addAttribute(Name.NS_SV_URI, "type", "sv:type", "CDATA", "Name");
                handler.startElement(Name.NS_SV_URI, "property", "sv:property", attrs);
                for (String mix: mixins) {
                    handler.startElement(Name.NS_SV_URI, "value", "sv:value", EMPTY_ATTRS);
                    handler.characters(mix.toCharArray(), 0, mix.length());
                    handler.endElement(Name.NS_SV_URI, "value", "sv:value");
                }
View Full Code Here

                attrs = new AttributesImpl();
                attrs.addAttribute(Name.NS_SV_URI, "name", "sv:name", "CDATA", JcrConstants.JCR_MIXINTYPES);
                attrs.addAttribute(Name.NS_SV_URI, "type", "sv:type", "CDATA", "Name");
                handler.startElement(Name.NS_SV_URI, "property", "sv:property", attrs);
                for (String mix: mixins) {
                    handler.startElement(Name.NS_SV_URI, "value", "sv:value", EMPTY_ATTRS);
                    handler.characters(mix.toCharArray(), 0, mix.length());
                    handler.endElement(Name.NS_SV_URI, "value", "sv:value");
                }
                handler.endElement(Name.NS_SV_URI, "property", "sv:property");
            }
View Full Code Here

            // add the jcr:uuid
            if (uuid != null) {
                attrs = new AttributesImpl();
                attrs.addAttribute(Name.NS_SV_URI, "name", "sv:name", "CDATA", JcrConstants.JCR_UUID);
                attrs.addAttribute(Name.NS_SV_URI, "type", "sv:type", "CDATA", "String");
                handler.startElement(Name.NS_SV_URI, "property", "sv:property", attrs);
                handler.startElement(Name.NS_SV_URI, "value", "sv:value", EMPTY_ATTRS);
                handler.characters(uuid.toCharArray(), 0, uuid.length());
                handler.endElement(Name.NS_SV_URI, "value", "sv:value");
                handler.endElement(Name.NS_SV_URI, "property", "sv:property");
            }
View Full Code Here

            if (uuid != null) {
                attrs = new AttributesImpl();
                attrs.addAttribute(Name.NS_SV_URI, "name", "sv:name", "CDATA", JcrConstants.JCR_UUID);
                attrs.addAttribute(Name.NS_SV_URI, "type", "sv:type", "CDATA", "String");
                handler.startElement(Name.NS_SV_URI, "property", "sv:property", attrs);
                handler.startElement(Name.NS_SV_URI, "value", "sv:value", EMPTY_ATTRS);
                handler.characters(uuid.toCharArray(), 0, uuid.length());
                handler.endElement(Name.NS_SV_URI, "value", "sv:value");
                handler.endElement(Name.NS_SV_URI, "property", "sv:property");
            }
View Full Code Here

        ContentHandlerFactory inDocHandlerFactory = new SubdocumentHandlerFactory(
                inDocHandler);

        if (inDocHandler != null && inRepresentation != SINGLE_XML) {
            inDocHandler.startDocument();
            inDocHandler.startElement("", "classes", "classes",
                    new AttributesImpl());
        }

        int i = 0;
        ZipEntry ze;
View Full Code Here

                     attrs = new AttributesImpl(1);
                  }

                  attrs.add(Constants.NS_XML_SCHEMA, "xmlns", "xmlns", null, ge.getNsUri());

                  ch.startElement(ge.getNsUri(), ge.getLocalName(), ge.getLocalName(), attrs);

                  String text = ge.getTextContent();
                  if(text != null && text.length() > 0)
                  {
                     ch.characters(text.toCharArray(), 0, text.length());
View Full Code Here

    XMLSerializer xmlSerializer = new XMLSerializer(out, true);
    ContentHandler xmlSerHandler = xmlSerializer.getContentHandler();

    try {
      xmlSerHandler.startDocument();
      xmlSerHandler.startElement("", CONFIG_ELEMENT, CONFIG_ELEMENT, new AttributesImpl());

      for (String corpusFolder : dotCorpus.getCorpusFolderNameList()) {
        AttributesImpl corpusFolderAttributes = new AttributesImpl();
        corpusFolderAttributes.addAttribute("", "", CORPUS_FOLDER_ATTRIBUTE, "", corpusFolder);
View Full Code Here

      for (String corpusFolder : dotCorpus.getCorpusFolderNameList()) {
        AttributesImpl corpusFolderAttributes = new AttributesImpl();
        corpusFolderAttributes.addAttribute("", "", CORPUS_FOLDER_ATTRIBUTE, "", corpusFolder);

        xmlSerHandler.startElement("", CORPUS_ELEMENT, CORPUS_ELEMENT, corpusFolderAttributes);
        xmlSerHandler.endElement("", CORPUS_ELEMENT, CORPUS_ELEMENT);
      }

      for (AnnotationStyle style : dotCorpus.getAnnotationStyles()) {
        AttributesImpl styleAttributes = new AttributesImpl();
View Full Code Here

        if (style.getConfiguration() != null) {
          styleAttributes.addAttribute("", "", STYLE_CONFIG_ATTRIBUTE, "", style
                  .getConfiguration());
        }

        xmlSerHandler.startElement("", STYLE_ELEMENT, STYLE_ELEMENT, styleAttributes);
        xmlSerHandler.endElement("", STYLE_ELEMENT, STYLE_ELEMENT);
      }

      for (String type : dotCorpus.getShownTypes()) {
       
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.