Return-Path: Delivered-To: apmail-xerces-c-users-archive@www.apache.org Received: (qmail 71555 invoked from network); 28 Jul 2008 16:36:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Jul 2008 16:36:17 -0000 Received: (qmail 78519 invoked by uid 500); 28 Jul 2008 16:36:16 -0000 Delivered-To: apmail-xerces-c-users-archive@xerces.apache.org Received: (qmail 78501 invoked by uid 500); 28 Jul 2008 16:36:16 -0000 Mailing-List: contact c-users-help@xerces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: c-users@xerces.apache.org Delivered-To: mailing list c-users@xerces.apache.org Received: (qmail 78490 invoked by uid 99); 28 Jul 2008 16:36:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jul 2008 09:36:16 -0700 X-ASF-Spam-Status: No, hits=0.3 required=10.0 tests=SPF_PASS,WHOIS_DMNBYPROXY X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of roby1984@gmail.com designates 209.85.132.244 as permitted sender) Received: from [209.85.132.244] (HELO an-out-0708.google.com) (209.85.132.244) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jul 2008 16:35:19 +0000 Received: by an-out-0708.google.com with SMTP id c5so951623anc.10 for ; Mon, 28 Jul 2008 09:35:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=MFMGKwJGQmLJKZUxtivFpBrQJAx5BX/R6K4k707BKDE=; b=Ahunb2Yo/Z2MQJZDnhAzTPlivIqfbKTxL6X2Q+RHXlrMJuT/c6B9XduVW6pqm9QDCF JKM7ikfHdUTOE0WbJ2ryzn1iO9/eG+biUzXVFcfemkrtnYJtkjRqoRQDMulR+htSEQSn 9XiojRPgpVJmHji+hHMlEYNCXmbJMP1llJMWk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=RoEU2FfdzFPTQTn1AHDAZmEkXJrGg98Z85TVRZke6KrFKRNje9PAqSeGtCrRcJF9BP mA29aXcnehkr3j0PzKxlA5hktf/vaCMo3axPi4PIzYe5CcjzKWgl4n42mvUoroqm99AT fj9S01DcHd6srvrEXWoU4JfBhzIRJYilnv1hE= Received: by 10.100.121.12 with SMTP id t12mr8652540anc.132.1217262927972; Mon, 28 Jul 2008 09:35:27 -0700 (PDT) Received: from ?192.168.0.2? ( [93.150.63.144]) by mx.google.com with ESMTPS id a13sm15736562rnc.10.2008.07.28.09.35.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 28 Jul 2008 09:35:26 -0700 (PDT) Message-ID: <488DF54A.2070207@gmail.com> Date: Mon, 28 Jul 2008 18:35:22 +0200 From: Roberto Rigamonti User-Agent: Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: c-users@xerces.apache.org Subject: Null XML document root in some contexts (but working fine in some others with the same code) [huge question] Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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