Skip to content

Failure with custom namespace elements (PHP lib) #131

Open
@GoogleCodeExporter

Description

@GoogleCodeExporter
Using a custom namespaced element (apart from the hardcoded SVG and MathML 
namespaces) causes a failure with DOMDocument::createElementNS(). For 
instance the following piece of HTML:

<html xmlns:fb="http://www.facebook.com/2008/fbml">
<body>
  <fb:login-button>Facebook Connect</fb:login-button>
</body>
</html>

It causes the following warning (which should be an error, since the 
function returns nothing):

PHP Warning:  DOMDocument::createElementNS(): Namespace Error in 
TreeBuilder.php on line 3055

The problem is that TreeBuilder doesn't care of the XMLNS declarations in 
the HTML tag when creating elements, and it never uses the defined 
namespace URL when building elements. Thus, when calling 
DOMDocument::createElementNS() for 'fb:login_button' it tries to create a 
namespaced element using null as the namespaceURI, which causes a failure.

I attached a patch, which fixes the problem.

Original issue reported on code.google.com by Ysbadda...@gmail.com on 5 Jan 2010 at 3:26

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions