PHP Classes

Namespace attributes

Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  Namespace attributes  
Subject:Namespace attributes
Summary:Help me squash an xml bug in my class
Messages:4
Author:Michael A. Peters
Date:2009-03-21 18:38:15
Update:2009-03-23 18:45:16
 

  1. Namespace attributes   Reply   Report abuse  
Picture of Michael A. Peters Michael A. Peters - 2009-03-21 22:05:47
My class operates on a DOMDocument object including manipulation of attributes.

The way it handles attributes is currently broken for xhtml documents.

When I list all attributes, it gives me all attributes - whether they are namespace's or not - IE - xml:lang

However, when deciding an attribute should be modified, the namespace is dropped.

What I need is a way to determine whether or not the attribute uses a namespace so I can use the correct namespace functions (IE $element->setAttributeNS etc.) in cases where the attribute uses a namespace.

Anyone know how to do that?

For an example of where this bug bites me - see the filterAttributes() function of my cspfilter class submitted here (in the class file).

You can also view my class at http://www.clfsrpm.net/xss/

(can't easily download it there though, I want to use this site as main distribution point, but the source is viewable there as .phps)

Any help on this would be greatly appreciated.

There are 3 replies in this thread, which are not being displayed.
Browsing this forum thread replies is available only to premium subscribers.


Go to the premium subscriptions page to learn how to become a premium subscriber and have full access to this forum.