![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: html tags within meta tags allowed? >Thread Next - Re: html tags within meta tags allowed? Re: html tags within meta tags allowed?To: NULL Date: 1/5/2005 11:25:00 PM Andy Dingley wrote: > 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 < > & & ' > > 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). > > > Okay. Then what are you supposed to do in the following situation? Assume that you have over 1000 items that you want to document using XML instead of HTML. For the foreseeable future, you will use them to generate webpages primarily for human consumption. You are mainly converting from HTML to XML so that you can build tools that help you select and tailor the contents of these 1000 items. Each of these items has one or more of several kinds of parts. These parts vary from item to item and you want to be able to pull out the content of these variable parts into XML so that you can use XSL to capture the common standard structure and contents. However, the variable parts are more complex than simple prices, model numbers, etc. They have enough variablity to include links, optional sublists, and other information that requires proper formatting that appears not to be able to be captured in a single XSL. That is why you want to include the HTML tags. Specifically, check out the 1,100+ free open source reusable process components within the OPEN Process Framework repository at www.donald-firesmith.com. If you look at several examples of the same metatype, you will quickly see the kind of variability I am talking about. So far, I have created activity DTD and XSL files and an XML file for the requirements engineering activity. I am sure that they are probably not the world's best examples of XSL and XML style. But I am not sure how to improve them and still retain the desired look and feel of the resulting XHML webpages. I would be happy to send anyone who is interested the three example files and would greatly appreciate any recommendations, especially if these recommendations are specific and even more so if they come back in the form of modified DTD, XSL, and/or XML files. The examples I see in the books are always very simple and far more standardized that the HTML that I am trying to transform into XML. By the way, the OPEN Process Framework Repository Organization is a non-profit volunteer organization with no funding to pay for a consultant to do the conversion for us. That is why we are relying on groups such as this one to help us do a good job. Donald Firesmith Chair, OPEN Process Framework Repository Organization | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
