Highlighted

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

Community Beginner ,
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

303

Likes

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

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

Community Beginner ,
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

304

Likes

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
Nov 02, 2015 0
BKBK LATEST
Adobe Community Professional ,
Nov 05, 2015

Copy link to clipboard

Copied

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>

Likes

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
Reply
Loading...
Nov 05, 2015 1