大家好,
我试图压缩我使用c#制作的Epub文件
我尝试过的事情
在所有情况下,mimetype文件是添加到存档的第一个文件,不会被压缩
我使用的Epub验证器是epubcheck http://code.google.com/p/epubcheck/
如果有人用这些库中的一个成功压缩了一个epub文件,请让我知道如何或者是否有人使用任何其他开源的压缩API成功压缩epub文件.
编辑
DotNetZip有效,见下面接受的答案.
下面的代码按预期工作,当文本中存在互联网时,它会匹配.
<xsl:template name="IndexTerm">
<xsl:param name="matchedRegex">
<xsl:text>(.*)(Internet)(.*)</xsl:text>
</xsl:param>
<xsl:param name="text"></xsl:param>
<xsl:analyze-string select="$text" regex="(.*)(Internet)(.*)" flags="m">
<xsl:matching-substring>
<xsl:call-template name="IndexTerm">
<xsl:with-param name="text">
<xsl:value-of select="regex-group(1)"></xsl:value-of>
</xsl:with-param>
</xsl:call-template>
<xsl:element name="a">
<xsl:attribute name="id">
<xsl:value-of select="generate-id($text)"></xsl:value-of>
</xsl:attribute>
<xsl:value-of select="regex-group(2)"></xsl:value-of>
</xsl:element>
<xsl:value-of select="regex-group(3)"></xsl:value-of>
</xsl:matching-substring>
<xsl:non-matching-substring>
<xsl:value-of select="."></xsl:value-of>
</xsl:non-matching-substring>
</xsl:analyze-string>
</xsl:template>
Run Code Online (Sandbox Code Playgroud)
当行:
<xsl:analyze-string select="$text" regex="(.*)(Internet)(.*)" flags="m">
Run Code Online (Sandbox Code Playgroud)
替换为:
<xsl:analyze-string select="$text" regex="$matchedRegex" flags="m">
Run Code Online (Sandbox Code Playgroud)
它不再匹配正则表达式.我确实需要将其作为参数传递.反正有没有让这项工作?