2
我必須將Excel文件中的數據作爲XML發送到Web服務。表中的數據看起來有點像這樣: see example of table here!將包含XML的字符串添加到使用Java的SOAPElement中
第一行始終包含列的數據的XML標記。大多數數據列只包含字符串,但有些包含xml。那些子節點對Web服務接受數據很重要。
我正在使用SOAP,爲每列創建一個新的SOAPElement,其中每一行都是新的SOAP請求。
SOAPElement newElement = body.addChildElement(tagForThisColumn);
newElement.addTextNode(stringValueOfCell);
這完全適用的字符串值,但逃脫的SOAPElement所有「<」和「>」使用XML細胞。
我已經搜索的答案,發現類似問題的一些解決方案,但沒有適合我的..