XSLT-停止处理xml块
我正在使用xslt生成XSLT-停止处理xml块,xml,xslt,docx,Xml,Xslt,Docx,我正在使用xslt生成.docx文件 xslt文件包含ms xml和我的xsl代码 我遇到的问题是这个街区 <w:sectPr w:rsidR="008C5EB7" w:rsidSect="008C5EB7"> <w:footerReference w:type="default" r:id="rId6"/> <w:pgSz w:w="16834" w:h="11904" w:orient="landscape"
.docx
文件
xslt文件包含ms xml和我的xsl代码
我遇到的问题是这个街区
<w:sectPr w:rsidR="008C5EB7" w:rsidSect="008C5EB7">
<w:footerReference w:type="default" r:id="rId6"/>
<w:pgSz w:w="16834" w:h="11904" w:orient="landscape"/>
<w:pgMar w:top="1304" w:right="851" w:bottom="1474" w:left="851"
w:header="567" w:footer="624" w:gutter="0"/>
<w:pgBorders>
<w:bottom w:val="single" w:sz="24" w:space="0" w:color="948A54"
w:themeColor="background2" w:themeShade="80"/>
</w:pgBorders>
<w:cols w:space="708"/>
<w:printerSettings r:id="rId7"/>
</w:sectPr>
XSLT
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<w:document xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main" xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mv="urn:schemas-microsoft-com:mac:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml">
<w:body>
<xsl:for-each select="list/institution">
<w:tbl>
<w:tblPr>
<w:tblW w:w="15168" w:type="dxa"/>
<w:tblInd w:w="108" w:type="dxa"/>
<w:tblBorders>
<w:top w:val="single" w:sz="4" w:space="0" w:color="000000"/>
<w:left w:val="single" w:sz="4" w:space="0" w:color="000000"/>
<w:bottom w:val="single" w:sz="4" w:space="0" w:color="000000"/>
<w:right w:val="single" w:sz="4" w:space="0" w:color="000000"/>
</w:tblBorders>
<w:shd w:val="clear" w:color="auto" w:fill="4F5C62"/>
<w:tblLook w:val="00BF"/>
</w:tblPr>
<w:tblGrid>
<w:gridCol w:w="15168"/>
</w:tblGrid>
<w:tr w:rsidR="008C5EB7">
<w:trPr>
<w:trHeight w:val="567"/>
</w:trPr>
<w:tc>
<w:tcPr>
<w:tcW w:w="15168" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="4F5C62"/>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p w:rsidR="008C5EB7" w:rsidRPr="006F6210" w:rsidRDefault="008C5EB7" w:rsidP="008C5EB7">
<w:pPr>
<w:rPr>
<w:b/>
<w:sz w:val="24"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:b/>
<w:bCs/>
<w:caps/>
<w:noProof/>
</w:rPr>
<w:t>
<xsl:value-of select="@title"/>
</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
</w:tbl>
</xsl:for-each>
<w:p w:rsidR="008C5EB7" w:rsidRDefault="008C5EB7" w:rsidP="008C5EB7">
<w:pPr>
<w:spacing w:line="20" w:lineRule="exact"/>
</w:pPr>
</w:p>
<w:sectPr w:rsidR="008C5EB7" w:rsidSect="008C5EB7">
<w:footerReference w:type="default" r:id="rId6"/>
<w:pgSz w:w="16834" w:h="11904" w:orient="landscape"/>
<w:pgMar w:top="1304" w:right="851" w:bottom="1474" w:left="851" w:header="567" w:footer="624" w:gutter="0"/>
<w:pgBorders>
<w:bottom w:val="single" w:sz="24" w:space="0" w:color="948A54" w:themeColor="background2" w:themeShade="80"/>
</w:pgBorders>
<w:cols w:space="708"/>
<w:printerSettings r:id="rId7"/>
</w:sectPr>
</w:body>
</w:document>
</xsl:template>
</xsl:stylesheet>
无法重新编译,结果包含r:id
属性。因为您既没有提供源XML文档,也没有提供XSLT转换,那么下一个可能的原因可能是恶劣的天气。不确定您的意思是什么,今天的天气太棒了。。但是我添加了xml/xsltYes,令人惊讶,但太冷淡了:)谢谢你的帮助,我将检查我的其余代码并查找bug。修复了错误,但还不确定问题出在哪里。我会解决它并发布答案:)@Alex:由于天气好转,问题消失了:)
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<w:document xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main" xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mv="urn:schemas-microsoft-com:mac:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml">
<w:body>
<xsl:for-each select="list/institution">
<w:tbl>
<w:tblPr>
<w:tblW w:w="15168" w:type="dxa"/>
<w:tblInd w:w="108" w:type="dxa"/>
<w:tblBorders>
<w:top w:val="single" w:sz="4" w:space="0" w:color="000000"/>
<w:left w:val="single" w:sz="4" w:space="0" w:color="000000"/>
<w:bottom w:val="single" w:sz="4" w:space="0" w:color="000000"/>
<w:right w:val="single" w:sz="4" w:space="0" w:color="000000"/>
</w:tblBorders>
<w:shd w:val="clear" w:color="auto" w:fill="4F5C62"/>
<w:tblLook w:val="00BF"/>
</w:tblPr>
<w:tblGrid>
<w:gridCol w:w="15168"/>
</w:tblGrid>
<w:tr w:rsidR="008C5EB7">
<w:trPr>
<w:trHeight w:val="567"/>
</w:trPr>
<w:tc>
<w:tcPr>
<w:tcW w:w="15168" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="4F5C62"/>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p w:rsidR="008C5EB7" w:rsidRPr="006F6210" w:rsidRDefault="008C5EB7" w:rsidP="008C5EB7">
<w:pPr>
<w:rPr>
<w:b/>
<w:sz w:val="24"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:b/>
<w:bCs/>
<w:caps/>
<w:noProof/>
</w:rPr>
<w:t>
<xsl:value-of select="@title"/>
</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
</w:tbl>
</xsl:for-each>
<w:p w:rsidR="008C5EB7" w:rsidRDefault="008C5EB7" w:rsidP="008C5EB7">
<w:pPr>
<w:spacing w:line="20" w:lineRule="exact"/>
</w:pPr>
</w:p>
<w:sectPr w:rsidR="008C5EB7" w:rsidSect="008C5EB7">
<w:footerReference w:type="default" r:id="rId6"/>
<w:pgSz w:w="16834" w:h="11904" w:orient="landscape"/>
<w:pgMar w:top="1304" w:right="851" w:bottom="1474" w:left="851" w:header="567" w:footer="624" w:gutter="0"/>
<w:pgBorders>
<w:bottom w:val="single" w:sz="24" w:space="0" w:color="948A54" w:themeColor="background2" w:themeShade="80"/>
</w:pgBorders>
<w:cols w:space="708"/>
<w:printerSettings r:id="rId7"/>
</w:sectPr>
</w:body>
</w:document>
</xsl:template>
</xsl:stylesheet>