@@ -604,17 +604,21 @@ export class WSDL {
604
604
}
605
605
if ( key !== nsAttrName ) {
606
606
const value = params [ key ] ;
607
- const prefixedKey = ( isParts ? '' : nsPrefix ) + key ;
608
- const attributes = [ ] ;
609
- if ( typeof value === 'object' && value . hasOwnProperty ( this . options . attributesKey ) ) {
610
- const attrs = value [ this . options . attributesKey ] ;
611
- for ( const n in attrs ) {
612
- attributes . push ( ' ' + n + '=' + '"' + attrs [ n ] + '"' ) ;
607
+ if ( key === this . options . xmlKey ) {
608
+ parts . push ( this . objectToXML ( { [ key ] : value } , null , nsPrefix , nsURI ) ) ;
609
+ } else {
610
+ const prefixedKey = ( isParts ? '' : nsPrefix ) + key ;
611
+ const attributes = [ ] ;
612
+ if ( typeof value === 'object' && value . hasOwnProperty ( this . options . attributesKey ) ) {
613
+ const attrs = value [ this . options . attributesKey ] ;
614
+ for ( const n in attrs ) {
615
+ attributes . push ( ' ' + n + '=' + '"' + attrs [ n ] + '"' ) ;
616
+ }
613
617
}
618
+ parts . push ( [ '<' , prefixedKey ] . concat ( attributes ) . concat ( '>' ) . join ( '' ) ) ;
619
+ parts . push ( ( typeof value === 'object' ) ? this . objectToXML ( value , key , nsPrefix , nsURI ) : xmlEscape ( value ) ) ;
620
+ parts . push ( [ '</' , prefixedKey , '>' ] . join ( '' ) ) ;
614
621
}
615
- parts . push ( [ '<' , prefixedKey ] . concat ( attributes ) . concat ( '>' ) . join ( '' ) ) ;
616
- parts . push ( ( typeof value === 'object' ) ? this . objectToXML ( value , key , nsPrefix , nsURI ) : xmlEscape ( value ) ) ;
617
- parts . push ( [ '</' , prefixedKey , '>' ] . join ( '' ) ) ;
618
622
}
619
623
}
620
624
parts . push ( [ '</' , nsPrefix , name , '>' ] . join ( '' ) ) ;
0 commit comments