Board index » delphi » Where can we use XML?

Where can we use XML?

Everything is ok but i want to know where can we use XML in our Delphi
programs?

For example i saw a program using XML for its skin tech.(program was
Trillian).?How can we do this using Delphi ?

 

Re:Where can we use XML?


Quote
"Bilgehan YILDIRIM" <yildirimbilge...@hotmail.com> wrote in message

news:3c1d31fa_2@dnews...

Quote
> Everything is ok but i want to know where can we use XML in our Delphi
> programs?

Actually since SQL Server 2000 XML I only ask myself where *not* to use XML.
With IB supporting it naticaly now gets even better. I still have to try
that but look svery promising.
So, basically, my answer is XML everywhere. No reason not to (transfer speed
is *not* an issue since you can compress stuff in a zip of a second).

--
Alessandro Federici

System Architect
Borland Certified Consultant
-----
http://www.msdelphi.com  (home of the DSOAP Toolkit 2.0)

a...@msdelphi.com (primary)
a...@bigfoot.com (routes to the first)
kinga...@hotmail.com (if you have troubles with the others)

Re:Where can we use XML?


Hi Bilgehan,

Quote
> Everything is ok but i want to know where can we use XML in our Delphi
> programs?

There are a lot of places. Using Delphi 5, you could already see/have XML
data packets in MIDAS and InternetExpress. With Delphi 6, this support has
been extended with XSLPageProducer component (using XML and XSL) as well as
XML Document programming, XML Data Binding and the XML Mapper (from an XML
document to a data packet - really nice). And don't for get the WSDL/SOAP
support, since WSDL is just XML.
And of course an ADO dataset can be saved to XML (although it's a different
format than a MyBase ClientDataSet).

For some articles about XML Document Programming, XML Data Binding and saving
datasets to/from XML see http://www.drbob42.com/examines

And if you're interesting in XML development using Delphi, you may also want
to read my book review of Keith Wood's Delphi Developer's Guide to XML,
published by WordWare at http://www.drbob42.com/reviews/1556228120.htm

Groetjes,
          Bob Swart (aka Dr.Bob - www.DrBob42.com)

--
drs. Robert E. (Bob) Swart - Consultant, Delphi Trainer & Author
UK-BUG Borland User Group Member & Borland UK Connections Member

Re:Where can we use XML?


You use XML anyway you want. You create a template for any reason and you
can read it and do whatever you want from it's contents. Good for almost
anything

Re:Where can we use XML?


  Perhaps you should get yourself a book on XML and find out exactly what it
is before looking for uses for it.  It's actually quite useful!

  It's like HTML...it's a way of formatting information.  We use it just
about everywhere that we transmit data between clients and servers or
between applications, because it gives us a standard for parsing the data
and allows us to easily change the data or its internal format without
changing function parameters.  For example, instead of writing a function
like this:

function QueryCustomerData( CustomerName, StoreID : string; CutoffDate :
TDateTime ) : TCustomerRecord;

we can write

function QueryCustomerData ( const CustomerXML : WideString ) : WideString;

  Here, the CustomrXML might look like this (formatted for easy
reading...linefeeds and tabs are not actually relevant):

<CUSTOMER>
  <CUSTOMERNAME>Bob White</CUSTOMERNAME>
  <STOREID>10246</STOREID>
  <CUTOFFDATE>20011031</CUTOFFDATE>
</CUSTOMER>

  Likewise, if the result data is in XML, then we can modify the "customer
record" content it returns and not change the function header.

 What this does is allows us to put whatever data we want in the parameter
and result, and change the implementation code without changing the
parameters.  This is especially important when dealing with COM objects,
because changing the parameters means re-registering the type library on
every client that accesses it.  Changing the implementation code only
requires distributing the dll.

  XML is a great tool to have.  You should really get a book on it, and also
look into how to use one or more of the parsers available for it (such as
Microsoft's XML DOM).  Hope this helps...

-Howard

Re:Where can we use XML?


Thanks Bob an interesting read.

I only have D5Pro

You said "I have written a unit that can also produce
ClientDataSet-compatible XML files from regular DataSets."  Where do I get
this unit ?

Regards Malcolm

Quote
"Bob Swart" <b.sw...@chello.nl> wrote in message

news:3C1D97ED.522588D5@chello.nl...
Quote
> Hi Bilgehan,

> > Everything is ok but i want to know where can we use XML in our Delphi
> > programs?

> There are a lot of places. Using Delphi 5, you could already see/have XML
> data packets in MIDAS and InternetExpress. With Delphi 6, this support has
> been extended with XSLPageProducer component (using XML and XSL) as well
as
> XML Document programming, XML Data Binding and the XML Mapper (from an XML
> document to a data packet - really nice). And don't for get the WSDL/SOAP
> support, since WSDL is just XML.
> And of course an ADO dataset can be saved to XML (although it's a
different
> format than a MyBase ClientDataSet).

> For some articles about XML Document Programming, XML Data Binding and
saving
> datasets to/from XML see http://www.drbob42.com/examines

> And if you're interesting in XML development using Delphi, you may also
want
> to read my book review of Keith Wood's Delphi Developer's Guide to XML,
> published by WordWare at http://www.drbob42.com/reviews/1556228120.htm

> Groetjes,
>           Bob Swart (aka Dr.Bob - www.DrBob42.com)

> --
> drs. Robert E. (Bob) Swart - Consultant, Delphi Trainer & Author
> UK-BUG Borland User Group Member & Borland UK Connections Member

Re:Where can we use XML?


Hi Malcolm,

Quote
> Thanks Bob an interesting read.

You're welcome. Please let me know if you want/need other examples as well...

Quote
> I only have D5Pro

> You said "I have written a unit that can also produce
> ClientDataSet-compatible XML files from regular DataSets."  

This unit was part of an article that I wrote for The Delphi Magazine (see
http://www.TheDelphiMagazine.com) and the source code is available from my
website at http://www.drbob42.com/tdm (look for issue #62). It's a bit rough,
and I'm currently updating it to be part of the new release of TableBob (to
turn a table to HTML, XML, XML data packet, and Object Pascal source code).
Might be in time to be a Christmas present, so stay tuned... ;-)

Quote
> Regards Malcolm

Groetjes,
          Bob Swart (aka Dr.Bob - www.DrBob42.com)

--
drs. Robert E. (Bob) Swart - Consultant, Delphi Trainer & Author
UK-BUG Borland User Group Member & Borland UK Connections Member

Re:Where can we use XML?


"Howard Moon" <hm...@landstar.com> wrote in news:3c1e2b30_2@dnews:

Quote
>   Perhaps you should get yourself a book on XML and find out exactly
>   what it
> is before looking for uses for it.  It's actually quite useful!

I guess my question would be "What reasons do I have to spend the time
researching XML?"  In other words, how do I justify the time and money to
even go buy and read such a book?  Much of my programming is pulling data
from an embedded system (which can't change the way it presents its data),
sticking the data into a database, and printing reports based on the data.
What advantages would XML provide to these sorts of activities?

Re:Where can we use XML?


Thanks Bob

I don't have a chimney <g>

Malcolm

Quote
"Bob Swart" <b.sw...@chello.nl> wrote in message

news:3C1EF518.AF8640D3@chello.nl...
Quote
> Hi Malcolm,

> > Thanks Bob an interesting read.

> You're welcome. Please let me know if you want/need other examples as
well...

> > I only have D5Pro

> > You said "I have written a unit that can also produce
> > ClientDataSet-compatible XML files from regular DataSets."

> This unit was part of an article that I wrote for The Delphi Magazine (see
> http://www.TheDelphiMagazine.com) and the source code is available from my
> website at http://www.drbob42.com/tdm (look for issue #62). It's a bit
rough,
> and I'm currently updating it to be part of the new release of TableBob
(to
> turn a table to HTML, XML, XML data packet, and Object Pascal source
code).
> Might be in time to be a Christmas present, so stay tuned... ;-)

> > Regards Malcolm

> Groetjes,
>           Bob Swart (aka Dr.Bob - www.DrBob42.com)

> --
> drs. Robert E. (Bob) Swart - Consultant, Delphi Trainer & Author
> UK-BUG Borland User Group Member & Borland UK Connections Member

Re:Where can we use XML?


This is from a paper (Gatt/O'Dwyer) and may be a useful read:

XML is a flexible way to create common information formats and share both
the format and the data on for example the Web, intranets, and across
platforms and devices. It's a method for placing structured data (including
such things as spreadsheets, address books, configuration parameters,
financial transactions, technical drawings etc) into a text file. XML is a
public format and not a proprietary development of any company.

In HTML you use a fixed set of constructs or tags (words bracketed by '<'
and '>') that are used primarily to specify how to display information
within a browser but HTML cannot specify data structure or meaning, for
example, whether the element being displayed is a customer name, price or
product number.  Thus, while HTML reflects layout and presentation it
conveys nothing about the meaning of the marked-up document.  XML also uses
tags and attributes, but while HTML utilises a fixed set of tags and
specifies what each tag and attribute means and how the text between them
will appear in a browser, XML uses extensible tags to describe data
structures and formats. XML documents are composed of elements delimited by
these tags (these can contain character data or other elements, or both).
Elements can have attributes such as named strings that qualify an element
<temperature units="Celsius">18</temperature>

By using XML, an organisation can specify a vocabulary of data elements in,
for example, a customer processing application, including data such as the
name, street address, city, postcode, telephone number and customer number.
XML can intelligently identify that data, interpret its attributes and then
use it appropriately.

As one author hassaid, while HTML is about displaying information, XML is
about describing information. For example, HTML understands that the
following text should appear as bold through a Web browser <bold>01-01-2000<
/bold>.  XML would define the data more specifically as
<birthdate>01-01-2000</birthdate>. probably the most important difference
between HTML and XML is that it separates the content from any environment
that may process it.

In HTML an invoice may be represented as follows:

<HTML>
<body>
<H1>Invoice</H1>
<p><b>Name:</b>Citizen Cane</p>
<p><b>Address:</b>24 Ongar Road Sydney</p>
<p><b>Item:</b>Widget #123XYZ</p>
<p><b>Cost:</b>$100</p>
</body>
</HTML>

In XML, the same invoice would appear as follows:

<?xml version="1.0">
<invoice>
<name>Citizen Cane</name>
<address>24 Ongar Road Sydney</address>
<item>
            <description>Widget</description>
            <code>123XYZ</code>
            <cost currency = "AUD">100</cost>
</item>
</invoice>

and from this you can see that you immediaitely have the ability to read and
process this file intelligently.

Jackie

Quote
"Bilgehan YILDIRIM" <yildirimbilge...@hotmail.com> wrote in message

news:3c1d31fa_2@dnews...
Quote
> Everything is ok but i want to know where can we use XML in our Delphi
> programs?

> For example i saw a program using XML for its skin tech.(program was
> Trillian).?How can we do this using Delphi ?

Other Threads