我需要從xml中提取值並將其存儲在屬性中。wso2 - 從屬性xml中獲取值
這是我的xml:
<?xml version="1.0" encoding="UTF-8"?>
<localEntry xmlns="http://ws.apache.org/ns/synapse" key="myVersion2">1</localEntry>
我發現類似的東西在互聯網:
<property name="myProp"
expression="get-property('registry','conf:repository/myVersion2.xml')"
scope="default"
type="OM"/>
<log level="custom">
<property name="myVersion2.localEntry" expression="$ctx:myVersion2//localEntry"/>
</log>
,但不工作..
我有這樣的錯誤:
TID: [0] [ESB] [2015-07-03 16:27:43,495] ERROR {org.apache.axis2.transport.base.threads.NativeWorkerPool} - Uncaught exception {org.apache.axis2.transport.base.threads.NativeWorkerPool}
org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: Premature end of file.
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
我需要什麼是要獲得價值,並把它放在一個屬性..
有人能幫我嗎?
謝謝
你ç
我需要的是讀/從XML – ClaudioM