• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
typography class & and &

#1
[eluser]Flying Fish[/eluser]
I'm using codeigniter for an app that generates xml files which are then imported into Adobe inDesign.

Users input data into form inputs, the data is stored in a db, and an administrator can log into the back end and download xml files.

Trouble is, inDesign chokes on the '&' character when it sits in the text of the xml tags.

inDesign does however correctly handle the html &

I was wondering if I should write a function that does a string replace on '&' before each xml file is created, or if there was a more fancy codeigniter way of doing it with the typography class.

#2
[eluser]Dam1an[/eluser]
When you say the HTML &, do you mean & amp ;?
One of the text/typography helpers can probably do that, as I'm pretty sure one of them converts stuff like <, > etc to & lt ;, & gt ; etc

Edit: Added some spaces in the HTML chars

#3
[eluser]Flying Fish[/eluser]
yes sorry, the html ampersand

Code:
&amp;

had to wrap it in code tags

#4
[eluser]Dam1an[/eluser]
Hmm.. Can't find anything for & amp ; in the typography helper/class
This should be good enough

Code:
str_replace("&", "&amp;", $my_string_with_ampersands);

#5
[eluser]Flying Fish[/eluser]
ya I didn't see anything in there either, but figured it was worth an ask, thanks for the reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.