This is a beautiful thing, Tom. Putting the tag in an Application.cfm was exactly what I needed. The XML remains compliant, and the tag works perfectly!
I'll also have to take a closer look at translets (and perhaps Cocoon) Thanks much! -Carl -----Original Message----- From: tom dyson [mailto:[EMAIL PROTECTED]] Sent: Monday, September 16, 2002 12:49 AM To: [EMAIL PROTECTED] Subject: Re: [cf-xml] MX in valid XML? Hi Carl Your system is very interesting - somewhat like a ColdFusion version of Cocoon: http://xml.apache.org/cocoon/ I-Lin's suggestion (providing a closing tag for <cf_myparser />) might not be appropriate for your situation because you'd need to place the tag inside your top level 'Page' element for the XML document to be valid. Could you place the tag in Application.cfm? Cocoon can deliver a variety of transformations for different requests and browser types, and your system could mimic this at a simple level: <cfif isdefined('url.xml')> <cf_myparser> </cfif> If you're running Apache, you could use mod_rewrite to automate the URL variable additions: http://httpd.apache.org/docs/mod/mod_rewrite.html You could also check for browser types within cf_myparser, and use different stylesheets to deliver relevant content. If your stylesheets are fairly constant, you might also want to look at compiling them into Translets - this will greatly reduce the transformation load on your server by removing the processes of reading and parsing the XSLT file. See http://torchbox.com/xml/transletwrapper.cfm for a ColdFusion implementation of this technology. Good luck Tom > I have kind of an interesting situation/use for ColdFusion MX. > > In preparation for migrating our web content to a Content Management System, > we've begun to describe our pages in XML. Something like: > > <?xml version="1.0" encoding="ISO-8859-1"?> > <Page> > <Meta> > <Title>Some Page Title</Title> > <Keywords>keyword1, keyword2, keyword3, keyword4, keyword5</Keywords> > <Description>Some description</Description> > </Meta> > <Content> > <Headline>Some Headline</Headline> > <Bodycopy>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem > nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat. > Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit > lobortis nisl ut aliquip ex ea commodo.</Bodycopy> > : > : > </Content> > </Page> > > > Rather than have a frontdoor parser/transformer (ie: > http://mydomain.com/myxmlparser.cgi?page=/foo/bar/somepage.xml ), because the > site is massive and converting all pages to XML descriptor files will take > some time, we've wanted to maintain all our existing URLs (ie: > http://mydomain.com/foo/bar/somepage.cfm ) for the time being (at least until > we decide on a CMS) so that links don't break, current marketing initiatives > don't require redirects, etc, etc. (all the stuff we'll have to deal with in > using a CMS... so why fight the headache twice). > > One cleaver (I think) way we've found to do this is to keep the .cfm on the > file after it's converted to XML, and simply add a call to a custom tag (say > "cf_myparser") as the first line. The cf_myparser does a > GetBaseTemplatePath(), reads the page in via a CFFILE, does an XMLParse, does > some preprocessing (evaluating some values, adding/deleting/revising others, > setting defaults), then sends it out through XMLTransform, outputs the result > in a template UI, and does a cfabort to prevent the actual unprocessed > descriptor data from appearing. > > Everything works great (in actuality, much better than expected)... except for > the fact that, with the cf_myparser tag as the first line of code, any other > XML parser complains that the file is no longer valid XML (which, of course, > it's not). Which means if we want to turn around at some point and use the > same file as data for a CMS, we're going to have to do a global search/replace > for the tag. I suppose not a huge deal, in the grand scheme of things... but > I'm just wondering if anyone can see a way to make a call to a CF custom tag > within the descriptor file and still have it be valid XML? > > I'm open to any and all ideas :-) > > TIA, > -Carl -----------------+ tom dyson t: +44 (0)1608 811870 m: +44 (0)7958 752657 http://torchbox.com -----------------------+ cf-xml mailing list http://torchbox.com/xml/list.cfm -----------------------+ cf-xml mailing list http://torchbox.com/xml/list.cfm
