-2
xslt를 사용하고 있습니다. 내 XSLT가xslt를 xml 내용에 적용하십시오.
<xsl:template match="tgroup">
<tr>
<xsl:if test="@cols">
<xsl:attribute name="cols">
<xsl:value-of select="@cols"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@colsep">
<xsl:attribute name="colsep">
<xsl:value-of select="@colsep"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@rowsep">
<xsl:attribute name="rowsep">
<xsl:value-of select="@rowsep"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@align">
<xsl:attribute name="align">
<xsl:value-of select="@align"/>
</xsl:attribute>
</xsl:if>
<xsl:for-each select="colspec">
<th>
<xsl:if test="@colwidth">
<xsl:attribute name="width">
<xsl:value-of select="@colwidth"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@colname">
<xsl:attribute name="colname">
<xsl:value-of select="@colname"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@align">
<xsl:attribute name="align">
<xsl:value-of select="@align"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@colsep">
<xsl:attribute name="colsep">
<xsl:value-of select="@colsep"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@colnum">
<xsl:attribute name="colnum">
<xsl:value-of select="@colnum"/>
</xsl:attribute>
</xsl:if>
</th>
</xsl:for-each>
</tr>
<xsl:apply-templates/>
그러나 같은 XSLT 파일에 위의 코드를 가진
<table bnf_id="bnf_204272" colsep="1" frame="all" id="nzf_3865" otherprops="HRT Risk table" pgwide="1" rowsep="1"><title>HRT Risk</title><tgroup cols="8" colsep="1" rowsep="1"><colspec colname="col1" /><colspec colname="col2" /><thead><row><entry morerows="1" rowsep="1">Risk</entry><entry morerows="1" rowsep="1">Age range (years)</entry><entry colsep="1" nameend="col4" namest="col3" rowsep="1">Background incidence per 1000 women in Europe not using HRT</entry><entry colsep="1" nameend="col6" namest="col5" rowsep="1"><b>Additional</b>
cases per 1000 women using
<b>oestrogen only HRT</b>
(estimated)
</entry><entry colsep="1" nameend="col8" namest="col7" rowsep="1"><b>Additional</b>
cases per 1000 women using
<b>combined (oestrogen-progestogen) HRT</b>
(estimated)
</entry></row><row><entry>Over 5 years</entry><entry nameend="col8" namest="col1"><b>Note</b><p>Where background incidence or additional cases have not been included in the table, this indicates a lack of available data. NS indicates a non-significant difference</p><p>
Taken from MHRA/CHM (<i>Drug Safety Update</i>
2007;
<b>1</b>
(2): 2–6) available at
<xref format="html" href="http://www.mhra.gov.uk/drugsafetyupdate">
www.mhra.gov.uk/drugsafetyupdate
</xref></p></entry></row></tbody></tgroup></table>
입니다 내 입력 파일입니다, 일에 대한 내 두 번째 경기가 실행됩니다. 그래서 내가
<th></th>
같은 빈 차를 얻을하지만 난 태그 사이의 ...
를 삽입해야합니다. 그것을 해결하는 방법?
또한 XML을 입력 해주십시오. 질문없이 답변하기가 어렵습니다. – ColinE
그리고 소스 XML 문서 이외에도 정확한 결과를 제공하고 변환이 구현해야하는 규칙을 설명하십시오. –
제안 해 주셔서 감사합니다. 내 입력 파일을 추가, 내 전체 xslt 배치 할 수 없습니다. 그래서 나는 xslt 파일의 일부를 배치했다. – Pooja