reddem0n
10-20-2008, 08:38 PM
I'm having an issue getting an xml to load up properly. What I am basically doing is querying the database for jobs, then loading it up on the xml so I can send it to rss feeds. The problem is, and based on my research it looks like the xml can't parse anything that has  . I am fairly new to how this works, below is the code with some parts of it mainly the sql queries snipped out due to security reasons. I read somewhere that you can put in 3 .ent in a doctype feed code above and have it so browsers can parse it correctly, but I had very little success with that.
Here is the error message:
XML Parsing Error: undefined entity
Location: juju.xml
Line Number 13, Column 130:
<description><p style="margin: 0in 0in 0pt"><span>Provides technical and organizational support for the Director of Marketing, including but not limited to data entry, vendor trafficking, daily redemptions and project tracking.<span> </span>Responsible for maintaining databases and creating queries/reports.<span> </span>Assists in evaluating and analyzing database information and making recommendations.</span></p></description>
-----------------------------------------------------------------------------------------------------------------------------------------------^
Here is the .cfm file that updates the xml file whenever I run it. Remember I deleted the cf queries, don't let that distract you.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<CFQUERY NAME="Getjob" DATASOURCE="#ODBC_DATASOURCE#">
DELETED
</CFQUERY>
<cfquery name="GetCats" datasource="#ODBC_DATASOURCE#">
DELETED
</cfquery>
<CFQUERY NAME="GetTypes" DATASOURCE="#ODBC_DATASOURCE#">
DELETED
</CFQUERY>
<CFQUERY NAME="NumJobs" DATASOURCE="#ODBC_DATASOURCE#">
DELETED
</CFQUERY>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Running Batch Query.....</title>
<link rel="stylesheet" href="CSS/shell.css" />
</head>
<body>
<div id="main">
<cfset jobs='
<positionfeed
xmlns="http://www.juju.com/employers/positionfeed-namespace/"
xmlns:xsi="http://www.w3.org/TR/xmlschema-1/"
xsi:schemaLocation="http://www.juju.com/employers/positionfeed-namespace/ http://www.juju.com/employers/positionfeed.xsd"
version="2006-04">
<source>Title</source>
<sourceurl>company url here/</sourceurl>
<feeddate>#DateFormat("# Now()#", "yyyy-mm-dd")#</feeddate>'>
<cfoutput query="Getjob">
<cfset description = replace(description, "<[^>]*>", "", "all")>
<cfset description = ReReplace(description, " ", " ", "all")>
<cfset jobs='#jobs#
<job id="#jobid#">
<employer> </employer>
<title>#title#</title>
<description>#description#</description>
<postingdate>#date_entered#</postingdate>
<location>
<city>#location#</city>
<state>#statecode#</state>
<zip>#zipcode#</zip>
<nation>#countrycode#</nation>
</location>
<jobsourceurl>job source url</jobsourceurl>
</job>
'>
</cfoutput>
<cfset jobs='#jobs#</positionfeed>'>
<cffile action="write" addnewline="yes" charset="utf-8" file="D:\\Clients\job source url" output="#jobs#" fixnewline="no">
</div>
</body>
</html>
Any advice would be very much appreciated.
Here is the error message:
XML Parsing Error: undefined entity
Location: juju.xml
Line Number 13, Column 130:
<description><p style="margin: 0in 0in 0pt"><span>Provides technical and organizational support for the Director of Marketing, including but not limited to data entry, vendor trafficking, daily redemptions and project tracking.<span> </span>Responsible for maintaining databases and creating queries/reports.<span> </span>Assists in evaluating and analyzing database information and making recommendations.</span></p></description>
-----------------------------------------------------------------------------------------------------------------------------------------------^
Here is the .cfm file that updates the xml file whenever I run it. Remember I deleted the cf queries, don't let that distract you.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<CFQUERY NAME="Getjob" DATASOURCE="#ODBC_DATASOURCE#">
DELETED
</CFQUERY>
<cfquery name="GetCats" datasource="#ODBC_DATASOURCE#">
DELETED
</cfquery>
<CFQUERY NAME="GetTypes" DATASOURCE="#ODBC_DATASOURCE#">
DELETED
</CFQUERY>
<CFQUERY NAME="NumJobs" DATASOURCE="#ODBC_DATASOURCE#">
DELETED
</CFQUERY>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Running Batch Query.....</title>
<link rel="stylesheet" href="CSS/shell.css" />
</head>
<body>
<div id="main">
<cfset jobs='
<positionfeed
xmlns="http://www.juju.com/employers/positionfeed-namespace/"
xmlns:xsi="http://www.w3.org/TR/xmlschema-1/"
xsi:schemaLocation="http://www.juju.com/employers/positionfeed-namespace/ http://www.juju.com/employers/positionfeed.xsd"
version="2006-04">
<source>Title</source>
<sourceurl>company url here/</sourceurl>
<feeddate>#DateFormat("# Now()#", "yyyy-mm-dd")#</feeddate>'>
<cfoutput query="Getjob">
<cfset description = replace(description, "<[^>]*>", "", "all")>
<cfset description = ReReplace(description, " ", " ", "all")>
<cfset jobs='#jobs#
<job id="#jobid#">
<employer> </employer>
<title>#title#</title>
<description>#description#</description>
<postingdate>#date_entered#</postingdate>
<location>
<city>#location#</city>
<state>#statecode#</state>
<zip>#zipcode#</zip>
<nation>#countrycode#</nation>
</location>
<jobsourceurl>job source url</jobsourceurl>
</job>
'>
</cfoutput>
<cfset jobs='#jobs#</positionfeed>'>
<cffile action="write" addnewline="yes" charset="utf-8" file="D:\\Clients\job source url" output="#jobs#" fixnewline="no">
</div>
</body>
</html>
Any advice would be very much appreciated.