Problems converting XML to JSON using XSLT

前端 未结 1 553
小鲜肉
小鲜肉 2021-01-05 12:53

I am trying to convert an XML to JSON using XSLT. Following are my XML and XSLT code.

XML file:

         


        
1条回答
  •  醉酒成梦
    2021-01-05 13:09

    Only write the comma if there is another cd element in your xml.

    So basically you have to wrap that comma in a xsl:if statement like this: ,

    So your stylesheet will look something like that:

    
    
       
          {
    "catalog":[
          
             {"title":"
             
             ",
    "artist":"
             
             "},
          
          ]
          }
       
    
    

    0 讨论(0)
提交回复
热议问题