Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Visual format problem
suresh_anand
I am trying to use preserve chars tags.
I want to preserve "<" and ">"
So i used like this in visualformatconfig.xml
<clean charencode="utf-8" cr="cr" lf="lf" showonsize="5000" preferfonttag="false" reducetags="true"/>
<preservechars value="<>"/>
<!-- publish options are "minimal", "cleanhtml", "xhtml" -->
<standard autoclean="true" publish="cleanhtml">
<style publishstyles="false" href="[eWebEditProPath]/ektnormal.css" preservewordstyles="true"/>
<cmd name="cmdfontcolor" key="fontcolor" ref="cmdFC" enabled="true"/>
<command name="cmdfontname" style="list" maxwidth="12" enabled="true">
<caption localeRef="cmdFNm"/>
<tooltiptext localeRef="cmdFNm"/>
But still "<" is getting converted to "<" and ">" is converted to ">"
How to use this?
Find more posts tagged with
Comments
LooseCannon
The following is from
www.w3schools.com
Escape Characters
Illegal XML characters have to be replaced by entity references.
If you place a character like "<" inside an XML element, it will generate an error because the parser interprets it as the start of a new element. You cannot write something like this:
<message>if salary < 1000 then</message>
To avoid this, you have to replace the "<" character with an entity reference, like this:
<message>if salary < 1000 then</message>
There are 5 predefined entity references in XML:
< < less than
> > greater than
& & ampersand
' ' apostrophe
" " quotation mark
Entity references always start with the "&" character and end with the ";" character.
Note: Only the characters "<" and "&" are strictly illegal in XML. Apostrophes, quotation marks and greater than signs are legal, but it is a good habit to replace
suresh_anand
I know that basic very well.
But what is this preservechar tag is doing .....?
I just need to make it work
JonathonG
The preservechar tag keeps VisualFormat from encoding the character. However, Templating will encode the special XML characters (<,>,&) when saving so that the DCR is valid XML.
Jonathon
Interwoven Architecture Consultant
suresh_anand
Correct..I just want to preservechars while using VisualFormat.
So pls tell me how to use this tag
with example
JonathonG
Well, I don't have a real world example, but it looked like you specified the tag just like the example given in the docs. How do you know it's not working? Are you looking at the "View as HTML" view? or are you looking in the DCR?
Jonathon
Interwoven Architecture Consultant
suresh_anand
Yes ,i am looking at "View as HTML"
I type in WYSWG as <test> and switch to View HTML it shows as <test>
I also verified in DCR it also looks same....
The document that describes usage of preservechars is not upto the standard
LooseCannon
Your XML syntax is incorrect:
Change:
<clean charencode="utf-8" cr="cr" lf="lf" showonsize="5000" preferfonttag="false" reducetags="true"/>
<preservechars value="<>"/>
To:
<clean charencode="utf-8" cr="cr" lf="lf" showonsize="5000" preferfonttag="false" reducetags="true">
<preservechars value="<>"/>
</clean>