You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by gd...@apache.org on 2002/01/04 23:52:38 UTC

cvs commit: xml-axis/java/src/org/apache/axis/wsdl/fromJava Types.java

gdaniels    02/01/04 14:52:38

  Modified:    java/src/org/apache/axis/wsdl/fromJava Types.java
  Log:
  Don't use DocumentFragments, since they were causing serious problems
  with crimson.  Just import the element directly, which works with both
  crimson and xerces.
  
  Revision  Changes    Path
  1.10      +8 -12     xml-axis/java/src/org/apache/axis/wsdl/fromJava/Types.java
  
  Index: Types.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/fromJava/Types.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Types.java	31 Dec 2001 18:31:41 -0000	1.9
  +++ Types.java	4 Jan 2002 22:52:38 -0000	1.10
  @@ -287,15 +287,9 @@
        * @throws Exception
        */
       private void writeWsdlTypesElement() throws Exception {
  -        NodeList nl = docFragment.getChildNodes();
  -        for (int n = 0; n < nl.getLength(); n++) {
  -            if (nl.item(n).getLocalName().equals("types")) {
  -                wsdlTypesElem = (Element)nl.item(n);
  -                return;
  -            }
  +        if (wsdlTypesElem == null) {
  +            wsdlTypesElem = docHolder.createElement("types");
           }
  -        wsdlTypesElem = docHolder.createElement("types");
  -        docFragment.appendChild(wsdlTypesElem);
       }
   
       /**
  @@ -698,20 +692,22 @@
        *
        *  Switch over notes: remove docHolder, docFragment in favor of wsdl4j Types
        */
  -    DocumentFragment docFragment;
  +    //DocumentFragment docFragment;
       Document docHolder;
   
       private void createDocumentFragment () {
           this.docHolder = XMLUtils.newDocument();
  -        docFragment = docHolder.createDocumentFragment();
       }
  +    
       /**
        * Inserts the type fragment into the given wsdl document
        * @param doc
        */
       public void insertTypesFragment(Document doc) {
  -        doc.getDocumentElement().insertBefore(
  -                          doc.importNode(docFragment, true),
  +        if (wsdlTypesElem != null) {
  +            doc.getDocumentElement().insertBefore(
  +                          doc.importNode(wsdlTypesElem, true),
                             doc.getDocumentElement().getFirstChild());
  +        }
       }
   }