아주 간단한 xslt를 사용하여 html 페이지를 xml 파일로 변환합니다.XHTML to XML XSLT 변환
그러나 출발점은 나에게 직접적이지 않습니다. 첫 번째 목표는 <html>
태그를 <topic>
태그로 변환하는 것입니다.
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="html">
<topic>
<xsl:text> Conversion Test</xsl:text>
</topic>
</xsl:template>
을 것 같습니다 세 번째 템플릿과 일치하는 것을 I (<html>
태그와 일치시키기 위해) 쓴 것이 결코 부딪치지 않습니다.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>..</head>
<body>...</body>
</html>
전문가 여기 나에게 조금 도움이 될 수 :처럼
소스 HTML 보인다?
html의 예를 들려 줄 수 있습니까? (특히'xmlns = "http://www.w3.org/1999/xhtml"과 같은 네임 스페이스) –
@DevNull, 소스 html로 내 질문을 업데이트했습니다. – Kevin
감사합니다. 좋은 질문 +1 –