xerces-c-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roberto Rigamonti <roby1...@gmail.com>
Subject Re: Null XML document root in some contexts (but working fine in some others with the same code) [huge question]
Date Mon, 28 Jul 2008 20:51:27 GMT
Wow, you're right!!! There are several other errors during file 
transmission/receiving, but the XML error was there.
When the code will be fully working I will remove the hardcoded 
constants and clean up everything....
Thanks a lot!!!!
                                        Roberto

Alberto Massari wrote:
> Hi Roberto,
> I gave just a quick look at the code, but it seems to me that you are 
> creating a visor.xsd schema on the fly; given that the visor.xml sample 
> file has an hardcoded reference to "visor.xsd", this is going to work 
> only if also the temp file is located in the same folder where you put 
> the visor.xsd. Alternatively, you can register an entity resolver that 
> will recognize the request for "visor.xsd" and provide the 
> LocalInputSource pointing to the correct generated content.
> 
> Alberto
> 
> Roberto Rigamonti wrote:
>> Good evening, I'm working to a project that involves the parsing of 
>> some XML files, and up to now I've successfully used the Xerces 
>> library to do so (I've written a couple of messages some months ago 
>> for some questions regarding the correct use of the library, but now 
>> everything seemed to be ok).
>>
>> --- Brief resume of my project ---
>> I have to develop a 3D visor using wxWidgets and OpenGL, that is an 
>> application that reads an XML file (local file or sent through the 
>> network), loads a set of drawing plugins (e.g. the plugin that draws 
>> lines, the one that draws polygons, ...) and displays the objects 
>> specified in the XML file in a three dimensional, navigable world. A 
>> snapshot of the current project can be downloaded from:
>> http://roby1984.netsons.org/3DVisor-0.0.3.tar.bz2
>> The small client that will be used to send the files can be downloaded 
>> from:
>> http://roby1984.netsons.org/client.tar.bz2
>> and compiled using
>> g++ -c client.cc `wx-config --cxxflags` -ggdb
>> g++ client.o `wx-config --gl-libs` -lglut `wx-config --libs` 
>> -L/usr/X11R6/lib -lXi -lXmu -o client
>> # Requested libraries:
>> - Xerces :)
>> - wxWidgets
>> - Boost
>> - GSL
>> - Mesa
>> - libXi
>> - libXmu
>> - some others that I'm probably missing now but that configure should
>>   signal you promptly :)
>> # Build & run example (file downloaded in /home/roby/Download/):
>> -> tar xjvf 3DVisor-0.0.3.tar.bz2
>> -> cd 3DVisor-0.0.3/
>> -> ./configure --prefix=/home/roby/Download/3DVisor-0.0.3/sandbox
>> [to avoid installing it somewhere in the system, so that we can 
>> install it without being root]
>> -> make
>> -> make install
>> -> cd sandbox/bin
>> -> ./3DVisor
>>
>> The problem that I've encountered is the following:
>> if I use the visor in "local mode" and select the file "visor.xml", 
>> everything works fine, but if I enable the "remote mode", start up the 
>> client program (after copying in the same directory of the client 
>> program the file "visor.xml" renamed as "in.txt") and send the file, 
>> the SAME code used for the local file but applied to a temporary file 
>> where the data sent is stored gives me the following result:
>>
>> Temporary filename: /tmp/fileygUK8t  <--- changes everytime and is
>>                                           removed as soon as processing
>>                                           finishes
>> XMLManager::fillVariablesMap() : Empty XML document
>>
>> (that is, after getting the DOMDocument, when trying to get the root 
>> of the DOMDocument it gets a NULL root via getDocumentElement()), even 
>> if the XML file is non-empty (it is removed immediately after 
>> processing, but when it is processed is filled with correct entries, 
>> I've triple-checked it by putting some std::cins to stop the execution 
>> and checking it by hand, so I'm sure of that).
>>
>> The application's code is huge and intricate, but everything regarding 
>> the XML management should be restricted to the XMLManager.* files, in 
>> particular to the load3DObjects() and fillVariablesMap() methods, 
>> eventually I can put specific sections of code upon request (I've put 
>> everything on the web site just to avoid filling this message with 
>> chunks of code).
>> I know that a big effort was requested just to read my entire message, 
>> but I'm really going crazy on this (the code used in both cases IS THE 
>> SAME!!!!).
>> Thanks in advance to anyone willing to help me.
>>                                                Roberto
>>
> 
> 

Mime
View raw message