簡體   English   中英

為什么樣式不適用於princexml中的xml

[英]Why styles don't apply to xml inside princexml

我有一些 XML:

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="./example.xsl"?>
<article>
    <title>Some title</title>
    <author>Some Author</author>
</article>

和 XSL:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/2001/XMLSchema-instance">
  <xsl:output method="html" />

  <xsl:template match="/">
    <h1>
      <xsl:value-of select="//title"/>
    </h1>
    <h2>
      <xsl:value-of select="//author"/>
    </h2>
  </xsl:template>
</xsl:stylesheet>

當我在瀏覽器上運行它時,我有這個: 在此處輸入圖片說明

但是我需要從這個 XML 生成 PDF,因此我應該使用princexml ,當我運行prince ./examples/example.xml生成帶有以下內容的 pdf 時: 在此處輸入圖片說明 為什么樣式不適用於princexml xml?

Prince 不支持 XSL,它支持 CSS。 請先使用 XSLT 處理器轉換 XML,然后將結果傳遞給 Prince。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM