Package org.xml.sax

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


    AttributesImpl attrs = getAttributes(pData, pElement);
    if (!pData.isRootElementCreated()) {
      createSchemaLocationAttributes(pData, attrs);
      pData.setRootElementCreated(true);
    }
    handler.startElement(uri, name, qName, attrs);
    marshalChilds(pData, pElement);
    handler.endElement(uri, name, qName);
    for (;;) {
      String prefix = nss.setContext(context);
      if (prefix == null) {
View Full Code Here


    try {
      ContentHandler handler = sax2xml.getContentHandler();
      handler.startDocument();
      // write an artificial start tag
      handler.startElement("", "Document", "Document", new AttributesImpl());
      // now use null is a placeholder for this artificial Document annotation
      AnnotationFS curAnnot = null;

      while (iterator.isValid()) {
        // debug
View Full Code Here

            // write text between current pos and beginning of nextAnnot
            try {
              handler.characters(docCharArray, pos, nextAnnot.getBegin() - pos);
              pos = nextAnnot.getBegin();
              handler.startElement("", nextAnnot.getType().getName(),
                      nextAnnot.getType().getName(), getFeatureAttributes(nextAnnot, aCAS));

              // push parent annotation on stack
              stack.add(curAnnot);
              // move on to next annotation
View Full Code Here

        }
        ContentHandlerFactory inDocHandlerFactory = new SubdocumentHandlerFactory(inDocHandler);

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

            for (String prefix: prefixes) {
                handler.startPrefixMapping(prefix, session.getNamespaceURI(prefix));
            }
            AttributesImpl attrs = new AttributesImpl();
            attrs.addAttribute(Name.NS_SV_URI, "name", "sv:name", "CDATA", ni.name);
            handler.startElement(Name.NS_SV_URI, "node", "sv:node", attrs);

            // check if SNS and a helper uuid if needed
            boolean addMixRef = false;
            if (!ni.label.equals(ni.name) && ni.uuid == null) {
                ni.uuid = UUID.randomUUID().toString();
View Full Code Here

                    // only pass 'protected' properties to the import
                    if (PROTECTED_PROPERTIES.contains(p.name)) {
                        attrs = new AttributesImpl();
                        attrs.addAttribute(Name.NS_SV_URI, "name", "sv:name", "CDATA", p.name);
                        attrs.addAttribute(Name.NS_SV_URI, "type", "sv:type", "CDATA", PropertyType.nameFromValue(p.type));
                        handler.startElement(Name.NS_SV_URI, "property", "sv:property", attrs);
                        for (String v: p.values) {
                            handler.startElement(Name.NS_SV_URI, "value", "sv:value", EMPTY_ATTRIBUTES);
                            handler.characters(v.toCharArray(), 0, v.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", p.name);
                        attrs.addAttribute(Name.NS_SV_URI, "type", "sv:type", "CDATA", PropertyType.nameFromValue(p.type));
                        handler.startElement(Name.NS_SV_URI, "property", "sv:property", attrs);
                        for (String v: p.values) {
                            handler.startElement(Name.NS_SV_URI, "value", "sv:value", EMPTY_ATTRIBUTES);
                            handler.characters(v.toCharArray(), 0, v.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 n = 0;
    ZipEntry ze = null;
    while(( ze = zis.getNextEntry())!=null) {
View Full Code Here

          public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
                        // filter menu-element noded within menu definition
                        if ((menuDepth == 0) || !qName.equals("menu-element"))
                        {
                            handler.startElement(uri,localName, qName, atts);
                        }

                        // track menu depth
                        if (qName.equals("menu"))
                        {
View Full Code Here

        ch.startPrefixMapping(prefix, uri);

        String nN = "node";
        AttributesImpl attrs = new AttributesImpl();
        attrs.addAttribute(svuri, "name", svprefix + "name", "CDATA", nodeName1);
        ch.startElement(svuri, nN, svprefix + nN, attrs);

        // primary node type
        String pN = "property";
        attrs = new AttributesImpl();
        attrs.addAttribute(svuri, "name", svprefix + "name", "CDATA", JcrConstants.JCR_PRIMARYTYPE);
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.