|
Posted by Sanders Kaufman on 09/24/07 09:52
"Kai Schlamp" <stroncococcus@gmx.de> wrote in message
news:1190554783.204395.89330@w3g2000hsg.googlegroups.com...
> Hello!
>
> I am thinking of a way to define my own tags like <my_tag> or {my_tag}
> or something like that, and later substitute these with real html
> code.
HTML doesn't allow you to make your own tags - although it handles them
well.
It sounds like XML/XSLT is what you're looking for here.
XML, on the other hand, is almost nothing *but* user-defined tags.
XSLT is the XML-equivalent of style-sheets, and lets you specify how the
elements will be displayed.
If you do that then, from the user's perspective, it'll appear just like any
HTML page - while still being W3C-compliant.
>
> For example, lets say I have a code snippet:
> {content_title}The Title{/content_title}
>
> Before echoing it out, I would do the following substitution:
> {content_title} = <table class="title_table"><th><td>
> {/content_title} = </td></th></table>
>
> This is a very simple example. But in a big site with many of the same
> components, such a scheme would make sense to alter the page layout
> pretty quick.
> Are there some helper classes or functions, or perhaps a whole package
> already for such a task?
> Or should I simply create the content with my tags and then subsitute
> all my tags with the real html code via preg_repalce function before
> printing it out? If yes, are there any better performance options
> instead of using preg_replace?
>
> Kai
>
[Back to original message]
|