SAX requires a compiled language - there are implementations for Java, VB
and C++ - so you can't implement SAX parsers directly in CF, a non-compiled
scripting environment.

You could modify the Java classes so they can be called from a CF page; for
this, you have choices of calling them directly with CFOBJECT, modifying
them so they're useable as a Java-based CFX custom tag, or running them on
JRUN and calling them with CFSERVLET.

> -----Original Message-----
> From: Edward Smith [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 16, 2001 9:36 AM
> To: CF-Talk
> Subject: SAX in CF? Other ideas?
>
>
> Hey all,
>
> I have a situation where I want to duplicate an application written in
> Java using CF.
>
> The application uses XML documents as templates, and executes
> functionality based on tags in the XML.
>
> For instance, the XML template might look like this:
>
> <page>
>  <article id="227" />
> </page>
>
> The Java app uses a SAX parser to parse the template, which fires off an
> event for each tag.
>
> When the parser sees the "page" tag, it runs the PAGE java class, which
> goes off into the database and gets page info, etc. and spits out more
> XML to the output stream.
>
> Same for the article tag, which calls the ARTICLE class., etc.
>
> How would one go about doing this in CF?  I'm not sure there would be
> any way to integrate a SAX parser into CF, so I'm not sure of how to do
> this.
>
> What I'd like to do is parse the template and execute CF custom tags for
> each tag.
>
> If I could rewrite the templates, I'd do something like:
>
> <cf_page>
>  <cf_article id="227">
> </cf_page>
>
> and CFINCLUDE them into the page to get executed.
>
> But, I can't rewrite the templates, and the templates come from the
> database, not the filesystem.
>
> Speed/efficiency is the primary motivation, so a RegExp replace, and
> writing the file to the filesystem isn't really an option..
>
> Any ideas?
>
> Thanks in advance!
> --
> Edward Smith                      Internet Broadcasting System
> Director of Architecture          http://www.ibsys.com
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to