Article View: borland.public.cppbuilder.internet.web
Article #1649Re: TXMLDocument
From: Remy Lebeau (TeamB)
Date: Fri, 13 Aug 2004 17:12
Date: Fri, 13 Aug 2004 17:12
36 lines
2173 bytes
2173 bytes
"Adam Griffin" <adam.griffin@itron.com> wrote in message
news:411cf085$2@newsgroups.borland.com...
> The Following code works fine when the TXMLDocument
> component is placed directly on the form, however the code
> throws an EAccessViolation when TXMLDocument is instantiated
> at runtime. I instantiate TXMLDocoment as follows:
> TXMLDocument* XMLDocument1 = new TXMLDocument("");
You should use the IXMLDocument interface instead, via the NewXMLDocument()
function. Don't instantiate TXMLDocument directly:
_di_IXMLDocument Doc = NewXMLDocument();
Doc->LoadFromFile("http://oconee.itron.com/scripts/ocn-ex40.wsc/w1_mf073.p?p
art=980090000-000");
_di_IXMLNode DocElement = Doc->DocumentElement;
if( (DocElement) && (DocElement->HasChildNodes) )
{
_di_IXMLNode Part = DocElement->ChildNodes->Nodes[0];
if( (Part) && (Part->HasChildNodes) )
{
for(int i = 0; i < Part->ChildNodes->Count; ++i)
{
_di_IXMLNode part1 = Part->ChildNodes->Nodes[i];
if( part1 )
Memo1->Lines->Add("~p" + part1->Attributes["number"] +
"=\"" + part1->Attributes["description"] + "\"");
}
}
}
Gambit
Technical Details
Message-ID:
<411cf647$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<411cf085$2@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,c86aa8c1c304d723 X-Google-Attributes: gidfeeec,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> Newsgroups: borland.public.cppbuilder.internet.web References: <411cf085$2@newsgroups.borland.com> Subject: Re: TXMLDocument Date: Fri, 13 Aug 2004 10:12:23 -0700 Lines: 38 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <411cf647$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1092417095 68.69.17.41 (13 Aug 2004 10:11:35 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail