Hi,

I tried to work on my indexer by using Parser and Feature but it doesn't 
work. I get several exceptions very strange and an infinite loop in some 
cases.

Here my code :
            XMLSerializer serializer = new XMLSerializer();
            FileOutputStream fos = new 
FileOutputStream("c:\\temp\\gml.xml");
            serializer.setOutputByteStream(fos);
            NodeList children = 
getDocument().getOwnerDocument().getChildNodes();
            for(int index = 0; index < children.getLength(); index++)
            {
                if(children.item(index) instanceof Element)
                    serializer.serialize((Element) children.item(index));
            }
            fos.close();
           
            org.geotools.xml.Configuration configuration = new 
org.geotools.gml3.GMLConfiguration();
            Parser parser = new org.geotools.xml.Parser(configuration);
            parser.setValidating(false);
            parser.setStrict(false);
            fc = (FeatureCollection) parser2.parse(new 
FileInputStream("c:\\temp\\gml.xml"));

I get this in the exist.log
Node 3.3.1.1.2 could not be found. Giving up.
2007-11-15 11:07:06,786 [http-8080-Processor25] WARN  (DOMFile.java 
[get]:1478) - node value not found : 3.3.1.1.2

for all the nodes and this exception :
Caused by: java.io.FileNotFoundException: E:\tomcat5.0jdk1.5\Tomcat 
5.0\bin\..\.
.\eop\1.1\opt.xsd (Le chemin d'accÞs spÚcifiÚ est introuvable)
Indeed, in my xml document have this root node:
<opt:EarthObservation 
gml:id="DS_PHR1A_20010822110247_TLS_PX_E123N45_0101_01234" 
xsi:schemaLocation="http://earth.esa.int/opt ../../eop/1.1/opt.xsd" ...>

Before I use FileOutpuStream, I used PipedOutputStream to get an 
InputStream (or InputSource) but I get an infinite loop.

Is it possible that the parser don't use schemas ?
Do you know where the errors 'Node 3.3.1.1.2 could not be found' come from ?

Regards,

-- 
Robert JACOLIN
M2M
ANYWARE TECHNOLOGIES
Tél : +33 (0)5.61.00.06.56
Fax : +33 (0)5 61 00 51 46
www.anyware-tech.com


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to