創建XSLT我有以下XML從XML
<City>
<StartDate>2015-02-10</StartDate>
<UpdatedBY>James</UpdatedBY>
<StudentCode>222</StudentCode>
<ExamCode>TTED</ExamCode>
</City>
我需要創建一個XSLT並將其轉換爲下面的XML。
<School:Region >
<School:County>
<School:City>
<School:StartDate>2015-02-10T00:00:00+08:00</School:StartDate>
<School:UpdatedBY>James</School:UpdatedBY>
<School:StudentCode>222</School:StudentCode>
<School:ExamCode>TTED</School:ExamCode>
</School:City>
</School:County>
</School:Region >
如何在每個元素前加上一個前綴'School'。我有這樣的,但不知道我做錯了什麼。
<xsl:stylesheet version="1.0" xmlns:xsl=""
xmlns:max="http://www.w3.org/1999/XSL/Transform/School" >
<xsl:template match="/">
<xsl:copy>
<xsl:apply-templates select="School"/>
</xsl:copy>
</xsl:template>
<xsl:template match="School" >
<City>
<StartDate>
<xsl:value-of select="Region/County/City/StartDate"/></StartDate>
<UpdatedBY>
<xsl:value-of select="Region/County/City/UpdatedBY"/></UpdatedBY>
<StudentCode><xsl:value-of select="Region/County/City/StudentCode"/></StudentCode>
<ExamCode>
<xsl:value-of select="Region/County/City/ExamCode"/></ExamCode>
</xsl:template>
</xsl:stylesheet>
在你沒有自己的域名使用的命名空間URI(在這種情況下www.w3.org)是通常被認爲是不禮貌的和不良的軟件工程。 –