Content count

Joined

Last visited

Community Reputation

About porton

@justsomeguy You confuse between pre-formatted and plain text. <pre> in HTML can contain any formatting tags (<em>, <strong>, etc.)
I decide to raise an exception in this case, because other ways do not work for me.

I want to extend XHTML with tags like
<pre syntax:format="python">
# Some Python code
def f():
pass
</pre>
The text in <pre> tag should be "enriched" with <span> HTML tags with classes, to highlight the syntax of the text inside <pre>.
What my code should do if the processed <pre> tag already contains some XML tags? Example:
<pre syntax:format="python">
# Some Python code
def f():
<em>pass</em>
</pre>
The variants I thought of:
first remove the tags (like <em> in the above example)
leave the content of the <pre> tag as is (just remove syntax:format argument)
terminate my pipeline processing with an error

@Ingolme I know that XML does not have macros.
But it is quite possible to create an XML namespace which could act like a macro language for XML.
I started this topic because I need to decide whether to create a new namespace (and its semantics) for this purpose, or whether there is already designed such a thing, so that I would not need to create new namespaces but use existing ones.

Is there an XML namespace for creating "macroses" (they receive arguments and create XML code from an XML template)?
Also, what about conditionals (if-then-else) and probably loops (as in functional programming languages)?