cffile action=write file as XML. Put spacing in lines, but resave file on mac spaces disappear

2009-04-16 Thread Joel Black

I have a very strange issue and need someone to tell me im not crazy.  I an 
querying a database, saving the content , and writing it to an xml file.  The 
formatting is all perfect to the format we had testing the xml file.  By the 
way, flash is reading the XML.  The strange part, the application writes the 
XML file, and the spacing is there.  You open the xml with windows, resave it, 
and try to load it again in flash, same spacing problem.  If you open the XML 
with Mac, resave it exactly the same, reload it to the flash and the spacing is 
perfect.  If you open and resave the XML with mac dreamweaver, it works, 
otherwise it puts spaces between the lines.  here is the code, and a link to 
the site with spaces.

http://blackbeardesign.com/temp/resave-with-mac.jpg
http://blackbeardesign.com/temp/save-from-cf-or-windows.jpg

!--- get the xml content ready ---
cfsavecontent variable=theXml?xml version=1.0 encoding=UTF-8?
!DOCTYPE data[
!ELEMENT title (comments, image)
!ATTLIST title name CDATA #REQUIRED
!ELEMENT comments (#PCDATA)
!ELEMENT image (#PCDATA)

]
datacfoutput query=data
title name=#data.title#
comments#data.comments#
/comments
imageAssets/thumbs/#data.image#/image
flv../../Assets/flv/#data.flv#/flv
  /title
/cfoutput
/data
/cfsavecontent
!--- then write the xml ---
cffile action=write file=#xmldir#/data.xml output=#theXml# 
charset=utf-8


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321653
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: cffile action=write file as XML. Put spacing in lines, but resave file on mac spaces disappear

2009-04-16 Thread Ben Nadel

This might be a line-delimiter problem. I believe windows uses both the
return and newline characters:

\r\n

Linux based machines, on the other hand, I think only use one of the
them...\n maybe? Not sure.

-- 
Ben Nadel
Adobe Community Expert
Adobe Certified Advanced ColdFusion Developer
Manager New York ColdFusion User Group
http://www.bennadel.com

Need ColdFusion Help?
http://www.bennadel.com/Ask-Ben


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321658
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: cffile action=write file as XML. Put spacing in lines, but resave file on mac spaces disappear

2009-04-16 Thread Rob Parkhill

Try wrapping the content in a cfprocessingdirective
suppresswhitespace=true
Rob

On Thu, Apr 16, 2009 at 12:56 PM, Ben Nadel b...@bennadel.com wrote:


 This might be a line-delimiter problem. I believe windows uses both the
 return and newline characters:

 \r\n

 Linux based machines, on the other hand, I think only use one of the
 them...\n maybe? Not sure.

 --
 Ben Nadel
 Adobe Community Expert
 Adobe Certified Advanced ColdFusion Developer
 Manager New York ColdFusion User Group
 http://www.bennadel.com

 Need ColdFusion Help?
 http://www.bennadel.com/Ask-Ben


 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321660
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: cffile action=write file as XML. Put spacing in lines, but resave file on mac spaces disappear

2009-04-16 Thread Joel Black

Both very good solutions, but neither is working.  I tried doing a replace() 
while processing, but there is nother there to replace.  I tried \r\n, \r.  
Didnt get an error, but got the same outcome.  I also tried supressing white 
space, with processing directive, same outcome.  The generated XML is clean, 
cant figure out why I would have to open it and save it with a mac thought, it 
doesnt make sense.

the XML
?xml version=1.0 encoding=UTF-8?
!DOCTYPE data[
!ELEMENT title (comments, image)
!ATTLIST title name CDATA #REQUIRED
!ELEMENT comments (#PCDATA)
!ELEMENT image (#PCDATA)

]
data
title name=Patient 108
comments2008 48 Hour Film Project Entry
Production Company Unit One Productions
Director Lauren Giovanonni
*Winner of BEST CINEMATOGRAPHY
/comments
imageAssets/thumbs/108sm.jpg/image
flv../../Assets/flv/108.flv/flv
/title
/data 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321691
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: cffile action=write file as XML. Put spacing in lines, but resave file on mac spaces disappear

2009-04-16 Thread Joel Black

Thanks for the suggestion.  I tried it, but got the same outcome. 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321692
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: cffile action=write file as XML. Put spacing in lines, but resave file on mac spaces disappear

2009-04-16 Thread Joel Black

Great idea, but could not get a replace() to work.  There is nother there to 
replace? 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321693
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4