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 3660470
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:12:38+00:00 2026-05-19T01:12:38+00:00

I appear to be reading in circles, or perhaps am simply not grasping some

  • 0

I appear to be reading in circles, or perhaps am simply not grasping some of the concepts here. I’m reworking a set of PHP template classes, that previously used some fancy regular expressions to combine and duplicate documents and regions of documents, producing an output page. An example of my previous method (for the sake of completeness):

<div id="myId">
    <!-- {{ region:myRegion }} -->
        <div class="myClass">
            <h1>{{ var:myHeading }}</h1>
            <h2>{{ var:myDatetime format:datetime(Y-m-d H:i:s) }}</h2>
            <p>{{ var:myText format:maxLength(300) }}</p>
        </div>
    <!-- {{ region:myRegion }} -->
</div>

Anyways, it works quite well, but I really want to move it up to the next level, and figured that would logically be extending the markup itself, becoming something like:

<div id="myId">
    <zuq:region name="myRegion">
        <div class="myClass">
            <h1><zuq:var name="myHeading" /></h1>
            <h2><zuq:var name="myDatetime" format="datetime" param="Y-m-d H:i:s" /></h2>
            <p><zuq:var name="myText" format="maxLength" param="300" /></p>
        </div>
    </zuq:region>
</div>

I’ve been reading the W3 specifications, and even the W3Schools tutorials on various relevant technologies, like XML Schema for writing the template specifications. Obviously I want to keep everything well formed and valid in all namespaces used. Primarily this will be used mixed with XHTML markup.

Anyways, can anyone point me towards some good reading on understanding XML namespaces, the limits and best practices of mixing namespaces, and most importantly I suppose, working with PHP/DOM/XML. Are there any critical flaws in my approach here that anyone can see? It doesn’t appear that PHP has a particularly powerful implementation for working with namespaced markup documents, whether its through DOMDocument (and brethren) or SimpleXML.

Any advice, reading material suggestions, or criticism is welcomed!


Edit: In case anyone is curious, elements from the zuq namespace should not be present at the time of output rendering, having been parsed and otherwise removed. However, beyond the good practice of keeping documents valid, I intend on taking advantage of the markup present in the templates, so that via a CMS WYSIWYG editor, administrators can quickly edit pages.

  • 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-05-19T01:12:39+00:00Added an answer on May 19, 2026 at 1:12 am

    Namespaces are really a very simple concept that somehow gets blown out of proportion. See http://www.xml.com/pub/a/1999/01/namespaces.html for a good tutorial on XML Namespaces.

    As for dealing with namespaced XML from PHP, the DOM interface works very well. For example, you can getElementsByTagNameNS, you can lookupNamespaceURI, look up a given URI’s prefix…

    Beyond that, the question feels incredibly subjective and vague, so if you care to edit it or post further questions that refine it, perhaps you can get some more concrete help.

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

Sidebar

Related Questions

It does not appear in the UTI Image Content Types. Also, if this is
There does not appear to be any good software to mount an FTP to
I'm reading through a fantastic article on the .NET Configuration namespace (found here )
I have been reading through other questions on here and there is something that
i've been reading some lisp code and came across this section, didn't quite understand
I am reading a tutorial and there are some parts I dont understand: public
This might not appear like a programming question, but inherently deals with code. I
I've been reading some feature request-style threads in Atlassian's own JIRA install on how
After reading several other blog posts and articles (references found below) there appear to
I was wondering why reading from memory is not thread-safe. Among what I've seen

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.