Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure with custom namespace elements (PHP lib) #131

Open
GoogleCodeExporter opened this issue Mar 22, 2015 · 4 comments
Open

Failure with custom namespace elements (PHP lib) #131

GoogleCodeExporter opened this issue Mar 22, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 5 Jan 2010 at 3:26

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant