> Let me point out a very good reason NOT to use CF for XML.  When you get
> XML, you have to compare it to your DTD and then parse it to get the data
> out.  I'm not sure about you, but writing a parser as complex as this in
CF
> doesn't sit very high on the list of things I want to do.

Luckily, you do not have to. There are many written in Java or that have
been compiled in C++ as COM objects. Many of these will work in ColdFusion.
The obvious choice, if you are working in a Windows environment, is the
MSXML COM object that is installed with every installation of Internet
Explorer 5 or greater. If find COM objects too difficult, have a look at
SiteObjects' MSXML wrapper, CF_SOXML.

http://www.siteobjects.com/index.cfm?fuseAction=showProducts

> So, short summary - there are no existing CF parsers for XML (that I know
> of...if I'm wrong, someone please correct me).  Handling XML is pretty
> process intensive, and lets be honest, thats not really CF's strong point.

There are none that I know of that are written in CFML but that only makes
sense since both are a markup language. As you've suggested, you really
wouldn't want to parse a markup language with another markup language. But,
as mentioned above, there are several really good XML parsers which are
available to ColdFusion developers via COM, JAVA, etc.

> what are the advantages of using XML with my coldfusion web apps?  like
what
> cool stuff can I do?  and is XML hard to learn?

As to the original question, there are quite a few immediate uses for XML.
For instance, you can separate content from display. This is done by using
ColdFusion to query a database to create a XML template on the fly or query
an XML document repository and applying an appropriate XSL template.

This gives you the ability to change the design of the site on the fly
depending on the browser (WML/WAP enabled phone, text reader, TV,
traditional, etc.) without having to maintain several different versions of
the site. This, of course, is just one example but one that is being used
quite frequently by ColdFusion developers.

Another way to integrate XML into your sites would be through WDDX, which is
built right into ColdFusion. You can use WDDX or even XML itself to
syndicate content. That is what has been done with the MoreOver.com news
feeds for example.

In my opinion, XML is much more difficult to learn than HTML because it is
designed for the parser rather than the developer. It is case sensitive, is
very strict in regards to syntax, and requires a more abstract approach. It
also requires a knowledge of DTDs, and if you are going to generate Web
pages from XML, a knowledge of XSL and XSLT will be necessary. These are all
hurdles to overcome if you come from an HTML background.

Luckily, there are already tools like those mentioned above that hide quite
a bit of the logic and make our jobs as developers much easier; and the
tools will only get better.

Benjamin S. Rogers
Web Developer, c4.net
Voice: (508) 240-0051
Fax: (508) 240-0057


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to