🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.xml
10 messages
10 total messages Started by Sergio Pottstock Tue, 17 Jun 2008 15:09
Atom read
#185
Author: Sergio Pottstock
Date: Tue, 17 Jun 2008 15:09
18 lines
1286 bytes
Hi

I build RSS reader with delphi 7 using TXMLDocument component, but I'cant
read ATOM protocol :

With RSS :
StartItemNode :=
XMLDoc.DocumentElement.ChildNodes.First.ChildNodes.FindNode('item');

With ATOM:
StartItemNode :=
XMLDoc.DocumentElement.ChildNodes.First.ChildNodes.FindNode('entry');

StartItem = NIL

Any idea?

PTTK
Re: Atom read
#186
Author: Remy Lebeau (TeamB)
Date: Tue, 17 Jun 2008 17:13
25 lines
1766 bytes
"Sergio Pottstock" <pttk@pttk.cl> wrote in message 
news:4857d362$1@newsgroups.borland.com...

> I build RSS reader with delphi 7 using TXMLDocument component,
> but I'cant read ATOM protocol :

Why not?  You need to be more specific.  What exactly are you having trouble 
with?

> With RSS :
> StartItemNode :=
> XMLDoc.DocumentElement.ChildNodes.First.ChildNodes.FindNode('item');
>
> With ATOM:
> StartItemNode :=
> XMLDoc.DocumentElement.ChildNodes.First.ChildNodes.FindNode('entry');
>
> StartItem = NIL

Just a guess, what you are likely looking for the nodes in the wrong place. 
What does the actual XML look like?


Gambit 
Re: Atom read
#187
Author: Sergio Pottstock
Date: Tue, 17 Jun 2008 21:39
47 lines
1916 bytes
Hi,

Thank, I'cant found "Node", when execute:

StartItemNode :=
XMLDoc.DocumentElement.ChildNodes.First.ChildNodes.FindNode('entry');

Allways is NIL

Thank

PTTK




"Remy Lebeau (TeamB)" <no.spam@no.spam.com> escribi� en el mensaje
news:4857f107$1@newsgroups.borland.com...
>
> "Sergio Pottstock" <pttk@pttk.cl> wrote in message
> news:4857d362$1@newsgroups.borland.com...
>
> > I build RSS reader with delphi 7 using TXMLDocument component,
> > but I'cant read ATOM protocol :
>
> Why not?  You need to be more specific.  What exactly are you having
trouble
> with?
>
> > With RSS :
> > StartItemNode :=
> > XMLDoc.DocumentElement.ChildNodes.First.ChildNodes.FindNode('item');
> >
> > With ATOM:
> > StartItemNode :=
> > XMLDoc.DocumentElement.ChildNodes.First.ChildNodes.FindNode('entry');
> >
> > StartItem = NIL
>
> Just a guess, what you are likely looking for the nodes in the wrong
place.
> What does the actual XML look like?
>
>
> Gambit
>
>
Re: Atom read
#188
Author: Remy Lebeau (TeamB)
Date: Tue, 17 Jun 2008 22:58
17 lines
1468 bytes
"Sergio Pottstock" <pttk@pttk.cl> wrote in message 
news:48582ed7@newsgroups.borland.com...

> Thank, I'cant found "Node", when execute:
>
> StartItemNode :=
> XMLDoc.DocumentElement.ChildNodes.First.ChildNodes.FindNode('entry');
>
> Allways is NIL

Like I said, you are looking for the 'entry' node at the wrong location in 
the XML.  That is the only way FindNode() would return a nil pointer. 
Again, please show the actual XML you are trying to parse.


Gambit 
Re: Atom read
#197
Author: Sergio Pottstock
Date: Wed, 18 Jun 2008 15:35
28 lines
1704 bytes
Thank:

I try read this : http://pttk.blogspot.com/atom.xml for example

PTTK


