Tag Archives: XML

The SimpleXMLElement Magic Wonder World in PHP

PHP’s Simplexml ships with a lot of magic to simplify access to an XML documents element and attribute node values. Some criticize this and suggest to use the DOM library instead. The DOM library on the other hand, even it … Continue reading

Posted in Developing, Hakre's Tips, PHP Development, Pressed, The Know Your Language Department, Uncategorized | Tagged , , , , | Leave a comment

XPath Null Byte Injection in PHP

Back in July this year, in Mitigating XPath Injection Attacks in PHP I was writing about how to properly quote a string in PHP’s Xpath 1.0. The code presented there was based on the assumption that the resulting expression is … Continue reading

Posted in Hakre's Tips, PHP Development, Pressed, Surviving the Internet | Tagged , , , , , , , | Leave a comment

SimpleXML and JSON Encode in PHP – Part III and End

The previous two parts (Part I; Part II) did outline PHP’s standard behaviour when JSON encoding a SimpleXMLElement with json_encode(). As outlined this does not always fits the encoding needs and for some potential problems some workarounds have been showed. … Continue reading

Posted in Developing, PHP Development, PHP Development, Pressed, Tools | Tagged , , , , , | 1 Comment

SimpleXML and JSON Encode in PHP – Part II

In the previous post (Part I) I was giving a little overview for common woes turning a SimpleXMLElement into JSON when XML structural information is available that JSON is not capable to encode easily. The explanations given there were intended … Continue reading

Posted in Developing, PHP Development, PHP Development, Pressed, Tools | Tagged , , , , , | 2 Comments

SimpleXML and JSON Encode in PHP – Part I

With SimpleXMLElement it is often easy and looks like a very quick way to turn some XML into JSON. But not everything in PHP that has an easy interface works out of the box. In this three part series I’ll … Continue reading

Posted in Developing, PHP Development, PHP Development, Pressed, Tools | Tagged , , , , , | Leave a comment

PHP: XPath on HTML and XHTML

Christan Weiske has published a nice summarizing article with the same title. It contains some detailed information I haven’t found so far on the web so worth the link: PHP: XPath on HTML and XHTML. It also reminds me of … Continue reading

Posted in Developing, Hakre's Tips, PHP Development, Pressed | Tagged , , , , | Leave a comment

The Annotated XML Specification

The Annotated XML Specification (by Tim Bray; 1998)

Aside | Posted on by | Tagged , , | Leave a comment

SimpleXML Type Cheatsheet

A SimpleXMLElement can represent many different things, from an element, to a list of attributes or childelements. Sometimes it’s good to know how to find out, especially with the magic the extension comes with. The following is a table with … Continue reading

Posted in Hakre's Tips, PHP Development, Pressed, The Know Your Language Department | Tagged , , , , , , , , , | 1 Comment

Using Catalogs for Validation with PHP’s DOMDocument and Libxml2

DOMDocument schema and DTD validation in PHP can make use of libxml2’s Catalog support feature. A catalog is basically a XML file which contains information where to obtain the DTD and XSD schema from local disk. That is mapping a … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , | 3 Comments

XML_Query2XML

XML_Query2XML – Turn SQL into XML, PDO support. XML_Query2XML allows you to transform the records retrieved with one or more SQL SELECT queries into XML data. Very simple to highly complex transformations are supported. Is was written with performance in … Continue reading

Posted in Linked, Pressed, Tools | Tagged , , , | Leave a comment

QueryPath

QueryPath PHP Library to deal with XML/HTML esay CSS-like access and manipulation. Code available at Github.

Aside | Posted on by | Tagged , , , , | Leave a comment

RSS Feed: “An error has occurred; the feed is probably down. Try again later.”

WordPress RSS Feed Widget displays the following broad error message if it has problems to init or display a RSS feeds: An error has occurred; the feed is probably down. Try again later. This error message can have multiple reasons … Continue reading

Posted in PHP Development, Pressed | Tagged , , , , , , , , , , | 2 Comments

HTML5 is lame

Some say XHTML was lame. If so, HTML5 will be even more lame. There isn’t any DTD. Can you imagine? Is the HEAD element needed or not? And what about the BODY or HTML element? Who can answer these questions? … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment

XHTML5

Did you know that HTML5 extends from XHTML as well? I did not, it was Anne who made me curious. The quiz (see on the right) is still open.

Posted in Pressed | Tagged , , , , | Leave a comment

Meet Symphony

Symphony is a web-based content management system (CMS) that enables users to create and manage websites and web applications of all shapes and sizes—from the simplest of blogs to bustling news sites and feature-packed social networks.

Posted in Hakre's Tips, PHP Frameworks, Tools | Tagged , , , , , , | Leave a comment

QueryPath – Find your Way

QuerPath is another PHP library for working with XML and HTML. Licensed under LGPL/MIT it self-announces it with the following features:

Posted in Hakre's Tips, PHP Development, Tools | Tagged , , , , , , | Leave a comment

Line Endings in diverse Operating Systems

While coding some XML stuff lately (if you’re into PHP and XML, get a grip on FluentDOM if you have not already) I ran about some line ending issues. That [NEL] thingy was new to me, so I just wanted … Continue reading

Posted in Hakre's Tips, Pressed | Tagged , , , , , , , , | Leave a comment

Script and Style HTML/ XHTML Code Smells

Remember the time? Grabbing the copy of the HTML 2 RFC, reading through within the afternoon and you started to understand where this all might lead to after some time.  Seeing 3.2, 4.1 and XHTML 1.0 passing this finally ended up … Continue reading

Posted in Code Smells, Hacking The Core, Hakre's Tips, HTML/CSS Code Smells | Tagged , , , , , , , , , , | 2 Comments

FluentDOM

Keep the fluent flow: From time to time you find exceptional libraries out there. This posting is about one I got pointed with the finger on while being on a PHP unconf last year and I must admit that I … Continue reading

Posted in Hakre's Tips, Tools | Tagged , , , , , | 6 Comments