Package org.w3c.dom

Examples of org.w3c.dom.CDATASection


      nested.setAttribute(XMLConstants.ATTR_TYPE, t.getClass().getName());
      String message = t.getMessage();
      if ((message != null) && (message.length() > 0)) {
        nested.setAttribute(XMLConstants.ATTR_MESSAGE, message);
      }
      CDATASection trace= doc.createCDATASection(Utils.stackTrace(t, false)[0]);
      nested.appendChild(trace);
    }
   
    return nested;
  }
View Full Code Here


      Element queryElement = createBPELElement("query");
      if (query.getQueryLanguage() != null) {
        queryElement.setAttribute("queryLanguage", query.getQueryLanguage());
      }
      if (query.getValue() != null) {
        CDATASection cdata = BPELUtils.createCDATASection(document, query.getValue());
        queryElement.appendChild(cdata);
      }
      fromElement.appendChild(queryElement);
    }
   
   
    if (from.isSetEndpointReference()) {
      fromElement.setAttribute("endpointReference", from.getEndpointReference().toString());
    }
   
    if (from.isSetOpaque()) {
      fromElement.setAttribute("opaque", BPELUtils.boolean2XML(from.getOpaque()));
    }
   
   
    if (from.isSetLiteral() && from.getLiteral() != null && !from.getLiteral().equals("")) {
     
      Node node = null;
      Element literal = createBPELElement("literal");
     
      fromElement.appendChild(literal);
     
      if (Boolean.TRUE.equals(from.getUnsafeLiteral())) {
        node = BPELUtils.convertStringToNode(from.getLiteral(), bpelResource);
      }
     
      if (node != null) {
        for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
          DOMUtil.copyInto(child, literal);
        }
      } else {
        CDATASection cdata = BPELUtils.createCDATASection(document, from.getLiteral());
        fromElement.appendChild(cdata);
      }
           
    }

   
    if (from.getServiceRef() != null) {
      ServiceRef serviceRef = from.getServiceRef();
      Element serviceRefElement = createBPELElement("service-ref");
      String referenceScheme = serviceRef.getReferenceScheme();
      if (referenceScheme != null) {
        serviceRefElement.setAttribute("reference-scheme", referenceScheme);
      }
      if (serviceRef.getValue() != null) {
        Object value = serviceRef.getValue();
        if (value instanceof ExtensibilityElement) {
          ExtensibilityElement extensibilityElement = (ExtensibilityElement)value;
          BPELExtensionSerializer serializer = null;
          QName qname = extensibilityElement.getElementType();
          try {
              serializer=(BPELExtensionSerializer)extensionRegistry.querySerializer(ExtensibleElement.class,qname);
          } catch (WSDLException e) {
          }
         
          if (serializer != null) {
            // Deserialize the DOM element and add the new Extensibility element to the parent
            // ExtensibleElement
            DocumentFragment fragment=document.createDocumentFragment();
            try {
                serializer.marshall(ExtensibleElement.class,qname,extensibilityElement,fragment,process,extensionRegistry);
              Element child = (Element)fragment.getFirstChild();
              serviceRefElement.appendChild(child);
            } catch (WSDLException e) {
              throw new WrappedException(e);
            }
          }
        } else {
          ServiceReferenceSerializer serializer = extensionRegistry.getServiceReferenceSerializer(referenceScheme);
          if (serializer != null) {
            DocumentFragment fragment=document.createDocumentFragment();
              serializer.marshall(value, fragment, process, from, this);
            Element child = (Element)fragment.getFirstChild();
            serviceRefElement.appendChild(child);
          } else {
            CDATASection cdata = BPELUtils.createCDATASection(document, serviceRef.getValue().toString());
            serviceRefElement.appendChild(cdata);
          }
        }
        fromElement.appendChild(serviceRefElement);
      }
    }

   
    if (from.getExpression() != null) {
      Expression expression = from.getExpression();
     
      if (expression.getExpressionLanguage() != null) {
        fromElement.setAttribute("expressionLanguage", expression.getExpressionLanguage());
      }
      if (expression.getBody() != null) {
        CDATASection cdata = BPELUtils.createCDATASection(document, (String)expression.getBody());
        fromElement.appendChild(cdata);
      }     
    }
   
    if (from.getType() != null) {
View Full Code Here

      Element queryElement = createBPELElement("query");
      if (query.getQueryLanguage() != null) {
        queryElement.setAttribute("queryLanguage", query.getQueryLanguage());
      }
      if (query.getValue() != null) {
        CDATASection cdata = BPELUtils.createCDATASection(document, query.getValue());
        queryElement.appendChild(cdata);
      }
      toElement.appendChild(queryElement);
    }
    // serialize local namespace prefixes to XML
