Package org.apache.cocoon.xml.dom

Examples of org.apache.cocoon.xml.dom.DOMBuilder.startDocument()


        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Start recording");
        }
        DOMBuilder builder = new DOMBuilder(this.tfactory);
        addRecorder(builder);
        builder.startDocument();
        builder.startElement("", "cocoon", "cocoon", EMPTY_ATTRIBUTES);
        sendStartPrefixMapping();
    }

    /**
 
View Full Code Here


        if (this.layoutDOM == null && this.profile != null) {
            try {
                Map portalLayouts = (Map)this.profile.get(PortalConstants.PROFILE_PORTAL_LAYOUTS);
                Map copletLayouts = (Map)this.profile.get(PortalConstants.PROFILE_COPLET_LAYOUTS);
                DOMBuilder builder = new DOMBuilder();
                builder.startDocument();
                PortalManagerImpl.streamLayoutProfile(builder, portalLayouts, copletLayouts, this.mediaType);
                builder.endDocument();
                this.layoutDOM = builder.getDocument();
            } catch (SAXException local) {
                throw new ProcessingException("Unable to get portal." + local, local);
View Full Code Here

                String contextID = null;
                if (this.copletID != null && this.copletNumber != null) {
                    contextID = "coplet_"+copletID+"_"+copletNumber;
                }
                DOMBuilder builder = new DOMBuilder();
                builder.startDocument();
                portal.streamConfiguration(builder,
                                            this.portalURI,
                                            this.profileID,
                                            this.mediaType,
                                            contextID);
View Full Code Here

        this.namespace = namespace;
        this.name = name;

        try {
            DOMBuilder builder = new DOMBuilder();
            builder.startDocument();
            builder.startPrefixMapping(NS_PREFIX, namespace);
            AttributesImpl attrs = new AttributesImpl();
            attrs.addAttribute(URI, NS_PREFIX, "xmlns:"+NS_PREFIX, "NMTOKEN", namespace);
            builder.startElement(namespace, name, D_PREFIX+name, attrs);
            builder.endElement(namespace, name, D_PREFIX+name);
View Full Code Here

     * @param value Value of the property
     */
    public void setValue(String value) {
        try {
            DOMBuilder builder = new DOMBuilder();
            builder.startDocument();
            builder.startPrefixMapping(NS_PREFIX, namespace);
            AttributesImpl attrs = new AttributesImpl();
            attrs.addAttribute(URI, NS_PREFIX, "xmlns:"+NS_PREFIX, "NMTOKEN", namespace);
            builder.startElement(namespace, name, D_PREFIX+name, attrs);
            builder.characters(value.toCharArray(), 0, value.length());
View Full Code Here

     * @param values
     */
    public void setValue(NodeList values) {
        try {
            DOMBuilder builder = new DOMBuilder();
            builder.startDocument();
            builder.startElement(namespace, name, name, XMLUtils.EMPTY_ATTRIBUTES);
            DOMStreamer stream = new DOMStreamer(builder);
            for (int i = 0; i<values.getLength(); i++) {
                stream.stream(values.item(i));
            }
View Full Code Here

    public static NodeList toDOMNodeList(String elementName,
            Instruction si, ObjectModel objectModel,
            ExecutionContext executionContext, MacroContext macroContext, NamespacesTable namespaces)
            throws SAXException {
        DOMBuilder builder = new DOMBuilder();
        builder.startDocument();
        builder.startElement(JXTemplateGenerator.NS, elementName, elementName,
                EMPTY_ATTRS);
        execute(builder, objectModel, executionContext, macroContext, namespaces, si.getNext(), si.getEndInstruction());
        builder.endElement(JXTemplateGenerator.NS, elementName, elementName);
        builder.endDocument();
View Full Code Here

     */
    public static Document getWidgetFragment(Widget widget, Locale locale) throws SAXException {
       
        DOMBuilder domBuilder = new DOMBuilder();
        // Start document and "fi:fragment" root element
        domBuilder.startDocument();
        domBuilder.startPrefixMapping(FormsConstants.INSTANCE_PREFIX, FormsConstants.INSTANCE_NS);
        // FIXME: why simply declaring the prefix isn't enough?
        AttributesImpl attr = new AttributesImpl();
        attr.addCDATAAttribute(NamespaceSupport.XMLNS, "fi:", "xmlns:fi", FormsConstants.INSTANCE_NS);
        domBuilder.startElement(FormsConstants.INSTANCE_NS, "fragment", FormsConstants.INSTANCE_PREFIX_COLON + "fragment", attr);
View Full Code Here

    }

    private NodeList toDOMNodeList(String elementName, StartInstruction si,
            MyJexlContext jexlContext, StartElement macroCall) throws SAXException{
        DOMBuilder builder = new DOMBuilder();
        builder.startDocument();
        builder.startElement(NS, elementName, elementName, EMPTY_ATTRS);
        execute(builder, jexlContext, jxpathContext, macroCall, si.next, si.endInstruction);
        builder.endElement(NS, elementName, elementName);
        builder.endDocument();
        Node node = builder.getDocument().getDocumentElement();
View Full Code Here

        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Start recording");
        }
        DOMBuilder builder = new DOMBuilder(this.tfactory);
        addRecorder(builder);
        builder.startDocument();
        builder.startElement("", "cocoon", "cocoon", EMPTY_ATTRIBUTES);
        sendStartPrefixMapping();
    }

    /**
 
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.