I have set of xml elements like this:
<item code="<HTML_CODE>" />
For example:
<items>
<item code='<a href="http://google.com">Google</a>' />
<item code='<a href="http://google.com">Google</a>' />
</items>
All special characters in code attribute are escaped (< – <, > – &rt;, etc)
Is there any way to append content of code attributes to page DOM and render it, as html?
I mean, in case of my examples, after all, I need two hyperlinks on the page.
UPDATE
I have:
<?xml version='1.0' encoding='utf-8'?>
<root>
<materials>
<items>
<item project_id="3" code="<a href="http://google.com">Text</a>" txt_id="text1" text="«Королев&
#1089;тво» — браузерная ролевая онлайн-игра" />
<item project_id="3" code="Texttextetx" />
</items>
</materials>
</root>
I need:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
...anything here..
</head>
<body>
<a href="http://google.com">Text</a>
Texttextetx <!-- I know, this is bad but this is example-->
</body>
1 Answer