You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Oliver Keineke <ch...@gmx.at> on 2003/09/25 12:00:33 UTC
Using XML-File as config for a win32-prog (Parsing in C++)
I have to write a program that can be used as shell-replacement on
NT/2k-machines... is intended to be able to start and monitor different applications
on customer PCs.
An XML-File is used for configuration.... I have to use Xerces 1.7.0 and C++
Builder 5.
I'm struggling how to parse the file and extract the needed information.
As I'm on tight schedule and also have to sort out how to programm the
Win32-part of my programm, any help would be appreciated.
After some struggling I managed to use the DOMPrint-Example but I still
don't know how to use the parsed XML-File
It seems, that this sourcecode works:
try
{
XMLPlatformUtils::Initialize();
}
catch(const XMLException& toCatch)
{
// Errormessage
}
DOMParser oParser;
try
{
oParser.parse("config.xml");
}
catch (const XMLException& c_roToCatch)
{
// Errormessage
}
catch (const DOM_DOMException&)
{
// Errormessage
}
catch (...)
{
// Errormessage
}
DOM_Document oDoc = oParser.getDocument();
if (oDoc != 0)
{
// BIG BLACK BOX ;)
}
Yet I have absolutely no idea what to do with the DOM_Document to walk
through - I even don't get a running TreeWalker :(
Rather stupid question(s) but I nevertheless hope for some help as I'm
completely lost for now.
Thanks for any help :)
Oliver
--
NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService
Jetzt kostenlos anmelden unter http://www.gmx.net
+++ GMX - die erste Adresse für Mail, Message, More! +++
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
Re: Using XML-File as config for a win32-prog (Parsing in C++)
Posted by Thomas Porschberg <th...@osp-dd.de>.
I'm myself a newbie but maybe DOMCount example is more suitable for you ?!
thomas
On Thu, Sep 25, 2003 at 12:00:33PM +0200, Oliver Keineke wrote:
> I have to write a program that can be used as shell-replacement on
> NT/2k-machines... is intended to be able to start and monitor different applications
> on customer PCs.
> An XML-File is used for configuration.... I have to use Xerces 1.7.0 and C++
> Builder 5.
>
> I'm struggling how to parse the file and extract the needed information.
> As I'm on tight schedule and also have to sort out how to programm the
> Win32-part of my programm, any help would be appreciated.
>
> After some struggling I managed to use the DOMPrint-Example but I still
> don't know how to use the parsed XML-File
>
> It seems, that this sourcecode works:
>
> try
> {
> XMLPlatformUtils::Initialize();
> }
> catch(const XMLException& toCatch)
> {
> // Errormessage
> }
> DOMParser oParser;
> try
> {
> oParser.parse("config.xml");
> }
> catch (const XMLException& c_roToCatch)
> {
> // Errormessage
> }
> catch (const DOM_DOMException&)
> {
> // Errormessage
> }
> catch (...)
> {
> // Errormessage
> }
> DOM_Document oDoc = oParser.getDocument();
> if (oDoc != 0)
> {
> // BIG BLACK BOX ;)
> }
>
>
> Yet I have absolutely no idea what to do with the DOM_Document to walk
> through - I even don't get a running TreeWalker :(
>
> Rather stupid question(s) but I nevertheless hope for some help as I'm
> completely lost for now.
>
> Thanks for any help :)
>
> Oliver
>
> --
> NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
> Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService
>
> Jetzt kostenlos anmelden unter http://www.gmx.net
>
> +++ GMX - die erste Adresse für Mail, Message, More! +++
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
--
Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
RE: Using XML-File as config for a win32-prog (Parsing in C++)
Posted by Allen Williams <an...@csunv.com>.
Use the methods in the DOMNode class (parent of the DOMDocument class).
> -----Original Message-----
> From: Oliver Keineke [mailto:chakram@gmx.at]
> Sent: Thursday, September 25, 2003 6:01 AM
> To: xerces-c-dev@xml.apache.org
> Subject: Using XML-File as config for a win32-prog (Parsing in C++)
>
>
> I have to write a program that can be used as shell-replacement on
> NT/2k-machines... is intended to be able to start and monitor
> different applications
> on customer PCs.
> An XML-File is used for configuration.... I have to use Xerces
> 1.7.0 and C++
> Builder 5.
>
> I'm struggling how to parse the file and extract the needed information.
> As I'm on tight schedule and also have to sort out how to programm the
> Win32-part of my programm, any help would be appreciated.
>
> After some struggling I managed to use the DOMPrint-Example but I still
> don't know how to use the parsed XML-File
>
> It seems, that this sourcecode works:
>
> try
> {
> XMLPlatformUtils::Initialize();
> }
> catch(const XMLException& toCatch)
> {
> // Errormessage
> }
> DOMParser oParser;
> try
> {
> oParser.parse("config.xml");
> }
> catch (const XMLException& c_roToCatch)
> {
> // Errormessage
> }
> catch (const DOM_DOMException&)
> {
> // Errormessage
> }
> catch (...)
> {
> // Errormessage
> }
> DOM_Document oDoc = oParser.getDocument();
> if (oDoc != 0)
> {
> // BIG BLACK BOX ;)
> }
>
>
> Yet I have absolutely no idea what to do with the DOM_Document to walk
> through - I even don't get a running TreeWalker :(
>
> Rather stupid question(s) but I nevertheless hope for some help as I'm
> completely lost for now.
>
> Thanks for any help :)
>
> Oliver
>
> --
> NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
> Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService
>
> Jetzt kostenlos anmelden unter http://www.gmx.net
>
> +++ GMX - die erste Adresse für Mail, Message, More! +++
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org