View Full Code Here

        } catch (WSDLException e) {
          throw new WrappedException(e);
        }
       
      } else {
        CDATASection cdata = BPELUtils.createCDATASection(document, expression.getBody().toString());
        expressionElement.appendChild(cdata);
      }
    }
   
    return expressionElement;
View Full Code Here

      //System.out.println("QueryImpl.createElement()");
      Element newElement = super.createElement();
     
      String value = getValue();
      if (value != null) {
      CDATASection cdata = getEnclosingDefinition().getDocument().createCDATASection(value);
      newElement.appendChild(cdata);
      }
     
      return newElement;
    }
View Full Code Here

        Text text = (Text)node;
        data += text.getData();
      } else if (node.getNodeType() == Node.CDATA_SECTION_NODE) {
        data="";
        do {
          CDATASection cdata = (CDATASection) node;
          data += cdata.getData();
          node = node.getNextSibling();
          containsValidData = true;
        } while (node != null && node.getNodeType() == Node.CDATA_SECTION_NODE);
        break;
      }
View Full Code Here

      case Node.CDATA_SECTION_NODE :
        if (bCData == false) {
          sb.setLength(0);
          bCData = true;
        }
        CDATASection cdata = (CDATASection) node;
        sb.append( cdata.getData() );
        break;
      }
      node = node.getNextSibling();
    }
    String data = sb.toString();
View Full Code Here

                    // System.out.println("XMLBuilder.insertNode() STO CREANDO isCDATA");
                    // System.out.println("XMLBuilder.insertNode() STO CREANDO isCDATA");
                    // System.out.println("XMLBuilder.insertNode() STO CREANDO isCDATA");
                    // System.out.println("XMLBuilder.insertNode() STO CREANDO isCDATA");
                    // System.out.println("XMLBuilder.insertNode() STO CREANDO isCDATA");
                    CDATASection section = DomDocument.createCDATASection(nodeValue);
                    node.appendChild(section);
                  } else {
                    // System.out.println("XMLBuilder.insertNode()1111111111111 STO CREANDO isCDATA");
                    // System.out.println("XMLBuilder.insertNode()1111111111111 STO CREANDO isCDATA");
                    // System.out.println("XMLBuilder.insertNode()1111111111111 STO CREANDO isCDATA");
View Full Code Here

  protected void populateSpecificData(Document doc, Node n)
  {
    Element etmp = null;
    Text text = null;
    CDATASection cdata = null;

    Element root = doc.createElement("sql-error");
    n.appendChild(root);

View Full Code Here

        return null;
    }

    private Node addText(XMLField xmlField, Node element, String textValue) {
        if (xmlField.isCDATA()) {
            CDATASection cdata = element.getOwnerDocument().createCDATASection(textValue);
            element.appendChild(cdata);
            return cdata;
        } else {
            Text text = element.getOwnerDocument().createTextNode(textValue);
            element.appendChild(text);
View Full Code Here

TOP

Related Classes of org.w3c.dom.CDATASection

Copyright © 2018 www.massapicom. 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.