私は jQuery でこれをやっています:
@xmlOut = $('<rules />')
@xmlOut.attr('xsi:schemaLocation','test')
私はこれを得る:
<rules xsi:schemalocation='test'></rules>
「L」はもう大文字ではありません...
私は jQuery でこれをやっています:
@xmlOut = $('<rules />')
@xmlOut.attr('xsi:schemaLocation','test')
私はこれを得る:
<rules xsi:schemalocation='test'></rules>
「L」はもう大文字ではありません...
チケットがありますhttp://bugs.jquery.com/ticket/11166
または、目的のセッター メソッドを使用するために、属性フック (小文字の名前) を jQuery に追加することもできます。例えば:
$.attrHooks['viewbox'] = {
set: function(elem, value, name) {
elem.setAttributeNS(null, 'viewBox', value + '');
return value;
}
};
次に、.attr() を使用して大文字と小文字を区別する属性を設定できます。
$('svg').attr('viewBox', '0 0 100 100');
setAttribute
大文字と小文字を区別しないプレーンな Javascript を使用してみてください。
@xmlOut.get(0).setAttribute('xsi:schemLocation', 'test');