我无法将xml标记放置在我想要的位置

时间:2019-11-28 15:32:17

标签: php xml

我得到下面方法的xml输出。 但是我需要在xml输出中添加代码。

以这种方式添加时,它位于 String text = Java_AES_Cipher.encrypt("123sadsad","123","vishal"); Log.i("encrypt_Text is = ", "" + text); public static String encrypt(String key, String iv, String data) { try { if (key.length() < Java_AES_Cipher.CIPHER_KEY_LEN) { int numPad = Java_AES_Cipher.CIPHER_KEY_LEN - key.length(); for(int i = 0; i < numPad; i++){ key += "0"; //0 pad to len 16 bytes } } else if (key.length() > Java_AES_Cipher.CIPHER_KEY_LEN) { key = key.substring(0, CIPHER_KEY_LEN); //truncate to 16 bytes } IvParameterSpec initVector = new IvParameterSpec(iv.getBytes("UTF-8")); SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes("UTF-8"), "AES"); Cipher cipher = Cipher.getInstance(Java_AES_Cipher.CIPHER_NAME); cipher.init(Cipher.ENCRYPT_MODE, skeySpec, initVector); byte[] encryptedData = cipher.doFinal((data.getBytes())); String base64_EncryptedData = Base64.getEncoder().encodeToString(encryptedData); String base64_IV = Base64.getEncoder().encodeToString(iv.getBytes("UTF-8")); return base64_EncryptedData + ":" + base64_IV; } catch (Exception ex) { ex.printStackTrace(); } return null; } 标签下。

https://prnt.sc/q3eg7l

<cac: TaxScheme>

重要的是它在<cac:TaxTotal> <cbc:TaxAmount currencyID="USD">0.00</cbc:TaxAmount> <cac:TaxSubtotal> <cbc:TaxableAmount currencyID="USD">0.00</cbc:TaxableAmount> <cbc:TaxAmount currencyID="USD">0.00</cbc:TaxAmount> <cac:TaxCategory> <cac:TaxScheme> <cbc:Name>TAX</cbc:Name> <cbc:TaxTypeCode>0015</cbc:TaxTypeCode> </cac:TaxScheme> <cbc:TaxExemptionReasonCode>301</cbc:TaxExemptionReasonCode> <cbc:TaxExemptionReason>description</cbc:TaxExemptionReason> </cac:TaxCategory> </cac:TaxSubtotal> </cac:TaxTotal> 标记上。

<cac: TaxScheme>

也就是说,它应该位于<cac:TaxTotal> <cbc:TaxAmount currencyID="USD">0.00</cbc:TaxAmount> <cac:TaxSubtotal> <cbc:TaxableAmount currencyID="USD">0.00</cbc:TaxableAmount> <cbc:TaxAmount currencyID="USD">0.00</cbc:TaxAmount> <cac:TaxCategory> <cbc:TaxExemptionReasonCode>301</cbc:TaxExemptionReasonCode> <cbc:TaxExemptionReason>description</cbc:TaxExemptionReason> <cac:TaxScheme> <cbc:Name>TAX</cbc:Name> <cbc:TaxTypeCode>0015</cbc:TaxTypeCode> </cac:TaxScheme> </cac:TaxCategory> </cac:TaxSubtotal> </cac:TaxTotal> 标记的下方。

php代码

<cac: TaxCategory>

0 个答案:

没有答案