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