"Remy Lebeau (TeamB)" <no.spam@no.spam.com> escribi� en el mensaje
news:4858434c$1@newsgroups.borland.com...
>
> "Sergio Pottstock" <pttk@pttk.cl> wrote in message
> news:48582ed7@newsgroups.borland.com...
>
> > Thank, I'cant found "Node", when execute:
> >
> > StartItemNode :=
> > XMLDoc.DocumentElement.ChildNodes.First.ChildNodes.FindNode('entry');
> >
> > Allways is NIL
>
> Like I said, you are looking for the 'entry' node at the wrong location in
> the XML.  That is the only way FindNode() would return a nil pointer.
> Again, please show the actual XML you are trying to parse.
>
>
> Gambit
>
>
Re: Atom read
#198
Author: Remy Lebeau (TeamB)
Date: Wed, 18 Jun 2008 18:05
21 lines
1718 bytes
"Sergio Pottstock" <pttk@pttk.cl> wrote in message 
news:48592b00@newsgroups.borland.com...

> I try read this : http://pttk.blogspot.com/atom.xml for example

As I keep telling you, you are looking in the wrong place for the "entry" 
nodes.  You need to search the immediate chilren of the DocumentElement. 
But you are searching the children of the first child of the DocumentElement 
instead.  That is why FindNode() returns nil.  In other words, you need to 
change this line:

    StartItemNode := 
XMLDoc.DocumentElement.ChildNodes.First.ChildNodes.FindNode('entry');

To this instead:

    StartItemNode := XMLDoc.DocumentElement.ChildNodes.FindNode('entry');


Gambit 
Re: Atom read
#199
Author: Sergio Pottstock
Date: Wed, 18 Jun 2008 18:18
34 lines
1998 bytes
Thank!!!

It work now.

Thank

PTTK

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> escribi� en el mensaje
news:48594e47$1@newsgroups.borland.com...
>
> "Sergio Pottstock" <pttk@pttk.cl> wrote in message
> news:48592b00@newsgroups.borland.com...
>
> > I try read this : http://pttk.blogspot.com/atom.xml for example
>
> As I keep telling you, you are looking in the wrong place for the "entry"
> nodes.  You need to search the immediate chilren of the DocumentElement.
> But you are searching the children of the first child of the
DocumentElement
> instead.  That is why FindNode() returns nil.  In other words, you need to
> change this line:
>
>     StartItemNode :=
> XMLDoc.DocumentElement.ChildNodes.First.ChildNodes.FindNode('entry');
>
> To this instead:
>
>     StartItemNode := XMLDoc.DocumentElement.ChildNodes.FindNode('entry');
>
>
> Gambit
>
>
Re: Atom read
#200
Author: Sergio Pottstock
Date: Wed, 18 Jun 2008 19:06
74 lines
3929 bytes
Now I confuse with this:

<title type='text'>HP anuncia iPAQ 914</title>

Read OK with : ANode.ChildNodes['title'].Text;

<content type='html'>&lt;DIV&gt;&lt;FONT face=Arial size=2&gt; &lt;TABLE
cellSpacing=2 cellPadding=0 width=462 border=0&gt;   &lt;TBODY&gt;   &lt;TR
align=left&gt;     &lt;TH class=titulo-not scope=col
colSpan=2&gt;&lt;/TH&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TH vAlign=top
scope=col align=left&gt;&lt;IMG hspace=5
src="http://www.diarioti.com/sisimg/18050b_hpipaq.gif" align=left
border=1&gt;&amp;nbsp;&lt;SPAN class=titulo-head&gt;&lt;BR&gt;La serie HP
IPAQ 914 utiliza el        sistema operativo Microsoft Windows Mobile 6.1
Professional para acceder a        las aplicaciones profesionales m�s
comunes.&lt;/SPAN&gt; &lt;SPAN
class=texto-detalle&gt;&lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&g
t;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/FONT&gt;&lt;/DIV&gt;El  dispositivo
utiliza una conexi�n inal�mbrica tri-banda UMTS/HSDPA y cuatri-banda
GSM/GPRS/EDGE que permite al usuario las comunicaciones por voz y acceso a
Internet en cualquier parte, mientras que la tecnolog�a integrada Bluetooth
y  Wi-Fi ofrece total conectividad.&lt;BR&gt;&lt;BR&gt;El dispositivo
dispone de pantalla  t�ctil y una rueda de cinco direcciones que permite
navegar a trav�s de men�s y  emails. Las aplicaciones de serie Cyberon Voice
Commander y HP Voice Reply dejan  que el usuario env�e mails y ejecute otro
tipo de comandos por voz sin necesidad  de tocar el
dispositivo.&lt;BR&gt;</content>

