House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

XML/XSLT Line Break

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Hi all,
Mark Leder
01/31/05 10:25 A
Alex,
Mark Leder
01/31/05 11:20 A
I see now.
Alex Sherwood
01/31/05 11:59 A
Rob and Alex,
Mark Leder
01/31/05 02:16 P
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Mark Leder
01/31/2005 10:25 AM

Hi all, I'm using a simple XML doc to populate image captions in a Flash photo gallery.  One of the <caption></caption> statements in the XML has the need to display multiple paragraphs.  I don't care about any other formatting beyond that.  Is there a good/easy way to force line breaks in XML (like a control character ?) or do I have to build and insert an XSLT doc? Thanks, Mark

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Alex Sherwood
01/31/2005 10:48 AM

Line break as in [br] or linebreak as in CHR10+CHR13? Mark Leder wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Mark Leder
01/31/2005 10:54 AM

Which ever works, I'm not concerned about HTML display at all here, just showing a space between a couple lines of text. Line break as in [br] or linebreak as in CHR10+CHR13? Mark Leder wrote: ----- Excess quoted text cut - see Original Post for more ----- XSLT doc? ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Alex Sherwood
01/31/2005 10:59 AM

I'm a little confused. Can you post a sample XML document, and mark where the line breaks should be? If I understand, you want to be able to embed line breaks in the caption text and then have the line breaks be refelected when the caption text is displayed? The front end is Flash, right? Mark Leder wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Mark Leder
01/31/2005 11:20 AM

Alex, Thanks for looking into this with me. Here's an XML snip, showing two different pic captions.  The second <caption>, I inserted a <br /> to show where I would want a break for a new paragraph. To see the actual flash, go to http://www.pearlywhitesmile.com/testimonials/ ============== <?xml version="1.0" encoding="utf-8" standalone="yes"?> <images>     <pic> <image>http://www.pearlywhitesmile.com/images/photos/testimonials/01.jpg</im age>         <caption>"I now have a natural looking radiant smile that receives constant compliments and additionally have no more headaches!"  -- Gina</caption>     </pic>     <pic> <image>http://www.pearlywhitesmile.com/images/photos/testimonials/02.jpg</im age>         <caption>Late last year, I was in the process of looking for a new dentist. As I was contemplating having cosmetic dentistry performed I didn't feel that my current dentist was qualified to perform the latest cosmetic techniques. <br /><br />After much research, I decided to make an appointment with Dr. Barry for a consultation.  -- Patricia</caption>     </pic> </images> ============== Thanks, Mark I'm a little confused. Can you post a sample XML document, and mark where the line breaks should be? If I understand, you want to be able to embed line breaks in the caption text and then have the line breaks be refelected when the caption text is displayed? The front end is Flash, right?

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Alex Sherwood
01/31/2005 11:59 AM

I see now. I have very little experience with Flash as a font end, but it seems to me that you would need to have Flash recognize the line break some how. I don't know how flash renders text, but if it can render basic HTML, then your fine. Try embedding a CFLF where the <br/> tags are, ala: <xsl:value-of select=" "/> These should not be normalized or escaped by your XML parser. -- Alex Mark Leder wrote: ----- Excess quoted text cut - see Original Post for more ----- -- Alex Sherwood Director, Internet Services PHS Collection Agency Phone: 813-283-4579 Web: www.phs-net.com

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rob
01/31/2005 12:44 PM

There are a couple tricks to do this, but I think your best bet would be to add a cdata section to your xml - I think that will solve your problem. So: <caption><![CDATA[ "I now have a natural looking radiant smile that receives constant compliments and additionally have no more headaches!"  -- Gina ]]></caption> Will keep the parser from parsing the data and removing the line breaks - at least it should. Otherwise you could do it in the xslt by adding <xsl:text> </xsl:text> to get some line breaks in there. Hope that helps ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Mark Leder
01/31/2005 02:16 PM

Rob and Alex, The CDATA trick worked well for this application. Thanks for your help. Mark There are a couple tricks to do this, but I think your best bet would be to add a cdata section to your xml - I think that will solve your problem. So: <caption><![CDATA[ "I now have a natural looking radiant smile that receives constant compliments and additionally have no more headaches!"  -- Gina ]]></caption> Will keep the parser from parsing the data and removing the line breaks - at least it should. Otherwise you could do it in the xslt by adding <xsl:text> </xsl:text> to get some line breaks in there. Hope that helps


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

July 31, 2014

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference