Bug Tracker

Modify

Ticket #9418 (closed bug: invalid)

Opened 2 years ago

Last modified 2 years ago

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:
Blocking: Blocked by:

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.

Change History

comment:1 Changed 2 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.