0

I am trying to apply the data mapper mediator to the output of the XML data service defined within WSO2EI. Documentation indicates, that to use the data mapper you need to have a fully qualified names in the XML input files.

The data service I am creating does not include qualified prefixes within the XML it generates. I tried to export the XSLT data mapping from the CAR file and run it along the sample XML generated by the data service through the external XML transformer - it did not work. However, if I added qualified prefixes in the input XML manually, everything works fine.

It seems that the reason for my data mapper not working is the default, and not qualified, namespace in the input XML. Unfortunately, I cannot get the data service including namespace prexifes in its output. Any ideas?

問題の性質を説明するために、わずかに異なる 2 つの入力を考えてみましょう。最初の XML 入力ファイルはデフォルト名を使用し、2 番目は修飾名を使用します。

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <users xmlns="http://ws.wso2.org/dataservice">
         <user>
            <last>Waelchi</last>
            <first>Xzavier</first>
            <country>Swaziland</country>
         </user>
      </users>
   </soapenv:Body>
</soapenv:Envelope>

この XML は、WSO2EI 内であろうと外部 XML プロセッサであろうと、XSLT によって適切に処理されません。ただし、修飾名を持つ同じ XML:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <users xmlns:p="http://ws.wso2.org/dataservice">
         <p:user>
            <p:last>Waelchi</p:last>
            <p:first>Xzavier</p:first>
            <p:country>Swaziland</p:country>
         </p:user>
      </users>
   </soapenv:Body>
</soapenv:Envelope>

少なくとも外部 XML プロセッサによって適切に解釈されます。私の問題は、WSO2EI データ サービスに修飾プレフィックスを出力に含めることができないことです。

OK、WSO2 データ サービスによる XML 出力を XSLT 変換を使用して修飾された XML に変換する際の問題を回避することができました。ただし、修飾された XML をデータ サービスから直接取得することはまだできません。任意の提案をいただければ幸いです。

4

0 に答える 0