Hello Jody,

here comes the Patch for the Main-Module.
I do not add the Changes I made to the WFS-Plugin.
If I could not switch to an "relaxed" reader we have to talk about how to
solve the problem.


- Tim

-----Ursprüngliche Nachricht-----
Von: Jody Garnett [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 19. Juni 2007 20:55
An: Tim Englich
Cc: [email protected]
Betreff: GEOT-1298 updated to document hack, how to submit a patch and
become a committer


Thanks Tim that is great.
> Hello Jody,
>
> I put my solution as an comment to the Ticket.
>
> You say that there is a switch to use an other reader than
StrictFeatureReader.
>   
I am not sure of the details - I know uDig uses strict mode sometimes 
and relaxed at other times :-(
> How can I do that so that I can revoke my changes on StrictFeatureReader?
Can
> I put the information into the Map used to create the Datastore?
>   
I think so ... when I am next in the uDig codebase I can try and have a 
look.
> You are right that the place where I remove the wasted childs is not good.
> But I haven't found a better place do do this.
>   
Me either - let's think a bit more (and then if we have to we can apply 
your patch as is). Jesse Eichar is returning from his holiday soon and 
may have a better spot in mind.
> You asked me to put together a patch. What does that mean to me? Should I
> send the manipulated Files to you?
>   
I choose "create patch" from the menu in eclipse and attach the result 
to the Jira bug report.
> I have got some other changes to the DateTime an Date classes of the
> XML-Parsing. Could I also send it to you that you integrate it into
> the Project?
>   
For sure.

You know after I review your patches; and we are sure you have read the 
developers guide; you can get direct
access yourself. You have already shown a good attention to detail and 
the stubbornness to tackle some of the
most scary code in GeoTools. You even used the right tools for the task 
at hand - profilers etc..

Cheers,
Jody

Index: 
D:/WorkspaceGT-2.3/2.3.x/module/main/src/org/geotools/xml/XMLSAXHandler.java
===================================================================
--- 
D:/WorkspaceGT-2.3/2.3.x/module/main/src/org/geotools/xml/XMLSAXHandler.java    
    (revision 25961)
+++ 
D:/WorkspaceGT-2.3/2.3.x/module/main/src/org/geotools/xml/XMLSAXHandler.java    
    (working copy)
@@ -27,6 +27,7 @@
 import java.util.logging.Logger;
 
 import org.geotools.xml.gml.FCBuffer.StopException;
+import org.geotools.xml.handlers.ComplexElementHandler;
 import org.geotools.xml.handlers.DocumentHandler;
 import org.geotools.xml.handlers.ElementHandlerFactory;
 import org.geotools.xml.handlers.IgnoreHandler;
@@ -256,10 +257,10 @@
         throws SAXException {
        handleCharacters();
         logger.info("END: " + qName);
-
+        XMLElementHandler handler = null;
         try {
                
-            XMLElementHandler handler = (XMLElementHandler) handlers.peek();
+            handler = (XMLElementHandler) handlers.peek();
             URI uri = new URI(namespaceURI);
             handler.endElement(uri, localName, hints);
         } catch (Exception e) {
@@ -275,7 +276,18 @@
             throw exception;
         }
         finally {
-            handlers.pop();            
+            handlers.pop();
+            if (handler != null && !handlers.isEmpty()){
+                       XMLElementHandler parent = 
((XMLElementHandler)handlers.peek());
+                       if (parent instanceof ComplexElementHandler){
+                           ComplexElementHandler complexParent = 
(ComplexElementHandler)parent;
+                               String typename = 
complexParent.getType().getClass().getName();
+                               // TODO: HACK The required Type is not in this 
Module
+                               
if(typename.equals("org.geotools.xml.wfs.WFSBasicComplexTypes$FeatureCollectionType")){
+                                       complexParent.removeElement(handler);
+                               }
+                       }
+               }
         }
     }
 
Index: 
D:/WorkspaceGT-2.3/2.3.x/module/main/src/org/geotools/xml/handlers/ComplexElementHandler.java
===================================================================
--- 
D:/WorkspaceGT-2.3/2.3.x/module/main/src/org/geotools/xml/handlers/ComplexElementHandler.java
       (revision 25961)
+++ 
D:/WorkspaceGT-2.3/2.3.x/module/main/src/org/geotools/xml/handlers/ComplexElementHandler.java
       (working copy)
@@ -589,6 +589,24 @@
     public String getName() {
         return elem.getName();
     }
+    
+    /**
+     * Remove the given XMLElementHandler from the Child-List
+     * @param handler
+     */
+    public void removeElement(XMLElementHandler handler){
+               if (elements != null){
+                       elements.remove(handler);
+               }
+       }
+    
+    /**
+     * returns the Type of the Elementhandler
+        * @return type
+        */
+       public ComplexType getType() {
+               return type;
+       }
 
     /**
      * <p>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to