Read OK with : ANode.ChildNodes['content'].Text;

<author><name>Sergio
Pottstock</name><email>noreply@blogger.com</email></author>

Read OK with : ANode.ChildNodes['author'].ChildNodes['name'].Text;

<link rel='alternate' type='text/html'
href='http://pttk.blogspot.com/2008/06/hp-anuncia-ipaq-914.html' title='HP
anuncia iPAQ 914'/>

I'cant read with : ANode.ChildNodes['link'].Text;

Any idea?

Thank

PTTK


"Remy Lebeau (TeamB)" <no.spam@no.spam.com> escribi� en el mensaje
news:48594e47$1@newsgroups.borland.com...
>
> "Sergio Pottstock" <pttk@pttk.cl> wrote in message
> news:48592b00@newsgroups.borland.com...
>
> > I try read this : http://pttk.blogspot.com/atom.xml for example
>
> As I keep telling you, you are looking in the wrong place for the "entry"
> nodes.  You need to search the immediate chilren of the DocumentElement.
> But you are searching the children of the first child of the
DocumentElement
> instead.  That is why FindNode() returns nil.  In other words, you need to
> change this line:
>
>     StartItemNode :=
> XMLDoc.DocumentElement.ChildNodes.First.ChildNodes.FindNode('entry');
>
> To this instead:
>
>     StartItemNode := XMLDoc.DocumentElement.ChildNodes.FindNode('entry');
>
>
> Gambit
>
>
Re: Atom read
#202
Author: Remy Lebeau (TeamB)
Date: Thu, 19 Jun 2008 19:32
24 lines
1883 bytes
"Sergio Pottstock" <pttk@pttk.cl> wrote in message 
news:48595c84$1@newsgroups.borland.com...

> <link rel='alternate' type='text/html'
> href='http://pttk.blogspot.com/2008/06/hp-anuncia-ipaq-914.html' title='HP
> anuncia iPAQ 914'/>
>
> I'cant read with : ANode.ChildNodes['link'].Text;

That is not a text node like the others are, so there is nothing for the 
Text property to access.  You have to use the Attributes property instead, 
ie:

    ANode.ChildNodes['link'].Attributes['rel']

    ANode.ChildNodes['link'].Attributes['type']

    ANode.ChildNodes['link'].Attributes['href']

    ANode.ChildNodes['link'].Attributes['title']


Gambit 
Re: Atom read
#203
Author: Sergio Pottstock
Date: Thu, 19 Jun 2008 20:07
37 lines
2116 bytes
Thank !!

Sorry, I am inexpert in XLM document

Thank

PTTK

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> escribi� en el mensaje
news:485ab491$1@newsgroups.borland.com...
>
> "Sergio Pottstock" <pttk@pttk.cl> wrote in message
> news:48595c84$1@newsgroups.borland.com...
>
> > <link rel='alternate' type='text/html'
> > href='http://pttk.blogspot.com/2008/06/hp-anuncia-ipaq-914.html'
title='HP
> > anuncia iPAQ 914'/>
> >
> > I'cant read with : ANode.ChildNodes['link'].Text;
>
> That is not a text node like the others are, so there is nothing for the
> Text property to access.  You have to use the Attributes property instead,
> ie:
>
>     ANode.ChildNodes['link'].Attributes['rel']
>
>     ANode.ChildNodes['link'].Attributes['type']
>
>     ANode.ChildNodes['link'].Attributes['href']
>
>     ANode.ChildNodes['link'].Attributes['title']
>
>
> Gambit
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads