User501
User501

Reputation: 347

Conversion process got success, but it showing transformation failed in oxygen (xml to json)

While i'm performing xml to Json process using oxygen, i got the json files successfully in corresponding folders, but the oxygen saying transformation failed. Actually i'm converting single xml into 3 json files in the output, So anything problem in that

Xml file which i using:

<front>
  <Settings>
    <code>W3333</urlcode>
    <url>http://mlucenter.com/like/api</apiurl>
  </Settings>
</front>
<body>
  <Count>2</Count>
  <line>linear-gradient</line>
</body>
<back>
  <buttons>
    <button/>
  </buttons>
  <banner/>
</back>

I seperated front, body and back xml into front.json, body.json and back.json using below xslt:

line no: 46 <xsl:template match="front">
               var headerConfig = {
              <xsl:apply-templates/>
                       };
            </xsl:template>


 line no: 212   <xsl:template match="front">
               <xsl:result-document href="front.json">
                 <xsl:next-match/>
               </xsl:result-document>
            </xsl:template>

    <xsl:template match="body">
       <xsl:result-document href="body.json">
         <xsl:next-match/>
       </xsl:result-document>
    </xsl:template>

    <xsl:template match="back">
       <xsl:result-document href="back.json">
         <xsl:next-match/>
       </xsl:result-document>
    </xsl:template>

I used saxon-PE 9.6.0.7 for transformation scenario and my output tab in oxygen as blank. Line no 46 defining other tags and line no 212 defining to convert. How i can give combinely

My error occuring in oxygen is

    Engine name: Saxon-PE 9.6.0.7
    Severity: warning
    Description: XTRE0540: Ambiguous rule match for /MLU/selectReflect[1]/front[1] Matches both "element(Q{}front)" on line 212 of file:/D:/backup/Saf/Bramstein%20transforms%20XSL/Bramstein%20transforms.xsl and "element(Q{}front)" on line 46 of file:/D:/backup/Saf/Bramstein%20transforms%20XSL/Bramstein%20transforms.xsl
    URL: http://www.w3.org/TR/xslt20/#err-XTRE0540
.
.
.

Please suggest me, is that im doing right. Because the files converted well in the corresponding folder. Thanks in advance

Upvotes: 0

Views: 77

Answers (1)

User501
User501

Reputation: 347

For the two set of templates, i have combined into single set like below

line no: 46 <xsl:template match="front">
               var headerConfig = {
              <xsl:apply-templates/>
                       };
            </xsl:template>


 line no: 212   <xsl:template match="front">
               <xsl:result-document href="front.json">
                 <xsl:next-match/>
               </xsl:result-document>
            </xsl:template>

I changed into

<xsl:template match="front">
               <xsl:result-document href="front.json">
                var headerConfig = {
               <xsl:apply-templates/>
                       };
               </xsl:result-document>
            </xsl:template>

Upvotes: 0

Related Questions