Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to apply template for the first w:p in w:tbl?

Status
Not open for further replies.

gatwick2002

Programmer
Jun 24, 2004
8
US
Regardless of the nesting level in that particular w:tbl. For example:

<w:p w:rsidR="AAAAAA">
</w:p>
...
<w:tbl>
<w:tblPr>
<w:tblStyle w:val="TableGrid"/>
<w:tblW w:w="0" w:type="auto"/>
<w:tblLook w:val="04A0"/>
</w:tblPr>
<w:tblGrid>
<w:gridCol w:w="2394"/>
<w:gridCol w:w="2394"/>
<w:gridCol w:w="2394"/>
<w:gridCol w:w="2394"/>
</w:tblGrid>
<w:tr w:rsidR="0065563E" w:rsidTr="0065563E">
<w:tc>
<w:tcPr>
<w:tcW w:w="2394" w:type="dxa"/>
</w:tcPr>

<w:p w:rsidR="000000000" w:rsidRDefault="003A0CBE" w:rsidP="0015368C">
<w:r>
<w:t>C11</w:t>
</w:r>
</w:p>

</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2394" w:type="dxa"/>
</w:tcPr>
<w:p w:rsidR="11111111" w:rsidRDefault="003A0CBE" w:rsidP="0015368C">
<w:r>
<w:t>C12</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2394" w:type="dxa"/>
</w:tcPr>
<w:p w:rsidR="0065563E" w:rsidRDefault="003A0CBE" w:rsidP="0015368C">
<w:r>
<w:t>C13</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2394" w:type="dxa"/>
</w:tcPr>
<w:p w:rsidR="0065563E" w:rsidRDefault="003A0CBE" w:rsidP="0015368C">
<w:r>
<w:t>C14</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
<w:tr w:rsidR="0065563E" w:rsidTr="0065563E">
<w:tc>
<w:tcPr>
<w:tcW w:w="2394" w:type="dxa"/>
</w:tcPr>
<w:p w:rsidR="0065563E" w:rsidRDefault="003A0CBE" w:rsidP="0015368C">
<w:r>
<w:t>C21</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2394" w:type="dxa"/>
</w:tcPr>
<w:p w:rsidR="0065563E" w:rsidRDefault="003A0CBE" w:rsidP="0015368C">
<w:r>
<w:t>C22</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2394" w:type="dxa"/>
</w:tcPr>
<w:p w:rsidR="0065563E" w:rsidRDefault="003A0CBE" w:rsidP="0015368C">
<w:r>
<w:t>C23</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2394" w:type="dxa"/>
</w:tcPr>
<w:p w:rsidR="0065563E" w:rsidRDefault="003A0CBE" w:rsidP="0015368C">
<w:r>
<w:t>C24</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>


In that case <w:p w:rsidR="11111111"> should be ignored as well as all consequentive <w:p>s inside of w:tbl at any nesting level. But <w:p w:rsidR="AAAAAA"> and <w:p w:rsidR="000000000" > must be processed. How to write it in select expression for xsl:template?
 
This is one of the structures that will show you've matched all the needed node.
[tt]
<xsl:eek:utput method="text" />
<xsl:template match="/">
<xsl:apply-templates select="//w:tbl" />
</xsl:template>
<xsl:template match="w:tbl">
<xsl:apply-templates select="(.//w:p)[1]" />
</xsl:template>
<xsl:template match="w:p">
<xsl:value-of select="concat(@w:rsidR,'&#x0a;')" />
</xsl:template>
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top