We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6699
    • 11 Posts
    Hi Guys,

    Been trawling the forums for a possible answer, but haven’t come across anyone experiencing the problem I’m having as yet. I’m trying to create an XML file using Ditto (to feed data to a Flash file), but it seems that Ditto is inserting PHP/HTML comments into the file which is preventing the XML from being parsed.

    The page is set to output as text/xml and contains the following:

    <?xml version="1.0" encoding="utf-8"?>
    <products>
    [!Ditto? &parents=`8` &tpl=`navXML` !]
    </products>
    


    The chunk used to format the output is as follows:

    <product id="[+id+]" label="[+pagetitle+]" image="/assets/images/flash-menu/[+alias+].jpg" url="[~[+id+]~]" />


    In the output, everything appears as normal, except that there seem to be some included comments:

    <?xml version="1.0" encoding="utf-8"?>
    <products>
    <?
    // Use the following syntax $param = 'value';
    ?>
    <product id="18" label="Shogun Stool" image="/assets/images/flash-menu/shogun-stool.jpg" url="the-collection/shogun-stool/" />
    <product id="17" label="Butterfly Stool" image="/assets/images/flash-menu/butterfly-stool.jpg" url="the-collection/butterfly-stool/" />
    <product id="15" label="Heron Chair" image="/assets/images/flash-menu/heron-chair.jpg" url="the-collection/heron-chair/" />
    </products>
    


    Flash will not read the XML data, and FireFox throws the following error:

    XML Parsing Error: not well-formed
    Location: http://xxx.dev/flashnav2.xml
    Line Number 3, Column 3:
    <?
    --^
    


    Anyone know what the

    <?
    // Use the following syntax $param = 'value';
    ?>
    


    is all about?
      • 36592
      • 970 Posts
      Are you using Ditto 2.0.2 ?
      I think it comes from assets/snippets/ditto/configs/default.config.php
      Changing the first line to
      <?php

      would make it disappear.
        • 6699
        • 11 Posts
        Solved.

        Fantastic, thanks so much for your help.