【发布时间】:2014-08-07 06:30:14
【问题描述】:
我必须使用 xslt 生成 json 数据,但我无法在另一个字符串中添加字符串
我想要的Json数据
{
"quoteListInfo" : [
{
"quote" : {
"Name" : "MyTest",
"BillingCity" : "Matheran"
},
"productModel" : [
{
"Product_SKU" : "AD-003",
"Product_Title" : "Adidas Shoes",
"Product_Quantity" : "10"
}
]
}
]
}
我想在报价单中添加姓名和计费城市。 如果我在代码下方运行,它会给我错误。 数组工作正常,但我无法在字符串中添加字符串
xsl 我已经写好了
<xsl:output method="sdml:org.selfhtml.xslt.JSONEmitter"/>
<xsl:template match="/">
<object>
<array key="quoteListInfo">
<object>
<string key="quote">
<object>
<string key="Name">Test</string>
<string key="BillingCity">Mumbai</string>
</object>
</string>
<array key="productModel">
<object>
<string key="Product_SKU">AD-003</string>
<string key="Product_Title">Reebok</string>
<string key="Product_Quantity">10</string>
</object>
</array>
</object>
</array>
</object>
</xsl:template>
</xsl:stylesheet>
【问题讨论】:
标签: json xslt xslt-1.0 xslt-2.0