Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#14891 closed bug (notabug)

$.parseXML exception on nested script tag

Reported by: akoskm Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:

Description

The following XML is valid according to http://validator.w3.org/:

<?xml version="1.0" encoding="UTF-8"?>
<definitions id="Definition"
         xmlns:tns="http://www.jboss.org/drools">
    <process processType="Private"
         isExecutable="true"
         id="com.sample.bpmn"
         name="Sample Process"
         tns:packageName="defaultPackage" >
        <scriptTask id="_2" name="Sample Script" scriptFormat="http://www.java.com/java">
            <script>person.id</script>
        </scriptTask>
    </process>
</definitions>

however $.parseXML fails to parse it and throws the following exception:

Uncaught Error: Invalid XML: <?xml version="1.0" encoding="UTF-8"?>
<definitions id="Definition"
         xmlns:tns="http://www.jboss.org/drools">
    <process processType="Private"
         isExecutable="true"
         id="com.sample.bpmn"
       ...<omitted>...id  

If I remove the child <script></script> inside scriptTask the parsing works again.

Change History (3)

comment:1 Changed 6 years ago by akoskm

JSFiddle demonstrating the error.

comment:2 Changed 6 years ago by dmethvin

Resolution: notabug
Status: newclosed

Did you actually LOOK at the input to .parseHTML, or the console? Please ask for help on a forum.

comment:3 Changed 6 years ago by akoskm

Thank you for looking into this.

I haven't look at .parseHTML. It makes a slight different, indeed. Instead of throwing an exception it silently fails and returns an incomplete XML docum.

I really hope that I'm missing something at this is the intended behavior of parseXML and parseHTML.

Please take a look at this fiddle and the console output: http://jsfiddle.net/k7m6w/

Note: See TracTickets for help on using tickets.