Many content management systems and programming languages use special XML tags to allow authors to dynamically include other content or achieve various behaviours. In some situations these special tags may need to be used as the value for attributes. As this is not valid HTML, editors like EditLive! and other tools may have difficulty parsing the content. The example in this article is the “Component” tag used in IBM Lotus Web Content Management (ILWCM), however the approach applies to most other special processing tags.
<Component name="myComponent" format="href" />
If we want to use this to generate a hyperlink, it would need to be used in the href attribute:
<a href="<Component name="myComponent" format="href" />">Link text</a>
This particular layout won’t work reliably, because the quotes within the Component tag would mark the end of the href attribute. Fortunately, it’s easy to avoid this by using single quotes for either the href attribute or for the attributes in the custom tag. So either:
<a href='<Component name="myComponent" format="href" />'>Link text</a>
<a href="<Component name='myComponent' format='href' />">Link text</a>
Both those forms will be correctly parsed by EditLive! and most other HTML tools.