Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#16827 closed defect (invalid)

dojo/dom-construct toDom with xml string (wsdl document)

Reported by: tsofist Owned by: Eugene Lazutkin
Priority: undecided Milestone: tbd
Component: HTML Version: 1.8.3
Keywords: Cc:
Blocked By: Blocking:


    require(["dojo/dom-construct"], function (dc) {
        var node = dc.toDom("<definitions xmlns='' xmlns:xs='' name='IewsServerservice' targetNamespace='urn:webservice-electrasoft-ru' xmlns:tns='urn:webservice-electrasoft-ru' xmlns:soap='' xmlns:soapenc='' xmlns:mime='' xmlns:ns1='' xmlns:ns2='urn:webservice-electrasoft-ru:types-ewsServerIntf'><types><xs:schema targetNamespace='' xmlns=''><xs:complexType name='TWideStringDynArray'><xs:complexContent><xs:restriction base='soapenc:Array'><xs:sequence/><xs:attribute ref='soapenc:arrayType' n1:arrayType='xs:string[]' xmlns:n1=''/></xs:restriction></xs:complexContent></xs:complexType></xs:schema><xs:schema targetNamespace='urn:webservice-electrasoft-ru:types-ewsServerIntf' xmlns='urn:webservice-electrasoft-ru:types-ewsServerIntf'><xs:simpleType name='TewsLoginResult'><xs:restriction base='xs:string'><xs:enumeration value='lrSuccess'/><xs:enumeration value='lrMustChangePassword'/><xs:enumeration value='lrRestrictedAccess'/><xs:enumeration value='lrInternetAccessDenied'/><xs:enumeration value='lrAccessDenied'/><xs:enumeration value='lrUserAccountClosed'/><xs:enumeration value='lrInvalidConnection'/></xs:restriction></xs:simpleType></xs:schema></types></definitions>");
        console.log((new XMLSerializer()).serializeToString(node));

Element with the attribute name = 'TewsLoginResult?' has one sub-element, which has invested 7 elements. Method toDom somehow those same seven elements are nested. This is evident with XMLSerializer.

Expected block:

      <xs:simpleType name='TewsLoginResult'>
        <xs:restriction base='xs:string'>
          <xs:enumeration value='lrSuccess'/>
          <xs:enumeration v

Change History (4)

comment:1 Changed 7 years ago by tsofist

bugtracker problem

repeat: Expected block:

<xs:simpleType name='TewsLoginResult'>

<xs:restriction base='xs:string'>

<xs:enumeration value='lrSuccess'/> <xs:enumeration value='lrMustChangePassword'/> <xs:enumeration value='lrRestrictedAccess'/> <xs:enumeration value='lrInternetAccessDenied'/> <xs:enumeration value='lrAccessDenied'/> <xs:enumeration value='lrUserAccountClosed'/> <xs:enumeration value='lrInvalidConnection'/>



Result block:

<xs:simpletype name="TewsLoginResult">

<xs:restriction base="xs:string">

<xs:enumeration value="lrSuccess">

<xs:enumeration value="lrMustChangePassword">

<xs:enumeration value="lrRestrictedAccess">

<xs:enumeration value="lrInternetAccessDenied">

<xs:enumeration value="lrAccessDenied">

<xs:enumeration value="lrUserAccountClosed">

<xs:enumeration value="lrInvalidConnection"/>









I have not mentioned the problems with IE.

In this case, as i understand,


will always return 0. Do not tell me how you can get all the elements with namespace prefixes?

Sorry for my English.

Thanks for any solution!

comment:2 Changed 7 years ago by bill

Component: Doc parserHTML
Owner: changed from Colin Snover to Eugene Lazutkin

comment:3 Changed 7 years ago by Colin Snover

Resolution: invalid
Status: newclosed

toDom is for HTML, not XML. It injects the markup into an HTML document. If you want to create XML, use dojox/xml/parser.

Version 0, edited 7 years ago by Colin Snover (next)

comment:4 in reply to:  3 Changed 7 years ago by tsofist

Replying to csnover:

toDom is for HTML, not XML. It injects the markup into an HTML document. If you want to create an XML DOM from an XML string, use dojox/xml/parser.

I have a lot of work just with the analysis of XML. dojox/xml/parser unfortunately critical of IE. You have to dodge a lot to enjoy and engine queries and save the document can be serialized to a string. As a result, many things from the dojox rewritten for better compatibility. But apparently even this is not enough. I think the later is able to combine all of this into a specialized mechanism for working with XML. Thank you, and on this one.

Last edited 7 years ago by tsofist (previous) (diff)
Note: See TracTickets for help on using tickets.