首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >字符串到XML - OSB

字符串到XML - OSB
EN

Stack Overflow用户
提问于 2014-05-30 12:08:28
回答 1查看 2.6K关注 0票数 0

我正在尝试将文件的内容转换为XML,我可以在代理中处理它。问题是,我使用的是inlinedXML函数,它应该返回一个我可以使用的结构,使用XPaths和XQueries,但是当我在下面的XML结构上应用它时,我得到了´|>。

代码语言:javascript
复制
<SpecialChars>
  <ListOfChars>
    <Char>´</Char>
    <Char>|</Char>
  </ListOfChars>
</SpecialChars>

当我试图在其上使用XPath表达式时,我会得到以下错误:

代码语言:javascript
复制
`<`May 29, 2014 12:02:43 PM BRT> `<`Error> `<`OSB Kernel> `<`BEA-382004> `<`Failed to process request message for service ProxyService OSB/test: com.bea.wli.sb.stages.StageException: line 1, column 7: {err}XP0006: "´| ({http://www.w3.org/2001/XMLSchema}string)": bad value for type node
com.bea.wli.sb.stages.StageException: line 1, column 7: {err}XP0006: "´| ({http://www.w3.org/2001/XMLSchema}string)": bad value for type node
  at com.bea.wli.sb.stages.expressions.xquery.XQueryExprExecutor.executeJavaObject(XQueryExprExecutor.java:138)
  at stages.logging.runtime.LogRuntimeStep.processMessage(LogRuntimeStep.java:123)
  at com.bea.wli.sb.pipeline.debug.DebuggerRuntimeStep.processMessage(DebuggerRuntimeStep.java:74)
  at com.bea.wli.sb.stages.StageMetadataImpl$WrapperRuntimeStep.processMessage(StageMetadataImpl.java:346)
  at com.bea.wli.sb.stages.impl.SequenceRuntimeStep.processMessage(SequenceRuntimeStep.java:33)
  Truncated. see log file for complete stacktrace
Caused By: weblogic.xml.query.exceptions.XQueryTypeException: line 1, column 7: {err}XP0006: "´| ({http://www.w3.org/2001/XMLSchema}string)": bad value for type node
  at weblogic.xml.query.iterators.AbstractIterator.reportUserError(AbstractIterator.java:95)
  at weblogic.xml.query.iterators.AbstractIterator.reportUserError(AbstractIterator.java:134)
  at weblogic.xml.query.runtime.typing.SeqTypeMatching.fetchNext(SeqTypeMatching.java:189)
  at weblogic.xml.query.iterators.GenericIterator.hasNext(GenericIterator.java:133)
  at weblogic.xml.query.runtime.navigation.ChildPath.fetchNext(ChildPath.java:159)
  Truncated. see log file for complete stacktrace
>
`<`May 29, 2014 12:02:43 PM BRT> `<`Error> `<`OSB Kernel> `<`BEA-380003> `<`Exception on TransportManagerImpl.receiveMessage, com.bea.wli.sb.stages.StageException: line 1, column 7: {err}XP0006: "´| ({http://www.w3.org/2001/XMLSchema}string)": bad value for type node
com.bea.wli.sb.stages.StageException: line 1, column 7: {err}XP0006: "´| ({http://www.w3.org/2001/XMLSchema}string)": bad value for type node
  at com.bea.wli.sb.stages.expressions.xquery.XQueryExprExecutor.executeJavaObject(XQueryExprExecutor.java:138)
  at stages.logging.runtime.LogRuntimeStep.processMessage(LogRuntimeStep.java:123)
  at com.bea.wli.sb.pipeline.debug.DebuggerRuntimeStep.processMessage(DebuggerRuntimeStep.java:74)
  at com.bea.wli.sb.stages.StageMetadataImpl$WrapperRuntimeStep.processMessage(StageMetadataImpl.java:346)
  at com.bea.wli.sb.stages.impl.SequenceRuntimeStep.processMessage(SequenceRuntimeStep.java:33)
  Truncated. see log file for complete stacktrace
