Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Character Encoding PT Question
Tim__D
In my PT I have the follwing line:
<td width="519" bgcolor="#D9D8D8">  </td>
This part of the template is valid markup so I dont use <![CDATA[ ]]> here.
On the resulting page this is what I get.
<td width="519" bgcolor="#D9D8D8">Â </td>
Any ideas why this is the case and how I can fix it?
Find more posts tagged with
Comments
JonathonG
Since you didn't CDATA that line, the pt engine actually interpreted the   and converted it to its character equivalent. So, to fix it, either CDATA that line, or xml-escape that entity (&#160
.
Jonathon
Interwoven Developer
Allstate, Inc.
Tim__D
The docs I've read about PT's state that valid xml does not need to have CDATA tags. The line and the characters are valid xml. Why would the PT try and convert the characters?
Tim__D
Is there another technique I could use to include well formed XHTML in my PT's without having to use CDATA around all my encoded characters?
JonathonG
I gave you one technique - XML-escape the entities by replacing & with & The other is CDATA. I don't think there is any other option (though someone else may have an idea). See below.
As for your other question, you are correct that valid XML does not need to have CDATA tags. But that doesn't mean that non-CDATA stuff will be completely left alone. Technically, the PT engine isn't "converting" your entity. But, the TPL is considered an XML file and is run through and XML parser. When the XML parser sees an entity it expands it to its definition. That's why adding an extra escape should do the trick. NOTE: This isn't particular to TPL's. You have the same issue with any XSLT engine as well.
Having written that, one more thing to try comes to mind. Try to use the "loose" form of tpl instead of the strict form. That is, start your tpl with <iw_pt/>. Perhaps that will make the XML parser ignore the rest of the file.
Jonathon
Interwoven Developer
Allstate, Inc.
Tim__D
Thanks for your ideas. Funny, I've written xml documents for use with XSLT before but never had this issue with the resulting web pages. I'll go with <![CDATA[[]]>
Thanks for your time....
JonathonG
No problem.
On the XML/XSLT thing. The problem isn't in the xml document, its actually in the XSLT. If you think of the DCR as the xml document and the PT as the XSLT, it might help. I actually have had headaches with trying to have the XSLT output a literally encoded entity (not one that has been read from the xml document, but one that is actually "hard-coded" into the XSLT).
Jonathon
Interwoven Developer
Allstate, Inc.