9 Replies Latest reply on Aug 30, 2007 10:56 AM by Günter Schenk

    Recordset xml export WITH html tags

      Hi there,
      I am trying a rather simple thing (I hope) but cannot figure it out how to do it.

      I created a dynamic xml (.php) file using the export recordset as xml behaviour. The generated xml works fine when I use spry to display it. The downside is that html tags are converted to something like this (I understand that these are the greater then and lesser then signs used in html):

      <strong>fringilla</strong>

      In the html document where I use spry to display this xml, the < etc are converted back to <  and >, but the html is not rendered.

      I tried cdata, but somehow cannot get this to work. I also cannot get dsSpecials.setColumnType("quote_tekst", "html"); to render the xml as correct html.

      Can someone tell me how to do this? Database and xml are both utf-8.

      Kind regards and big thanks in advance if you can help (it is really appreciated ;-D),

      Ben
        • 1. Re: Recordset xml export WITH html tags
          Hi Ben,

          I'm trying to do the same 'simple' thing - I have the master/detail spry regions set, but the detail region is displaying unrendered html as looks like you're getting. Any luck with a solution?

          I've tried just displaying in a div:
          {dsList::detail}


          and tried echoing it:


          Any ideas? Thanks a million!
          • 2. Re: Recordset xml export WITH html tags
            Günter Schenk Level 4
            Hi folks,

            ADDT´s "Export to XML" feature doesn´t use CDATA at all -- it generates simple ... syntax, that´s it.

            If you need extra formatting on certain nodes, you´ll have to do that manually and outside ADDT anyways. Fortunately that´s not too complicated, and there´s a great tutorial on Adobe Labs explaining how to convert database queries to XML -- you´ll see examples for ColdFusion, ASP and PHP:

            http://labs.adobe.com/technologies/spry/samples/utils/query2xml.html

            Günter Schenk
            Adobe Community Expert, Dreamweaver
            • 3. Re: Recordset xml export WITH html tags
              Level 1
              Hi Günter,<br /><br />Thanks so much for the info.  I have been diligently trying to use CDATA and read the generated XML, but still I'm not seeing the HTML text rendereed in my detail section.<br /><br />The XML is setup from my mySQL data as:<br /> <br /><?xml version="1.0" encoding="UTF-8"?><br /><CurrentSpecials><br />     <special><br />          <name> Caribbean Sun </name><br />          <detail> <h1>special deal!!</h1><p style="color:#00f;"><strong>Join us</strong>!</h1> </detail><br />          <expire> 2007-08-31 00:00:00 </expire><br />          <rating> highest </rating><br />     </special><br />...<br /><br />and I want the detail to render in my div (or I'll add a table/textarea...) as the html indicates.  I'm not having any luck w/ using CDATA for it - it's probably just me - I'm just starting out with this stuff.  Any pointers in the right direction? I'm getting the detail as {dsList:detail} and somehow need to say - this is html.  I've tried using javascript and php to render it.<br /><br />I could I guess just echo the detail on a mouseclick without a spry but didn't want to have to do all the implementation myself - I wanted to take advantage of dreamweaver's functionality! <br /><br />Thanks so much for looking at this - any help is so much appreciated!!<br />Thanks a million again!
              • 4. Re: Recordset xml export WITH html tags
                Level 1
                Hi Günter,<br /><br />Thanks so much for the info.  I have been diligently trying to use CDATA and read the generated XML, but still I'm not seeing the HTML text rendereed in my detail section.<br /><br />The XML is setup from my mySQL data as:<br /> <br /><?xml version="1.0" encoding="UTF-8"?><br /><CurrentSpecials><br />     <special><br />          <name> Caribbean Sun </name><br />          <detail> <h1>special deal!!</h1><p style="color:#00f;"><strong>Join us</strong>!</h1> </detail><br />          <expire> 2007-08-31 00:00:00 </expire><br />          <rating> highest </rating><br />     </special><br />...<br /><br />and I want the detail to render in my div (or I'll add a table/textarea...) as the html indicates.  I'm not having any luck w/ using CDATA for it - it's probably just me - I'm just starting out with this stuff.  Any pointers in the right direction? I'm getting the detail as {dsList:detail} and somehow need to say - this is html.  I've tried using javascript and php to render it.<br /><br />I could I guess just echo the detail on a mouseclick without a spry but didn't want to have to do all the implementation myself - I wanted to take advantage of dreamweaver's functionality! <br /><br />Thanks so much for looking at this - any help is so much appreciated!!
                • 5. Re: Recordset xml export WITH html tags
                  Level 1
                  Sorry about that, don't know what happened in that last post..formatting I guess, here's the whole reply - xml enclosed w/ a pre - thanks again.<br /><br />Hi Günter,<br /><br />Thanks so much for the info.  I have been diligently trying to use CDATA and read the generated XML, but still I'm not seeing the HTML text rendereed in my detail section.<br /><br />The XML is setup from my mySQL data as:<br /><pre> <br /><?xml version="1.0" encoding="UTF-8"?><br /><CurrentSpecials><br />     <special><br />          <name> Caribbean Sun </name><br />          <detail> <h1>special deal!!</h1><p style="color:#00f;"><strong>Join us</strong>!</h1> </detail><br />          <expire> 2007-08-31 00:00:00 </expire><br />          <rating> highest </rating><br />     </special><br />...<br /></pre><br />and I want the detail to render in my div (or I'll add a table/textarea...) as the html indicates.  I'm not having any luck w/ using CDATA for it - it's probably just me - I'm just starting out with this stuff.  Any pointers in the right direction? I'm getting the detail as {dsList:detail} and somehow need to say - this is html.  I've tried using javascript and php to render it.<br /><br />I could I guess just echo the detail on a mouseclick without a spry but didn't want to have to do all the implementation myself - I wanted to take advantage of dreamweaver's functionality! <br /><br />Thanks so much for looking at this - any help is so much appreciated!!
                  • 6. Re: Recordset xml export WITH html tags
                    Level 1
                    Rest of message - so sorry!  It's not liking seeing the cdata notation.  Hopefully a moderator will remove the previous incomplete posts.<br /><br />I tried to show an excerpt of my xml file - one of the elements is a field that describes html data:<br /><detail> <h1>my text</h1><br /><br />Which I would like the detail section to display as rendered html in my div (or I'll add a table/textarea...) as the html indicates.  I'm not having any luck w/ using CDATA for it - it's probably just me - I'm just starting out with this stuff.  Any pointers in the right direction? I'm getting the detail as {dsList:detail} and somehow need to say - this is html.  I've tried using javascript and php to render it.<br /><br />I could I guess just echo the detail on a mouseclick without a spry but didn't want to have to do all the implementation myself - I wanted to take advantage of dreamweaver's functionality! <br /><br />Thanks so much for looking at this - any help is so much appreciated!!
                    • 7. Re: Recordset xml export WITH html tags
                      Günter Schenk Level 4
                      Hi emmtqg, (is that a real name ? :-))

                      >>
                      I have been diligently trying to use CDATA and read the generated XML, but still I'm not seeing the HTML text rendereed in my detail section
                      >>

                      Regretfully that´s beyond my knowledge and would best be asked on the SPRY forums -- all I can say is, that you´ll need "some" extra stuff like CDATA or whatever else is required, and using ADDT´s "XML Export" makes practically no sense when one ore more XML nodes need that.

                      Günter Schenk
                      Adobe Community Expert, Dreamweaver
                      • 8. Re: Recordset xml export WITH html tags
                        Level 1
                        Thanks so much Günter, I'll try there. Sounds like it should be so easy! But then again, I didn't bother to read the quick editor doc here ;) That's supposed to be easy!!

                        -Real name disguised - it's Liz!
                        • 9. Re: Recordset xml export WITH html tags
                          Günter Schenk Level 4
                          >>
                          -Real name disguised - it's Liz!
                          >>

                          oh that´s your name ? think I´ll stick to emmtqg :-)

                          >>
                          Sounds like it should be so easy!
                          >>

                          I think so, and I´m absolutely sure that - after 3 times - you´ll be able to modify that "manual" example for your own XML generating purposes without any problems. Once you get the procedure, it´s a very easy and flexible thing -- trust me, even I understood it :-)

                          Cheers,
                          Günter Schenk
                          Adobe Community Expert, Dreamweaver