Caused By: weblogic.xml.query.exceptions.XQueryTypeException: line 1, column 7: {err}XP0006: "´| ({http://www.w3.org/2001/XMLSchema}string)": bad value for type node
  at weblogic.xml.query.iterators.AbstractIterator.reportUserError(AbstractIterator.java:95)
  at weblogic.xml.query.iterators.AbstractIterator.reportUserError(AbstractIterator.java:134)
  at weblogic.xml.query.runtime.typing.SeqTypeMatching.fetchNext(SeqTypeMatching.java:189)
  at weblogic.xml.query.iterators.GenericIterator.hasNext(GenericIterator.java:133)
  at weblogic.xml.query.runtime.navigation.ChildPath.fetchNext(ChildPath.java:159)
  Truncated. see log file for complete stacktrace
>
`<`May 29, 2014 12:02:43 PM BRT> `<`Warning> `<`EJB> `<`BEA-010065> `<`MessageDrivenBean threw an Exception in onMessage(). The exception was:
javax.ejb.EJBException: nested exception is: com.bea.wli.sb.transports.TransportException: line 1, column 7: {err}XP0006: "´| ({http://www.w3.org/2001/XMLSchema}string)": bad value for type node.
javax.ejb.EJBException: nested exception is: com.bea.wli.sb.transports.TransportException: line 1, column 7: {err}XP0006: "´| ({http://www.w3.org/2001/XMLSchema}string)": bad value for type node
  at com.bea.wli.sb.transports.poller.listener.PolledMessageListenerMDB.__onMessage(PolledMessageListenerMDB.java:55)
  at com.bea.wli.sb.transports.poller.listener.PolledMessageListenerMDB.access$000(PolledMessageListenerMDB.java:31)
  at com.bea.wli.sb.transports.poller.listener.PolledMessageListenerMDB$1.run(PolledMessageListenerMDB.java:41)
  at com.bea.wli.sb.transports.poller.listener.PolledMessageListenerMDB$1.run(PolledMessageListenerMDB.java:39)
  at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
  Truncated. see log file for complete stacktrace
>
`<`May 29, 2014 12:02:43 PM BRT> `<`Warning> `<`EJB> `<`BEA-010065> `<`MessageDrivenBean threw an Exception in onMessage(). The exception was:
javax.ejb.EJBException: nested exception is: com.bea.wli.sb.transports.TransportException: line 1, column 7: {err}XP0006: "´| ({http://www.w3.org/2001/XMLSchema}string)": bad value for type node.
javax.ejb.EJBException: nested exception is: com.bea.wli.sb.transports.TransportException: line 1, column 7: {err}XP0006: "´| ({http://www.w3.org/2001/XMLSchema}string)": bad value for type node
  at com.bea.wli.sb.transports.poller.listener.PolledMessageListenerMDB.__onMessage(PolledMessageListenerMDB.java:55)
  at com.bea.wli.sb.transports.poller.listener.PolledMessageListenerMDB.access$000(PolledMessageListenerMDB.java:31)
  at com.bea.wli.sb.transports.poller.listener.PolledMessageListenerMDB$1.run(PolledMessageListenerMDB.java:41)
  at com.bea.wli.sb.transports.poller.listener.PolledMessageListenerMDB$1.run(PolledMessageListenerMDB.java:39)
  at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
  Truncated. see log file for complete stacktrace
>
******************** START DUMP GlobalOperationsPOJO **********************
`<xml-fragment xmlns:con="http://www.bea.com/wli/domain/config"><con:monitoring>true</con:monitoring><con:reporting>true</con:reporting><con:logging>true</con:logging><con:sla-alerting>true</con:sla-alerting><con:pipeline-alerting>true</con:pipeline-alerting><con:result-caching>true</con:result-caching></xml-fragment>`
******************** END DUMP GlobalOperationsPOJO **********************
`<`May 29, 2014 12:02:43 PM BRT> `<`Error> `<`OSB Kernel> `<`BEA-382004> `<`Failed to process request message for service ProxyService OSB/test: com.bea.wli.sb.stages.StageException: line 1, column 7: {err}XP0006: "´| ({http://www.w3.org/2001/XMLSchema}string)": bad value for type node
com.bea.wli.sb.stages.StageException: line 1, column 7: {err}XP0006: "´| ({http://www.w3.org/2001/XMLSchema}string)": bad value for type node
  at com.bea.wli.sb.stages.expressions.xquery.XQueryExprExecutor.executeJavaObject(XQueryExprExecutor.java:138)
  at stages.logging.runtime.LogRuntimeStep.processMessage(LogRuntimeStep.java:123)
  at com.bea.wli.sb.pipeline.debug.DebuggerRuntimeStep.processMessage(DebuggerRuntimeStep.java:74)
  at com.bea.wli.sb.stages.StageMetadataImpl$WrapperRuntimeStep.processMessage(StageMetadataImpl.java:346)
  at com.bea.wli.sb.stages.impl.SequenceRuntimeStep.processMessage(SequenceRuntimeStep.java:33)
  Truncated. see log file for complete stacktrace
