xml에 html 콘텐츠가 포함 된 태그가 포함되어 있습니다. html을 xsl-fo으로 변환해야합니다. 호출이 HTML 내용에 템플릿을 적용 할 때,템플릿에서 Xml 콘텐츠를 인식하지 못했습니다.
<xsl:template match ="rtf">
<fo:block-container>
<fo:block>
<xsl:call-template name ="ConvertHtmlToXslfo">
<xsl:with-param name ="content">
<xsl:value-of select ="@rtfAsHtml" disable-output-escaping ="yes"/>
</xsl:with-param>
</xsl:call-template>
</fo:block>
</fo:block-container>
</xsl:template>
<xsl:template name="ConvertHtmlToXslfo">
<xsl:param name ="content"></xsl:param>
<fo:block-container>
<xsl:apply-templates select="msxsl:node-set($content)"/> <!--here is the problem-->
</fo:block-container>
</xsl:template>
<xsl:template match ="div">
<fo:block-container>
<!--more code here-->
</fo:block-container>
</xsl:template>
<xsl:template match ="p">
<fo:block>
<!--more code here-->
</fo:block>
</xsl:template>
<xsl:template match ="span">
<fo:inline>
<!--more code here-->
</fo:inline>
</xsl:template>
그러나 문제가 : 여기 내 XSLT 코드입니다. 해당 템플릿은 그것을 인식하지 못합니다. XSL-FO이 HTML 태그를 변환하는 방법을
<rtf rtfAsHtml="<div ><p ><span>Hi!</span></p></div>"/>
어떤 생각 :
여기에서 XML HTML을 태그 속성은 무엇입니까?
감사합니다.
입력 파일에 네임 스페이스 선언이 있습니까? 또한 "rtf"를 문서 노드로 사용할 수 있다면 입력 내용이 HTML이 아닌 RTF 인 것 같습니다. –
@ MathiasMüller. 아니요, 내 입력에는 네임 스페이스가 없습니다. 그리고, 내 입력은 rtf에서 변환 된 html을 포함하는 xml 태그입니다. 하지만 그것은 html입니다. – Jacob