Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: html tags within meta tags allowed?

From: Andy Dingley <dingbat@----------.--->
To: NULL
Date: 1/6/2005 3:07:00 AM
On Wed, 05 Jan 2005 02:35:46 -0500, Donald Firesmith
<donald_firesmith@h...> wrote:

>Are html tags allowed within meta tags? 

Learn the difference between tags, elements and attributes.


> Specifically, if I have html 
>tags within a <definition> tag within XML, can I use the definition as 
>the content within the <meta content="description> tag?  

Let's rephrase that as "Can I represent the content of one element as
the content of an attribute of another element ?"

In that case, then yes you can - with the proviso that you need to be
careful about the meaning of "represent". The content models of
elements and attributes are different, so you can't just "place" that
of any element into an attribute, as it might contain the "<>"
characters that mark out a tag (and are not permitted in attributes).

But you can represent this, with a process known as entity encoding.
The "awkward" characters <>&' are replaced with their entity encoded
representations of &lt; &gt; &amp; & &apos;   

Note that you have now done something "outside" of XML.  XML does
_not_  (and cannot) know what you've done, or that the contents of the
destination element's attribute should be de-encoded on reading. It's
a simple process to do, but it's not simple for the recipient to
"know" that it ought to do this. there is _no_ way for "an XML tool"
to recognise that it ought to - after all, the content is well-formed
XML either way, it's just a question of interpreting its meaning.

A common case where this is done is with RSS (although that's just put
into another element, not an attribute)  Because most of the RSS specs
are so poorly written, there is great confusion here.
http://diveintomark.org/archives/2004/02/04/incompatible-rss 

This is thus why in your literal example you _can't_ do what you're
trying to do. Yes you could do it, but no you shouldn't.  It is not
"meaningful" (in the sense of understanding, not the sense of XML) to
place encoded content, or anything resembling HTML or XML tags into
the content attribute of a HTML <meta> element. The readers of it (of
which there are very few) just aren't expecting to see it in there and
they won't know what to do with it. They certainly won't have the
action you're optimistically hoping for, sensible though that might
have been (had we all know what the game was and how to play along).



-- 
Smert' spamionam


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent