Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8750501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:52:36+00:00 2026-06-13T12:52:36+00:00

I need a template-engine for a project, that parses sgml-content and converts user-defined tags

  • 0

I need a template-engine for a project, that parses sgml-content and converts user-defined tags like <ext:grid />. In nearly every case, the input-content is valid. A common problem is the link-generator. The link-generator produces & instead of &amp; which is the main cause of my parsing-problems. I cant change this behavior, because the output of that generator is used in many other situations where the links are required to have an & instead of &amp;.

I have tried DOMDocument, SimpleXML and xml_parser. They all exit on entity problems. Any ideas? All I want is, that this “problem” gets simply ignored by the parser.

Where is a test-template:

<template xmlns:grid="templates/grid" xmlns:std="templates/std">
    <std:header text="Overview" type="h1" />
    <grid:base width="100%">
        <grid:columns>
        <grid:body>
            <?php foreach($products as $product): /* @var $product Dfm_Shop_Model_Product */ ?>
            <grid:row selectable="1">
                <grid:cell>
                    <div><?php echo $this->esc($product->getTitle()) ?></div>
                </grid:cell>
                <grid:cell>
                    <a href="<?php env()->http()->to(array('controller' => 'Dfm_Shop_Controller_Products', 'method' => 'showEdit')) ?>"><std:img src="icons/pencil.png" hint="Edit" /></a>
                </grid:cell>
            </grid:row>
            <?php endforeach ?>
        </grid:body>
    </grid:base>
</template>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T12:52:37+00:00Added an answer on June 13, 2026 at 12:52 pm

    Can you just search-replace your & to &amp; before trying to parse the document?


    Edit: Just to add for the completeness, there’s for example QueryPath that can handle invalid tags, too.

    According to the thread linked above, libxml functions should’ve also worked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a simple template engine, that only does variable names replacement (I don't
I'm developing a Struts2 application that uses Sitemesh as template engine. What I need
I finding a php template engine allow user defined function only or it allow
I need very basic template engine, which is incapsulated in single class. So I
At the moment i'm using EJS template Engine but I need to convert it
I've defined a DataTemplate in a ResourceDictionary. The template need some data (for populating
I'm writing an XSLT template that need to output a valid xml file for
I need a link in django template which turns into logout if user is
I need to create a content presenter template and integrate it into webcenter. But
I need to achieve some kind of extensibility for a custom project template. Having

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.