 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
server Guest
|
Posted: Tue Jan 24, 2006 1:47 am Post subject: A Noobie asks... |
|
|
message unavailable |
|
| Back to top |
|
 |
Jeremy Darling Guest
|
Posted: Tue Jan 24, 2006 1:47 am Post subject: Re: A Noobie asks... |
|
|
If the site provides a RSS feed (XML Notes Feed) then this is exactly what
you will be wanting to do. As far as on the storage side of the world, that
all depends on your personal preference and traffic to the backend (EG:
10,000 updates a second would not bide well with a FFS or XML structure,
while 100 updates a day would be a poor idea for a high end database such as
Oracle).
If the site does not provide a RSS feed then you will have to scan the site,
perform pattern matching, data clensing, and finally data storage. Again
this is all up to you as to how you would implement it.
Hope that helps answer your question,
- Jeremy
"Kevin" <polarized (AT) mct (DOT) net> wrote in message
news:43d51a5a (AT) newsgroups (DOT) borland.com...
| Quote: | I would like to have my app (in Delphi 7 Pro) obtain statistical data
(sports stats) from a website and save it to a database. I'm just now
starting to read up on XML, and it sounds like it could be a very useful
tool to do this. Am I correct, or is there a better way?
Thanks,
Kevin
|
|
|
| Back to top |
|
 |
Richard Light Guest
|
Posted: Sat Jan 28, 2006 10:47 pm Post subject: Re: I cant parsing included external xml parts |
|
|
In message <43db2cce (AT) newsgroups (DOT) borland.com>, ilker <ilker (AT) ilker (DOT) com>
writes
| Quote: | does anyone can help me how do I parse included sections
// main.xml
?xml version="1.0" encoding="ISO-8859-1" ?
!DOCTYPE xml [
!ENTITY sample SYSTEM "samples.xml"
]
order
&sample;
/order
|
You need to set an option to resolve external entities. This means that
you have to load your file explicitly after doing so:
var x : txmlDocument;
begin
x := txmldocument.Create(nil);
x.ParseOptions := [poResolveExternals];
x.LoadFromFile('main.xml');
showmessage(x.ChildNodes['order'].childNodes['details'].nodeValue);
Richard Light
| Quote: |
// sample usage ( not properly running )
var x : txmlDocument;
begin
x := txmldocument.Create('main.xml');
x.ParseOptions := [poResolveExternals];
x.Active := true;
showmessage(x.ChildNodes['order'].childNodes['details'].nodeValue);
|
--
Richard Light
SGML/XML and Museum Information Consultancy
richard (AT) light (DOT) demon.co.uk |
|
| Back to top |
|
 |
David Caouette Guest
|
Posted: Fri Feb 03, 2006 8:55 pm Post subject: Re: What tools/components are people using for XML-RPC? |
|
|
If you want to build a client app,
just use Delphi 7 WSDL importer and THTTPRIO. The webservices made in delphi
7 are XML-RPC/encoded, so there would be no problems building a client
application.
David
"Mark Williams" <mark@{removethis}.skwirel.com> a écrit dans le message de
news: 438ed3a8$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Indy + MSXML will do the job. There's nothing special about XMLRPC, it's
just XML.
Cheers,
Mark
"Warrick Wilson" <warrickw (AT) mercuryonline (DOT) com> wrote in message
news:438de3b6$1 (AT) newsgroups (DOT) borland.com...
I'm looking at having to make XML-RPC calls to a server that we've
written from a Delphi 7 program I'm writing. What tools or libraries or
components or products are people using (and happy with) for doing this?
Thanks...
|
|
|
| Back to top |
|
 |
danny heijl Guest
|
Posted: Sat Feb 04, 2006 12:33 am Post subject: Re: What tools/components are people using for XML-RPC? |
|
|
Warrick Wilson schreef:
| Quote: | I'm looking at having to make XML-RPC calls to a server that we've written
from a Delphi 7 program I'm writing. What tools or libraries or components
or products are people using (and happy with) for doing this?
|
there's a delphi xmlrpc implementation available on sourceforge, works
but may not be entirely bug free.
danny
--- |
|
| Back to top |
|
 |
Mark Moss Guest
|
Posted: Mon May 08, 2006 8:15 pm Post subject: Re: Help - Exporting Table in XML Format that Contains a Fie |
|
|
Ladies / Gentlemen
I am current writing a program that will query a MS SQL2000 Database
Table and Export the contents as XML. The problem that I am having is that
one of the Fields in this Table also contains XML data.
How do I tell the output file to not interpret this field, just
treat it as text?
Mark Moss |
|
| Back to top |
|
 |
