xsltradeditor

How to add "<p>" as a tag value at XSLT


Here is the example code in XSLT:

<telerik:EditorParagraph Title="Normal" Tag="<p>"></telerik:EditorParagraph>

I get this error "XML Element is not closed".

I am following Telerik's advice to change paragraph style values. The link is here Using the Paragraphs Collection Declaratively.

I define Radeditor via XSLT.

Thanks in advance!


Solution

  • An XSLT file has to be well-formed XML - to include a less-than sign in an attribute value you must represent it as an entity reference:

    <telerik:EditorParagraph Title="Normal" Tag="&lt;p>">
    

    (you can, and most examples will, also replace the greater-than sign with &gt; but this is not strictly required - the only things that must be escaped are <, &, double quotes within a double-quoted attribute and single quotes within a single-quoted attribute).