2012-01-24 63 views
0

我有我的代碼CDATA不工作在軌道上

XML解析錯誤如下XML的:沒有很好地形成

地點:http://localhost:3000/api/client?client=test1

1號線,列1111:

<?xml version="1.0" encoding="UTF-8"?> 
<application> 
<name><![CDATA[TESTapp2]]></name> 
<application-identifier>wac-8c28afa4-0f6e-11e1-8885-7071bc62c7bc</application-identifier> 
<clients> 
    <pricepoint id="1" name=<![CDATA[TEST-price]]> currency="dollar" locale="la" country="india" price="50" text="this is a TEST" receipt="oi120934" operator-reference="1213w" operator-id="1"></pricepoint></pricepoints><product-image></product-image> 
</clients> 
</application> 

<name><![CDATA[TESTapp2]]></name> this is working 
<name=\"[CDATA[TESTapp2]]\"> this is not working,throws encoding error 

回答

0

AFAIK,禁止使用CDATA作爲屬性值。 CDATA只能用於文本節點。