• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

I am having trouble with an XML feed Can You Help?

Community Beginner ,
Nov 02, 2015 Nov 02, 2015

Copy link to clipboard

Copied

Any help would be appreciated

I have created a cf file as follows:

<cfxml variable="properties">

<cfquery name="GetPropertiesForFeed">Select PropertyReference, Price, Urbanisation, Location, PropertyType, FloorArea, Bedrooms, Bathrooms, Image1, Image2, Image3,

Image4, Image5, Image6, Image7, Image8, Description, Descriptionsp From Properties</cfquery>

<properties>

<cfloop query="GetPropertiesForFeed">

<property>

  <reference>#PropertyReference#</reference>

         <price>#Price#</price>

         <urbanisation>#Urbanisation#</urbanisation>

         <location>#Location#</location>

         <type>#PropertyType#</type>

         <area>#FloorArea#</area>

         <beds>#Bedrooms#</beds>

         <baths>#Bathrooms#</baths>

         <images>

         <image><url>http://primrose-realestate.com/propimages/#image1#</url></image>

         <image><url>http://primrose-realestate.com/propimages/#image2#</url></image>

         <image><url>http://primrose-realestate.com/propimages/#image3#</url></image>

         <image><url>http://primrose-realestate.com/propimages/#image4#</url></image>

         <image><url>http://primrose-realestate.com/propimages/#image5#</url></image>

         <image><url>http://primrose-realestate.com/propimages/#image6#</url></image>

         <image><url>http://primrose-realestate.com/propimages/#image7#</url></image>

         <image><url>http://primrose-realestate.com/propimages/#image8#</url></image>

         </images>

         <descriptions>

         <en>#Description#</en>

         <nl>#Descriptionsp#</nl>

  </descriptions>

</property>

</cfloop>

</properties>

</cfxml>

<!---<cfdump var=#properties#>--->

<cfset XMLText=ToString(properties)>

<cffile action="write" file="XMLfeed.xml" output="#XMLText#">

The xml file produced looks like this:

<properties>

<property>

<reference>#PropertyReference#</reference>

<price>#Price#</price>

<urbanisation>#Urbanisation#</urbanisation>

<location>#Location#</location>

<type>#PropertyType#</type>

<area>#FloorArea#</area>

<beds>#Bedrooms#</beds>

<baths>#Bathrooms#</baths>

<descriptions>

<en>#Description#</en>

<nl>#Descriptionsp#</nl>

</descriptions>

</property>

</properties>


The fields are not picking up the data.


Any suggestions please.

TOPICS
Getting started

Views

361

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 05, 2015 Nov 05, 2015

Copy link to clipboard

Copied

LATEST

Use either

<cfoutput query="GetPropertiesForFeed">

</cfoutput>

or else

<cfloop query="GetPropertiesForFeed">

<cfoutput>

</cfoutput>

</cfloop>

Somethng like

<cfquery name="GetPropertiesForFeed">

    Select PropertyReference, Price, Urbanisation, Location, PropertyType, FloorArea, Bedrooms, Bathrooms, Image1, Image2, Image3,

    Image4, Image5, Image6, Image7, Image8, Description, Descriptionsp

    From Properties

</cfquery>

<cfxml variable="properties">

<properties>

<cfoutput query="GetPropertiesForFeed">

<property>

  <reference>#PropertyReference#</reference>

         <price>#Price#</price>

         <urbanisation>#Urbanisation#</urbanisation>

         <location>#Location#</location>

         <type>#PropertyType#</type>

         <area>#FloorArea#</area>

         <beds>#Bedrooms#</beds>

         <baths>#Bathrooms#</baths>

         <images>

         <image><url>http://primrose-realestate.com/propimages/#image1#</url></image>

         <image><url>http://primrose-realestate.com/propimages/#image2#</url></image>

         <image><url>http://primrose-realestate.com/propimages/#image3#</url></image>

         <image><url>http://primrose-realestate.com/propimages/#image4#</url></image>

         <image><url>http://primrose-realestate.com/propimages/#image5#</url></image>

         <image><url>http://primrose-realestate.com/propimages/#image6#</url></image>

         <image><url>http://primrose-realestate.com/propimages/#image7#</url></image>

         <image><url>http://primrose-realestate.com/propimages/#image8#</url></image>

         </images>

         <descriptions>

         <en>#Description#</en>

         <nl>#Descriptionsp#</nl>

  </descriptions>

</property>

</cfoutput>

</properties>

</cfxml>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation