【问题标题】:xslt issue in multiheader and multiline多标题和多行中的 xslt 问题
【发布时间】:2015-04-29 03:27:26
【问题描述】:

我有一个有多个序列器的 xml 当我循环标题和行不匹配时请在下面使用 soa 11g JDeveloper 11.1.7 找到输入和输出 xsd

<xsd:element name="processRequest">
   <xsd:complexType>
      <xsd:sequence maxOccurs="unbounded" minOccurs="3">
         <xsd:element name="place" type="bci:Disk_Hdr_RecType" minOccurs="0"  maxOccurs="unbounded"/>   //multiple line data
         <xsd:element name="name" type="xsd:decimal" minOccurs="0" />
         <xsd:element name="zipcode" type="bci:Disk_Dtl_TblType" minOccurs="0" />
         <xsd:element name="state" type="xsd:decimal" minOccurs="0" />
      </xsd:sequence>
   </xsd:complexType>
</xsd:element>

<element name="ParameterCollection">
   <complexType>
      <sequence>
         <element ref="db:Parameters" maxOccurs="unbounded"/>
      </sequence>
       </complexType>
</element>

<element name="Parameters">
   <complexType>
      <sequence>
         <xsd:element name="namer" type="bci:Disk_Hdr_RecType" minOccurs="0" />
         <xsd:element name="place" type="xsd:decimal" minOccurs="0" />
         <xsd:element name="zipcode" type="bci:Disk_Dtl_TblType" minOccurs="0" />
         <xsd:element name="state" type="xsd:decimal" minOccurs="0" />
      </sequence>
   </complexType>
</element>

如果有人可以帮忙,请告诉我。

当我在 xslt 中循环时,所有 place 元素都得到处理,并且值与名称不匹配。元素namel、place、state依次重复多次。

【问题讨论】:

  • 你能告诉我们你得到的无效输出吗?此外,您的 XSL 中有错字。你能确定“namer”行前面没有&lt;e吗?
  • 我提供的不是 xsl 。它只是 xsd 的输入和输出。 ProcessRequest 是源架构元素,ParameterCollection 是目标架构元素
  • 您正在描述“XSLT 问题”,但没有显示 XSLT 代码?看起来很奇怪。

标签: xml xslt xsd soa bpel


【解决方案1】:
xslt 

    <?xml version="1.0" encoding="UTF-8" ?>
    <?oracle-xsl-mapper
      <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
      <mapSources>
        <source type="WSDL">
          <schema location="../BPELProcess1.wsdl"/>
          <rootElement name="process" namespace="http://xmlns.oracle.com/Test/testxslt/BPELProcess1"/>
        </source>
      </mapSources>
      <mapTargets>
        <target type="WSDL">
          <schema location="../BPELProcess1.wsdl"/>
          <rootElement name="ParameterCollection" namespace="http://xmlns.oracle.com/Test/testxslt/BPELProcess1"/>
        </target>
      </mapTargets>
      <!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.6.0(build 111214.0600.1553) AT [WED APR 29 09:16:28 PDT 2015]. -->
    ?>
    <xsl:stylesheet version="1.0"
                    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
                    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
                    xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction"
                    xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
                    xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
                    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
                    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:med="http://schemas.oracle.com/mediator/xpath"
                    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
                    xmlns:bpm="http://xmlns.oracle.com/bpmn20/extensions"
                    xmlns:client="http://xmlns.oracle.com/Test/testxslt/BPELProcess1"
                    xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"
                    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
                    xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
                    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                    xmlns:bpmn="http://schemas.oracle.com/bpm/xpath"
                    xmlns:ora="http://schemas.oracle.com/xpath/extension"
                    xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator"
                    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
                    exclude-result-prefixes="xsi xsl client plnk xsd wsdl bpws xp20 mhdr bpel oraext dvm hwf med ids bpm xdk xref bpmn ora socket ldap">
      <xsl:template match="/">
        <client:ParameterCollection>
          <client:Parameters>
            <xsl:if test="/client:process/client:name">
              <client:namer>
                <xsl:value-of select="/client:process/client:name"/>
              </client:namer>
            </xsl:if>
            <xsl:if test="/client:process/client:place">
              <client:place>
                <xsl:value-of select="/client:process/client:place"/>
              </client:place>
            </xsl:if>
            <xsl:if test="/client:process/client:zipcode">
              <client:zipcode>
                <xsl:value-of select="/client:process/client:zipcode"/>
              </client:zipcode>
            </xsl:if>
            <xsl:if test="/client:process/client:state">
              <client:state>
                <xsl:value-of select="/client:process/client:state"/>
              </client:state>
            </xsl:if>
          </client:Parameters>
        </client:ParameterCollection>
      </xsl:template>
    </xsl:stylesheet>

    sample input
    <processRequest xmlns="http://xmlns.oracle.com/Test/testxslt/BPELProcess1">
       <place>place7</place>
       <name>name8</name>
       <zipcode>zipcode9</zipcode>
       <state>state10</state>
        <place>place7</place>
       <name>name8</name>
       <zipcode>zipcode9</zipcode>
       <state>state10</state>
       <place>place7</place>
       <name>name8</name>
       <zipcode>zipcode9</zipcode>
       <state>state10</state>
    </processRequest>
    xslt out put 
    <client:ParameterCollection xmlns:client="http://xmlns.oracle.com/Test/testxslt/BPELProcess1">
       <client:Parameters>
          <client:namer>name8</client:namer>
          <client:place>place7</client:place>
          <client:zipcode>zipcode9</client:zipcode>
          <client:state>state10</client:state>
       </client:Parameters>
    </client:ParameterCollection>

【讨论】:

  • 但是输出没有按顺序排列所有的序列元素
猜你喜欢
  • 2019-03-28
  • 1970-01-01
  • 2020-01-08
  • 2018-03-31
  • 2011-08-24
  • 1970-01-01
  • 1970-01-01
  • 2010-11-10
  • 1970-01-01
相关资源
最近更新 更多