html 表格显示 xslt,fo:Table to html table - xslt

I'm trying to write an xslt to generate another xslt that purpose is replacing only all xsl:fo with html tags..XSLT 1

I use CDATA around "xsl" namespace for avoid processing this kind of tag by the xslt. My scope is processing only xsl:fo directive and replace for example :

y

this is treated as text so i can copy it with ??

,

at ,

]]>

x

I want traslate fo:table+fo:table-body with table tag, and fo:table-column with td width="..%", fo:table-row with tr.. Td width is not so easy to retrieve because the width property belong to fo:table-column and fo:table-cell handling the tag.

I try to loop fo:table-column when i read a table-cell i'm writing td and calculate the width using the property column-width obtained by precedent tag fo:table-column: i use the position() of tag table-column (first loop) in the fo:table-cell selection

for example here is my xslt tralslator for xsl:fo (above-mentioned):

abc

#10;

empty cell

But i cant realize why all td's contains 'y',x and empty when it will belong only to the empty table-cell, seems it reads all fo:block..

abc

table-cell #10;

empty cell

table-cell #10;

y

x

abc

table-cell #10;

empty cell

table-cell #10;

y

x

I need to obtain:

abc

table-cell #10;

empty cell

abc

table-cell #10;

y

x

if i replace the second loop

xsl : for-each

with

xsl : template

don't match anything!

Maybe *[$vPosition] doesn't work but it works if i replace number like 1 or 2..

What's wrong?

Thanks in advice!

Roby

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据提供的引用内容,我们无法直接回答关于xsl:fo表格斜线分割的问题。但是,我们可以为您提供一些关于xsl:fo表格的基本知识和相关的参考资料,以帮助您更好地理解和解决您的问题。 XSL-FO(可扩展样式语言格式化对象)是一种用于描述和格式化XML文档的语言。它使用XML格式来定义文档的结构和内容,并使用XSLT(可扩展样式表语言转换)来转换XML文档以生成XSL-FO文档。XSL-FO文档可以用于生成PDF,PostScript等格式的文档。 在XSL-FO中,表格是一种常见的元素,用于显示和组织数据。表格可以包含多个行和列,并且可以使用各种属性来定义表格的外观和行为。表格中的斜线分割线可以通过设置表格单元格的边框属性来实现。例如,可以将表格单元格的边框样式设置为斜线,以创建斜线分割线。 以下是一个简单的XSL-FO表格示例,其中包含斜线分割线: ```xml <fo:table> <fo:table-body> <fo:table-row> <fo:table-cell border-style="solid" border-width="1pt"> <fo:block>Cell 1</fo:block> </fo:table-cell> <fo:table-cell border-style="solid" border-width="1pt"> <fo:block>Cell 2</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell border-style="solid" border-width="1pt" border-start-style="solid" border-start-width="1pt" border-start-color="black" border-end-style="solid" border-end-width="1pt" border-end-color="black"> <fo:block>Cell 3</fo:block> </fo:table-cell> <fo:table-cell border-style="solid" border-width="1pt"> <fo:block>Cell 4</fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> ``` 在上面的示例中,第二行的第一个单元格包含一个斜线分割线。这是通过设置单元格的边框样式来实现的。`border-start-style`和`border-end-style`属性用于定义斜线的样式,`border-start-width`和`border-end-width`属性用于定义斜线的宽度,`border-start-color`和`border-end-color`属性用于定义斜线的颜色。 参考资料: - https://www.w3.org/TR/xsl11/ - https://www.w3.org/TR/xslfo20/#d0e10692 - https://www.xml.com/pub/a/2002/07/31/xsl-fo.html

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值