Rick Guest
|
Posted: Wed May 10, 2006 12:15 pm Post subject: Re: Help - Exporting Table in XML Format that Contains a Fie |
|
|
Just a guess, but can you enclose the xml in a comment node, i.e.
<sometag>
<!-- <xmlfromDB>...</xmlfromDB> -->
</sometag
or use a CDATA section?
Rick
"Mark Moss" <markmoss (AT) adelphia (DOT) net> wrote in message
news:445fa109$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
Ladies / Gentlemen
I am current writing a program that will query a MS SQL2000
Database
Table and Export the contents as XML. The problem that I am having is
that
one of the Fields in this Table also contains XML data.
How do I tell the output file to not interpret this field, just
treat it as text?
Mark Moss
|
|
|
| Back to top |
|
 |
James Poulose Guest
|
Posted: Tue Feb 13, 2007 7:32 pm Post subject: RE: How do I extract the CDATA section out of XML using D6 a |
|
|
| Quote: |
Hi all,
How do I extract the CDATA section out of XML using D6 and TXMLDocument?
In part of my XML document I have some HTML code which I've put
inside a CDATA section so that the XML parser will ignore it.
Now my code is something like this:
Campaign
Webpage><![CDATA[<br><a href="http://www.borland.com">Rocks</a> ]]></Webpage
OtherStuff>234345</OtherStuff
/Campain
Now in my Delphi6 code I have assigned the DocumentElement to a
node, MyRootNode, and I then interogate each node like so:
CampaignNode := MyRootNode.ChildNodes.Nodes["Campaign"];
Now my CampaignNode contains a number of child nodes and I can
interogate all of them except the one containing CDATA section!?
Can anyone shed some light on this for me please?
I am trying to get the value of the CDATA section by doing the
following:
Mystring := CampaignNode.ChildNodes.Nodes["Webpage"].nodeValue;
Anyway, I get the following error when I try step to the line above:
"EXMLDocError: Element does not contain a single text node"
p.s. I am using OpenXML as the DOMVendor, if that helps??
Thanks,
Jason.
|
Reading CDATA contents from XML
----------------------------------------
There is popular belief that CDATA contents are very difficult to read. But the actual fact is that it is very simple, and that too using performance enhancing classes. When i say 'performance enhancing classes', i mean XmlTextReader class in .NET 1.1. It might always look very easy to use XmlDocument for all XML related requirements, and ofcourse it is!! But, seldom do we recognize that it is a resource hungry and time consuming class. As a rule of thump, we can keep a guideline as follows
Use XmlDocument ONLY if
1) You need to update the XML file immediately after reading some part of it.
2) You need to access a considerable big number of properties / methods provided in the XmlDocument class
Use XmlTextReader ALWAYS if
1) You do not want to write back to the XML anything.
2) You don't want to navigate back and front in the DOM model. (Remember this is a forward only reader, and hence the performance advantage)
The following code shows how to read the CDAT using XmlTextreader
Sample XML
----------
xml removed due to security restriction. Don't ask me why..ask TopXML!!!
Code C#
-------
XmlTextReader reader = new XmlTextReader("xml path");
XmlNodeType type;reader.WhitespaceHandling = WhitespaceHandling.None;
bool bFlag = false;
while(reader.Read())
{
type = reader.NodeType;
if(type == XmlNodeType.Element && reader.Name == "JunkData") //#1
{
bFlag = true;
}
if(bFlag) //#2
{
if(type == XmlNodeType.CDATA)
{
string s = reader.ReadString();
MessageBox.Show(s); //#3
}
}
}
Notes
------
#1) Here you can add more logic to ensure you access the right CDATA if you have more than one.
#2) This ensures that unnecessary code execution are not happening
#3) This should display the contents between "CDATA[" and "]"
Regards,
James Poulose
james.poulose (AT) yahoo (DOT) co.uk
BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities |
|
| Back to top |
|
 |
adesh agnihotri Guest
|
Posted: Wed Feb 28, 2007 4:05 pm Post subject: RE: Reading a value; Element does not contain a single text |
|
|
| Quote: | Please someone lend a hand.
I'm trying to ge tthe value of the "PartnerId"
I use Delphi pro ver 7.
My gole is to read and then update some of the elements's values.
Source:
Clinic := XMLDocument1.DocumentElement.ChildNodes[0];
Memo1.Lines.Add(Clinic.NodeName); << this returns "PartnerId"
Memo1.Lines.Add(Clinic.ChildNodes["PartnerId"].Text); << this does not
work
Memo1.Lines.Add(Clinic.NodeValue); << this will error (Element does not
contain a single text node)
Part of my XML:
?xml version="1.0" encoding="ISO-8859-1" ?
CPIPartnerOrder
PartnerId>5</PartnerId
OrderInfo
Studio>41765</Studio
Session>L1XP7-TC38KPD</Session
Customer>Manager</Customer
CPIOrderId>11493</CPIOrderId
OrderDate>7/17/2005 4:24:42 PM</OrderDate
Priority>Standard</Priority
StudioAddress
...........
Thank you
Craig.
|
Source:
Clinic := XMLDocument1.DocumentElement.ChildNodes[0];
Memo1.Lines.Add(Clinic.NodeName); << this returns "PartnerId"
Memo1.Lines.Add(Clinic.ChildNodes.Get(0).NodeValue);<< this will work
BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|