Subject: Re: [xsl] selecting w:p nodes based on w:pStyle attributes From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Mon, 27 Mar 2006 17:17:51 -0500 |
I am trying to select w:p nodes based on w:pStyle attribute. ... The p:Style node is a child of the w:p node
which I want to select and copy to the result tree. Here is an example of the XML:
...
<w:p> <w:pPr> <w:pStyle w:val="A-Head"/> </w:pPr> <w:r> <w:t>Nouns</w:t> </w:r> </w:p> <w:p> <w:pPr> <w:pStyle w:val="NL"/> </w:pPr> <w:r> <w:t>blah blah blah</w:t> </w:r> </w:p> ... <xsl:template match="w:p/w:pPr/w:pStyle[@w:val = 'NL']">
I know that "w:p/w:pPr/w:pStyle[@w:val = 'NL']" works to select the particular attribute.
For example, when I run the template below, I get repeated <w:pStyle w:val = "NL" > nodes in the result tree with nothing else.
<xsl:template match="w:p"/> <xsl:apply templates select="w:pPr/w:pStyle[@w:val = 'NL']"/>
</xsl:template>
What am I doing wrong?
<xsl:template match="w:p[w:pPr/w:pStyle/@w:val = 'NL']"> <!--do something here with w:p as current node--> </xsl:template>
<xsl:template match="w:p[w:pPr/w:pStyle[@w:val = 'NL']]"> <!--do something here with w:p as current node--> </xsl:template>
-- Registration open for XSLT/XSL-FO training: Wash.,DC 2006-06-12/16 World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] selecting w:p nodes based on , Terry Ofner | Thread | Re: [xsl] selecting w:p nodes based, Terry Ofner |
[xsl] selecting w:p nodes based on , Terry Ofner | Date | Re: [xsl] selecting w:p nodes based, David Carlisle |
Month |