我正在使用xslt使用FoundationPHP生成Word文档。我正在尝试创建一个模板,该模板将根据用户选择的项目数动态创建表(每行最多2个并排表)。
我更喜欢的结果是生成的Word文字看起来像:
Table 1 Table 2
Table 3
我尝试将表格放在文本框中并使用foreach命令,但得到的是:
Table 1
Table 2
Table 3
我也尝试过在<w:tc>
上运行foreach命令,但结果如下:
Table 1 Table 2 Table 3
我的xslt代码如下:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<-- Code for document properties
<w:body>
<w:tbl>
<w:tblPr>
<w:tblStyle w:val="TableGrid"/>
<w:tblW w:w="2483" w:type="pct"/>
<w:tblBorders>
<w:top w:val="none" w:sz="0" w:space="0" w:color="auto"/>
<w:left w:val="none" w:sz="0" w:space="0" w:color="auto"/>
<w:bottom w:val="none" w:sz="0" w:space="0" w:color="auto"/>
<w:right w:val="none" w:sz="0" w:space="0" w:color="auto"/>
<w:insideH w:val="none" w:sz="0" w:space="0" w:color="auto"/>
<w:insideV w:val="none" w:sz="0" w:space="0" w:color="auto"/>
</w:tblBorders>
<w:tblLook w:val="04A0" w:firstRow="1" w:lastRow="0" w:firstColumn="1" w:lastColumn="0" w:noHBand="0" w:noVBand="1"/>
</w:tblPr>
<w:tblGrid>
<w:gridCol w:w="4648"/>
</w:tblGrid>
<w:tr w:rsidR="00A00BC9" w:rsidTr="00A00BC9">
<xsl:for-each select="root/row">
<w:tc>
<w:tcPr>
<w:tcW w:w="4625" w:type="dxa"/>
</w:tcPr>
<w:tbl>
<w:tblPr>
<w:tblStyle w:val="TableGrid"/>
<w:tblW w:w="4320" w:type="dxa"/>
<w:tblBorders>
<w:top w:val="none" w:sz="0" w:space="0" w:color="auto"/>
</w:tblBorders>
<w:tblLook w:val="04A0" w:firstRow="1" w:lastRow="0" w:firstColumn="1" w:lastColumn="0" w:noHBand="0" w:noVBand="1"/>
</w:tblPr>
<w:tblGrid>
<w:gridCol w:w="4363"/>
</w:tblGrid>
<w:tr w:rsidR="00A00BC9" w:rsidTr="00BD1383">
<w:trPr>
<w:trHeight w:val="3312"/>
</w:trPr>
<w:tc>
<w:tcPr>
<w:tcW w:w="4449" w:type="dxa"/>
<w:tcBorders>
<w:top w:val="single" w:sz="18" w:space="0" w:color="1E4959"/>
<w:left w:val="single" w:sz="18" w:space="0" w:color="1E4959"/>
<w:bottom w:val="single" w:sz="18" w:space="0" w:color="1E4959"/>
<w:right w:val="single" w:sz="18" w:space="0" w:color="1E4959"/>
</w:tcBorders>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p w:rsidR="00A00BC9" w:rsidRDefault="00A00BC9" w:rsidP="00A00BC9">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:jc w:val="center"/>
</w:pPr>
<w:r>
<w:rPr>
<w:noProof/>
</w:rPr>
<w:drawing>
<!-- Code for image-->
</w:drawing>
</w:r>
</w:p>
</w:tc>
</w:tr>
<w:tr w:rsidR="00A00BC9" w:rsidTr="00BD1383">
<w:trPr>
<w:trHeight w:hRule="exact" w:val="144"/>
</w:trPr>
<w:tc>
<w:tcPr>
<w:tcW w:w="4449" w:type="dxa"/>
<w:tcBorders>
<w:top w:val="single" w:sz="18" w:space="0" w:color="1E4959"/>
<w:left w:val="nil"/>
<w:bottom w:val="nil"/>
<w:right w:val="nil"/>
</w:tcBorders>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p w:rsidR="00A00BC9" w:rsidRDefault="00A00BC9" w:rsidP="00A00BC9">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:jc w:val="center"/>
</w:pPr>
</w:p>
</w:tc>
</w:tr>
<w:tr w:rsidR="00A00BC9" w:rsidTr="00BD1383">
<w:trPr>
<w:trHeight w:val="720"/>
</w:trPr>
<w:tc>
<w:tcPr>
<w:tcW w:w="4449" w:type="dxa"/>
<w:tcBorders>
<w:top w:val="nil"/>
<w:left w:val="nil"/>
<w:bottom w:val="nil"/>
<w:right w:val="nil"/>
</w:tcBorders>
</w:tcPr>
<w:p w:rsidR="00A00BC9" w:rsidRDefault="00A00BC9" w:rsidP="00A00BC9">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:jc w:val="center"/>
<w:rPr>
<w:rFonts w:cstheme="minorHAnsi"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:cstheme="minorHAnsi"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>Improved Sale <xsl:value-of select="rank"/></w:t>
</w:r>
</w:p>
<w:p w:rsidR="00A00BC9" w:rsidRPr="005F3377" w:rsidRDefault="00A00BC9" w:rsidP="00A00BC9">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:jc w:val="center"/>
<w:rPr>
<w:rFonts w:cstheme="minorHAnsi"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:cstheme="minorHAnsi"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t xml:space="preserve"><xsl:value-of select="address"/>, <xsl:value-of select="city"/></w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
</w:tbl>
<w:p w:rsidR="00A00BC9" w:rsidRDefault="00A00BC9" w:rsidP="00A00BC9"/>
</w:tc>
</xsl:for-each>
<w:bookmarkStart w:id="0" w:name="_GoBack"/>
<w:bookmarkEnd w:id="0"/>
</w:tr>
</w:tbl>
<w:p w:rsidR="00A00BC9" w:rsidRDefault="00A00BC9"/>
<w:sectPr w:rsidR="00A00BC9">
<w:pgSz w:w="12240" w:h="15840"/>
<w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/>
<w:cols w:space="720"/>
<w:docGrid w:linePitch="360"/>
</w:sectPr>
</w:body>
</w:document>
</xsl:template>
</xsl:stylesheet>
任何帮助将不胜感激。
答案 0 :(得分:1)
可能会让您步入正轨,肯定太大了,无法发表评论...
您可以使用嵌套表吗?
该表如下所示:
与此结构相关的1|generic_x86:/ # cat /proc/mounts
rootfs / rootfs rw,seclabel,size=859768k,nr_inodes=214942 0 0
tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,mode=600 0 0
proc /proc proc rw,relatime,gid=3009,hidepid=2 0 0
sysfs /sys sysfs rw,seclabel,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
/dev/block/pci/pci0000:00/0000:00:03.0/by-name/system /system ext4 ro,seclabel,relatime,data=ordered 0 0
/dev/block/pci/pci0000:00/0000:00:07.0/by-name/vendor /vendor ext4 ro,seclabel,relatime,data=ordered 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
debugfs /sys/kernel/debug debugfs rw,seclabel,relatime,mode=755 0 0
tmpfs /mnt tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
none /config configfs rw,relatime 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
pstore /sys/fs/pstore pstore rw,seclabel,relatime 0 0
/dev/block/vdb /cache ext4 rw,seclabel,nosuid,nodev,noatime,errors=panic,data=ordered 0 0
tmpfs /storage tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
tracefs /sys/kernel/debug/tracing tracefs rw,seclabel,relatime 0 0
/dev/block/dm-0 /data ext4 rw,seclabel,nosuid,nodev,noatime,errors=panic,data=ordered 0 0
/dev/block/dm-0 /data/var/run/netns ext4 rw,seclabel,nosuid,nodev,noatime,errors=panic,data=ordered 0 0
proc /data/var/run/netns/router proc rw,relatime,gid=3009,hidepid=2 0 0
proc /data/var/run/netns/router proc rw,relatime,gid=3009,hidepid=2 0 0
/data/media /mnt/runtime/default/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid 0 0
/data/media /storage/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid 0 0
/data/media /mnt/runtime/read/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=23,derive_gid 0 0
/data/media /mnt/runtime/write/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid,default_normal 0 0
generic_x86:/ # getenforce
Enforcing
generic_x86:/ # mount -o rw,remount /system
'/dev/block/pci/pci0000:00/0000:00:03.0/by-name/system' is read-only
generic_x86:/ # setenforce 0
generic_x86:/ # mount -o rw,remount /system
'/dev/block/pci/pci0000:00/0000:00:03.0/by-name/system' is read-only
generic_x86:/ # getenforce
Permissive
generic_x86:/ # setenforce 1
generic_x86:/ # getenforce
Enforcing
generic_x86:/ # setenforce 0
generic_x86:/ # mount -o rw,remount /system
'/dev/block/pci/pci0000:00/0000:00:03.0/by-name/system' is read-only
generic_x86:/ # mount -o rw,remount /dev/block/pci/pci0000\:00/0000\:00\:03.0/by-n
by-name/ by-num/
generic_x86:/ # mount -o rw,remount /dev/block/pci/pci0000\:00/0000\:00\:03.0/by-name/system
'/dev/block/pci/pci0000:00/0000:00:03.0/by-name/system' is read-only
generic_x86:/ # chmod 777 /dev/block/pci/pci0000\:00/0000\:00\:03.0/by-name/system
generic_x86:/ # mount -o rw,remount /dev/block/pci/pci0000\:00/0000\:00\:03.0/by-name/system
'/dev/block/pci/pci0000:00/0000:00:03.0/by-name/system' is read-only
generic_x86:/ # mount -o rw,remount /dev/block/pci/pci0000\:00/0000\:00\:03.0/by-name/system
'/dev/block/pci/pci0000:00/0000:00:03.0/by-name/system' is read-only
generic_x86:/ # mount -o rw,remount -t rfs /dev/block/pci/pci0000\:00/0000\:00\:03.0/by-name/system
'/dev/block/pci/pci0000:00/0000:00:03.0/by-name/system' is read-only
generic_x86:/ # mount -o rw,remount -t rfs /dev/block/pci/pci0000\:00/0000\:00\:03.0/by-name/system /system
'/dev/block/pci/pci0000:00/0000:00:03.0/by-name/system' is read-only
generic_x86:/ # mount -o rw,remount -t ext4 /system
'/dev/block/pci/pci0000:00/0000:00:03.0/by-name/system' is read-only
generic_x86:/ # mount -o rw,remount -t ext4 /dev/block/pci/pci0000\:00/0000\:00\:03.0/by-name/system /system
'/dev/block/pci/pci0000:00/0000:00:03.0/by-name/system' is read-only
generic_x86:/ # mount -o rw,remount -t ext4 /system
'/dev/block/pci/pci0000:00/0000:00:03.0/by-name/system' is read-only
generic_x86:/ # clear
[2J[Hgeneric_x86:/ # cd..
/system/bin/sh: cd..: not found
127|generic_x86:/ # su
generic_x86:/ # whoami
root
generic_x86:/ # cat /proc/mounts
rootfs / rootfs rw,seclabel,size=859768k,nr_inodes=214942 0 0
tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,mode=600 0 0
proc /proc proc rw,relatime,gid=3009,hidepid=2 0 0
sysfs /sys sysfs rw,seclabel,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
/dev/block/pci/pci0000:00/0000:00:03.0/by-name/system /system ext4 ro,seclabel,relatime,data=ordered 0 0
/dev/block/pci/pci0000:00/0000:00:07.0/by-name/vendor /vendor ext4 ro,seclabel,relatime,data=ordered 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
debugfs /sys/kernel/debug debugfs rw,seclabel,relatime,mode=755 0 0
tmpfs /mnt tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
none /config configfs rw,relatime 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
pstore /sys/fs/pstore pstore rw,seclabel,relatime 0 0
/dev/block/vdb /cache ext4 rw,seclabel,nosuid,nodev,noatime,errors=panic,data=ordered 0 0
tmpfs /storage tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
tracefs /sys/kernel/debug/tracing tracefs rw,seclabel,relatime 0 0
/dev/block/dm-0 /data ext4 rw,seclabel,nosuid,nodev,noatime,errors=panic,data=ordered 0 0
/dev/block/dm-0 /data/var/run/netns ext4 rw,seclabel,nosuid,nodev,noatime,errors=panic,data=ordered 0 0
proc /data/var/run/netns/router proc rw,relatime,gid=3009,hidepid=2 0 0
proc /data/var/run/netns/router proc rw,relatime,gid=3009,hidepid=2 0 0
/data/media /mnt/runtime/default/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid 0 0
/data/media /storage/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid 0 0
/data/media /mnt/runtime/read/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=23,derive_gid 0 0
/data/media /mnt/runtime/write/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid,default_normal 0 0
generic_x86:/ # mount -o rw,remount -t ext4 /system
'/dev/block/pci/pci0000:00/0000:00:03.0/by-name/system' is read-only
generic_x86:/ # mount -o rw,remount -t ext4 /dev/b
binder block/
generic_x86:/ # mount -o rw,remount -t ext4 /dev/block/pci/pci0000\:00/0000
0000:00:03.0/ 0000:00:04.0/ 0000:00:05.0/ 0000:00:06.0/ 0000:00:07.0/
generic_x86:/ # mount -o rw,remount -t ext4 /dev/block/pci/pci0000\:00/0000\:00\:03.0/by-name/system /system
'/dev/block/pci/pci0000:00/0000:00:03.0/by-name/system' is read-only
generic_x86:/ #
130|generic_x86:/ # exit
130|generic_x86:/ # exit
C:\Users\Administrator>adb -s emulator-5554 root
C:\Users\Administrator>adb -s emulator-5554 remount
remount of /system failed: Read-only file system
remount of /vendor failed: Read-only file system
remount failed
C:\Users\Administrator>adb -s emulator-5554 disable-verity
C:\Users\Administrator>adb -s emulator-5554 reboot
C:\Users\Administrator>adb -s emulator-5554 root
C:\Users\Administrator>adb -s emulator-5554 remount
error: closed
C:\Users\Administrator>adb -s emulator-5554 remount
Not running as root. Try "adb root" first.
C:\Users\Administrator>adb -s emulator-5554 root
C:\Users\Administrator>adb -s emulator-5554 remount
remount succeeded
C:\Users\Administrator>adb -s emulator-5554 shell
generic_x86:/ # mount -o rw,remount -t ext4 /system
'/dev/block/pci/pci0000:00/0000:00:03.0/by-name/system' is read-only
generic_x86:/ # mount -o rw,remount -t ext4 /dev/block/pci/pci0000\:00/0000\:00\:03.0/by-name/system /sys
sys/ system/
generic_x86:/ # mount -o rw,remount -t ext4 /dev/block/pci/pci0000\:00/0000\:00\:03.0/by-name/system /system/
mount: '/system/' not in /proc/mounts
1|generic_x86:/ # mount -o rw,remount -t ext4 /dev/block/pci/pci0000\:00/0000\:00\:03.0/by-name/system /system
'/dev/block/pci/pci0000:00/0000:00:03.0/by-name/system' is read-only
为:
.WordOpenXML