XML पार्स एक JSON ऑब्जेक्ट में प्राप्त

वोट
44

मैं एक स्ट्रिंग के रूप एक्सएमएल सामग्री से युक्त एक JSON वस्तु है।

<?xml version="1.0" encoding="UTF-8" standalone="no"?><serviceDescription><id>nitro:in-app:1fae04fd-79dd-4252-82fc-bcc6d04b8566:6a899379-5b96-4387-89ba-246d7c07ec48</id><defaultLocale>en</defaultLocale><transportId>HTTPServiceTransport</transportId><name xml:lang="en">http://localhost:9080/MFRestService/StreeboRuntime/myservice?x={"count":10}</name><description xml:lang="en"/><inbound><parameters><parameter><id>request-query-x</id><name xml:lang="en">x</name><description xml:lang="en"/><mandatory>true</mandatory><type>STRING</type></parameter></parameters><serviceMapping><constants><constant><id>service-description-body</id><value><![CDATA[{"name":"http://localhost:9080/MFRestService/StreeboRuntime/myservice?x={\\\\"count\\\\":10}","request-method":"GET","original-url":"http://localhost:9080/MFRestService/StreeboRuntime/myservice?x={\\\\"count\\\\":10}","sampleInputJSON":"","request-url":"http://localhost:9080/MFRestService/StreeboRuntime/myservice","sampleOutputJSON":"[{\\\\"Count\\\\":\\\\"9\\\\"},{\\\\"Count\\\\":\\\\"9\\\\"},{\\\\"Count\\\\":\\\\"9\\\\"},{\\\\"Count\\\\":\\\\"9\\\\"},{\\\\"Count\\\\":\\\\"9\\\\"},{\\\\"Count\\\\":\\\\"9\\\\"},{\\\\"Count\\\\":\\\\"9\\\\"},{\\\\"Count\\\\":\\\\"9\\\\"},{\\\\"Count\\\\":\\\\"9\\\\"},{\\\\"Count\\\\":\\\\"9\\\\"}]","fixed-request-parameters":[],"mappable-request-parameters":[{"id":"request-query-x","name":"x","required":true,"index":0}],"mappable-response-parameters":[]}]]></value></constant><constant><id>request-url</id><value><![CDATA[http://localhost:9080/MFRestService/StreeboRuntime/myservice]]></value></constant><constant><id>request-method</id><value><![CDATA[GET]]></value></constant><constant><id>original-url</id><value><![CDATA[http://localhost:9080/MFRestService/StreeboRuntime/myservice?x={"count":10}]]></value></constant></constants><mapping><mapping source="constant:request-url" sourceType="STRING" target="transport:request-url" targetType="STRING"/><mapping source="constant:original-url" sourceType="STRING" target="transport:original-url" targetType="STRING"/><mapping source="constant:service-description-body" sourceType="STRING" target="transport:service-description-body" targetType="STRING"/><mapping source="constant:request-method" sourceType="STRING" target="transport:request-method" targetType="STRING"/><mapping source="parameter:request-query-x" sourceType="STRING" target="transport:request-query-x" targetType="STRING"/></mapping></serviceMapping></inbound><outbound><parameters><parameter><id>items</id><name xml:lang="en">items</name><description xml:lang="en"/><mandatory>false</mandatory><type>LIST</type><parameters><parameter><id>Count</id><name xml:lang="en">Count</name><description xml:lang="en"/><mandatory>false</mandatory><type>STRING</type></parameter></parameters></parameter></parameters><serviceMapping><mapping><mapping source="transport:response-entity" sourceType="JSON" target="parameter:items" targetType="STRING"><mapping sourceRef="Count" sourceType="JSON" target="parameter:Count" targetType="STRING"/></mapping></mapping></serviceMapping></outbound></serviceDescription>

यह कई के लिए & lt, & gt है, & quot और इस तरह के और सभी वर्ण हैं। मैं उन्हें जावा का उपयोग कर वास्तविक प्रतीकों के साथ बदलने के लिए प्रबंधन कैसे करूँ।

मेरे अंतिम लक्ष्य JSON में इस XML सामग्री परिवर्तित करने के लिए है।

20/02/2018 को 05:33
उपयोगकर्ता
अन्य भाषाओं में...                            

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more