Caused By: weblogic.xml.query.exceptions.XQueryTypeException: line 1, column 7: {err}XP0006: "´| ({http://www.w3.org/2001/XMLSchema}string)": bad value for type node
  at weblogic.xml.query.iterators.AbstractIterator.reportUserError(AbstractIterator.java:95)
  at weblogic.xml.query.iterators.AbstractIterator.reportUserError(AbstractIterator.java:134)
  at weblogic.xml.query.runtime.typing.SeqTypeMatching.fetchNext(SeqTypeMatching.java:189)
  at weblogic.xml.query.iterators.GenericIterator.hasNext(GenericIterator.java:133)
  at weblogic.xml.query.runtime.navigation.ChildPath.fetchNext(ChildPath.java:159)
  Truncated. see log file for complete stacktrace
>
`<`May 29, 2014 12:02:43 PM BRT> `<`Error> `<`OSB Kernel> `<`BEA-380003> `<`Exception on TransportManagerImpl.receiveMessage, com.bea.wli.sb.stages.StageException: line 1, column 7: {err}XP0006: "´| ({http://www.w3.org/2001/XMLSchema}string)": bad value for type node
com.bea.wli.sb.stages.StageException: line 1, column 7: {err}XP0006: "´| ({http://www.w3.org/2001/XMLSchema}string)": bad value for type node
  at com.bea.wli.sb.stages.expressions.xquery.XQueryExprExecutor.executeJavaObject(XQueryExprExecutor.java:138)
  at stages.logging.runtime.LogRuntimeStep.processMessage(LogRuntimeStep.java:123)
  at com.bea.wli.sb.pipeline.debug.DebuggerRuntimeStep.processMessage(DebuggerRuntimeStep.java:74)
  at com.bea.wli.sb.stages.StageMetadataImpl$WrapperRuntimeStep.processMessage(StageMetadataImpl.java:346)
  at com.bea.wli.sb.stages.impl.SequenceRuntimeStep.processMessage(SequenceRuntimeStep.java:33)
  Truncated. see log file for complete stacktrace
Caused By: weblogic.xml.query.exceptions.XQueryTypeException: line 1, column 7: {err}XP0006: "´| ({http://www.w3.org/2001/XMLSchema}string)": bad value for type node
  at weblogic.xml.query.iterators.AbstractIterator.reportUserError(AbstractIterator.java:95)
  at weblogic.xml.query.iterators.AbstractIterator.reportUserError(AbstractIterator.java:134)
  at weblogic.xml.query.runtime.typing.SeqTypeMatching.fetchNext(SeqTypeMatching.java:189)
  at weblogic.xml.query.iterators.GenericIterator.hasNext(GenericIterator.java:133)
  at weblogic.xml.query.runtime.navigation.ChildPath.fetchNext(ChildPath.java:159)
  Truncated. see log file for complete stacktrace

我在问如何处理已转换为XML的字符串,就像我在服务中作为请求接收到的XML一样。当我在字符串上应用inlinedXML时,我不能将它作为XML来处理,试图打印XML时,我只能看到原始字符串的内容。

EN

回答 1

Stack Overflow用户

发布于 2014-06-03 23:46:53

猜测:您试图传递给inlinedXML()的变量不包含字符串,但已经包含了XML。在这种情况下,inlinedXML()可能会尝试解析XML中可用的文本节点,从而导致它尝试将符号‘和\x解析为XML,然后失败(duh)。

试着做:

代码语言:javascript
复制
    count($var//*:SpecialChars)

如果它给出了一个大于0的数字,那么您已经得到了XML,不需要解析。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23954275

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档