Skip to main content

Bug Tracker

Side navigation

#9418 closed bug (invalid)

Opened May 25, 2011 11:32AM UTC

Closed June 01, 2011 05:36PM UTC

Elements with hyphens cannot be created in an XML document

Reported by: Hancoque Owned by:
Priority: undecided Milestone: 1.next
Component: unfiled Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:
Description

Creating new elements in an XML document with hyphens in their names doesn't work using $(...). The regex string saved in the rsingleTag variable uses only \\w to evaluate whether createElement() is to be used or not and the alternative method apparently doesn't work with XML documents.

http://jsfiddle.net/GCu9G/

A solution would be to replace \\w with [\\w\\-] in the regex string.

Attachments (0)
Change History (1)

Changed June 01, 2011 05:36PM UTC by dmethvin comment:1

resolution: → invalid
status: newclosed

Don't try to parse XML with $(...) because it isn't meant or documented to do that. Try $.parseXML() instead.