我需要从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