vbscript - Appending strings to value of attribute in XML tag -
i need replace value of attribute ciphers
in xml tag <connector>
<connector sslenabledprotocols="sslv2hello,tlsv1,tlsv1.1,tlsv1.2" ciphers="tls_ecdhe_ecdsa_with_aes_256_cbc_sha384,tls_ecdhe_rsa_with_aes_256_cbc_sha384,tls_dhe_rsa_with_aes_256_cbc_sha256,tls_ecdhe_ecdsa_with_aes_256_cbc_sha,tls_ecdhe_rsa_with_aes_256_cbc_sha,tls_dhe_rsa_with_aes_256_cbc_sha,tls_dhe_dss_with_aes_256_cbc_sha,tls_ecdhe_ecdsa_with_aes_128_cbc_sha256,tls_ecdhe_rsa_with_aes_128_cbc_sha256,tls_dhe_rsa_with_aes_128_cbc_sha256,tls_dhe_dss_with_aes_128_cbc_sha256,tls_ecdhe_ecdsa_with_aes_128_cbc_sha,tls_ecdhe_rsa_with_aes_128_cbc_sha,tls_dhe_rsa_with_aes_128_cbc_sha,tls_ecdhe_ecdsa_with_aes_256_gcm_sha384,tls_ecdhe_ecdsa_with_aes_128_gcm_sha256,tls_ecdhe_rsa_with_aes_256_gcm_sha384,tls_ecdhe_rsa_with_aes_128_gcm_sha256,tls_dhe_rsa_with_aes_128_gcm_sha256,tls_dhe_dss_with_aes_128_gcm_sha256" />
the problem that, can see, string long, , replace equally long one. i'm using vbscript replacing (i'm replacing another, shorter, string), have problem because of length of string. here code have:
dim objxmldoc dim objxmlelement dim objxmlnodelist dim oxml set oxml = createobject("microsoft.xmldom") oxml.load(dir) if 0 = oxml.parseerror dim sxpath : sxpath = "//service/connector[@port=""3170""]" dim ndfnd : set ndfnd = oxml.selectsinglenode(sxpath) if ndfnd nothing wscript.echo "oops" else ndfnd.getattributenode("ciphers").value = wscript.arguments(2) & wscript.arguments(3) & wscript.arguments(4) & wscript.arguments(5) oxml.save(dir) end if end if
i had split string 4 variables pass @ command line. there way append value of attribute?
right
subscript out of range
Comments
Post a Comment