title: HTML Template Language for PHP
body: <p>I'm making php content management system with simple template integration and I can't find any good template language. Currently I'm using xml templates and parsing them with php DOM. Here's how template looks like:</p>
  
  <pre><code>&lt;div class="one_fourth"&gt;
      &lt;h4 class="section-header"&gt;&lt;span&gt;&lt;CMS_STRING type="string" name="title" title="Title" /&gt;&lt;/span&gt;&lt;/h4&gt;
      &lt;p&gt;&lt;CMS_STRING type="string" name="body" title="Body text" tooltip="" /&gt;&lt;/p&gt;
      &lt;p&gt;&lt;CMS_STRING type="link" name="link" title="Link" /&gt;&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In php I parse all CMS_STRING tags with DOM getElementsByTagName and then I pull value from database for visitors or generate editable inputs for admin.</p>
  
  <p>One problem with xml is that I can't use tags in attributes for example:</p>
  
  <pre><code>&lt;a href="&lt;CMS_STRING name="url" /&gt;"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>Another problem is with php DOM quote escaping. It looks ugly and unreadable. Let's say I want to put JSON in attribute for localized title:</p>
  
  <pre><code>&lt;CMS_STRING type="string" name="title" title="{&amp;quot;enUS&amp;quot;:&amp;quot;Title&amp;quot;,&amp;quot;enGB&amp;quot;:&amp;quot;Title&amp;quot;}" /&gt;
  </code></pre>
  
  <p>So what other template language I could use here? I also need it to support xml (for example getting CMS_STRING inner html). All template languages that I found are premade with caching engines and all other things that I don't need. I just need a simple language with a parser, I'll handle other stuff by myself.</p>
  
  <p>Thanks.</p>