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

The entity "nbsp" was referenced, but not declared.

Enthusiast ,
Oct 22, 2010 Oct 22, 2010

I'm trying to create xml fron a database table.

This is the code to create the xml file:

<cfxml variable="xPageContent">
    <PageContent>
        <cfoutput query="qStuff">
            <page>
                 <id>#qStuff.PageContentID#</id>
                <description>#qStuff.PageContentDesc#</description>
                <header>#qStuff.PageContentHeader#</header>
            </page>
        </cfoutput>
    </PageContent>
</cfxml>

If I take out this line <header>#qStuff.PageContentHeader#</header>

it works fine.  The header entrys in the database are paragraphs with html code in them here is one of them

<p><a href="3d-floor-plans.html"> 3D floor plans</a><br /> <a href="Interior-Stills.html"> Interior Stills</a><br /> <a href="Exterior-Stills.html"> Exterior Stills</a><br /> <a href="Animation.html"> Animation</a><br /> <a href="Interactive-3D.html"> Interactive 3D</a><br />  </p>

a <cfdump> will output all selected table entries without problem.  It's only when try to reated the xml file that I have a problem.

4.1K
Translate
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

correct answers 1 Correct answer

Community Expert , Oct 23, 2010 Oct 23, 2010

I'm not sure I understand your question. You can use CDATA to pass whatever HTML you want to pass within an XML element value.

Dave Watts, CTO, Fig Leaf Software

http://www.figleaf.com/

http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on

GSA Schedule, and provides the highest caliber vendor-authorized

instruction at our training centers, online, or onsite.

Read this before you post:

http://forums.adobe.com/thread/607238

Translate
Enthusiast ,
Oct 22, 2010 Oct 22, 2010

I forgot to mention Im using CF8 and getting data from a mssql database running on a windows server.

Translate
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 ,
Oct 22, 2010 Oct 22, 2010

You need to escape any XML metacharacters from your output. When generating XML text nodes, you can either use a CDATA block:

<header><![CDATA[#qStuff.PageContentHeader#]]></header>

or the XmlFormat function:

<header>#XmlFormat(qStuff.PageContentHeader)#</header>

Dave Watts, CTO, Fig Leaf Software

http://www.figleaf.com/

http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on

GSA Schedule, and provides the highest caliber vendor-authorized

instruction at our training centers, online, or onsite.

Read this before you post:

http://forums.adobe.com/thread/607238

Dave Watts, Eidolon LLC
Translate
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
Enthusiast ,
Oct 23, 2010 Oct 23, 2010

Thanks that's great but I still have a problem.  I need to retain the html code some how.  I'm going to be passing it to flash textfield set to html text.  Maybe I can't use xml?

Translate
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 ,
Oct 23, 2010 Oct 23, 2010

You can include HTML within XML elements (not attributes) by using CDATA:

<somexml><![CDATA[<html><head><title>this is an HTML page</title></head><body>this is an HTML page</body></html>]]></somexml>

Dave Watts, CTO, Fig Leaf Software

http://www.figleaf.com/

http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on

GSA Schedule, and provides the highest caliber vendor-authorized

instruction at our training centers, online, or onsite.

Read this before you post:

http://forums.adobe.com/thread/607238

Dave Watts, Eidolon LLC
Translate
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
Enthusiast ,
Oct 23, 2010 Oct 23, 2010

That's interesting but I to actually pass on the html as it exist in the database.

This was passed on using <cfdump> :

<p><a href="3d-floor-plans.html"> 3D floor  plans</a><br /> <a  href="Interior-Stills.html"> Interior Stills</a><br />  <a href="Exterior-Stills.html"> Exterior Stills</a><br  /> <a href="Animation.html"> Animation</a><br />  <a href="Interactive-3D.html"> Interactive 3D</a><br  />  </p>

Translate
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 ,
Oct 23, 2010 Oct 23, 2010

I'm not sure I understand your question. You can use CDATA to pass whatever HTML you want to pass within an XML element value.

Dave Watts, CTO, Fig Leaf Software

http://www.figleaf.com/

http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on

GSA Schedule, and provides the highest caliber vendor-authorized

instruction at our training centers, online, or onsite.

Read this before you post:

http://forums.adobe.com/thread/607238

Dave Watts, Eidolon LLC
Translate
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
Enthusiast ,
Oct 23, 2010 Oct 23, 2010
LATEST

I'm sorry I get it now it works perfectly.  I have a very thick skull it's probably radition proof but it's very resistant to ideas too.

Translate
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