[Home] [By Thread] [By Date] [Recent Entries]
I have a few comments to make regarding style, in addition to what I
think is the answer to your question.
At 2013-07-15 16:06 +1000, Edwardson Larry wrote: This is the XML: ... I note in your data that <strong> and <ol> are siblings. So in your XSLT when you test that you have an <ol> child, you process *all* children of <li> which reprocesses your <strong> a second time: You probably only want <xsl:apply-templates select="ol"> in order not to process other siblings. But I suspect the structure of your stylesheet could be changed to do more matching so as to reduce the amount of special casing that you are doing. But it is difficult to advise without seeing more of your specification. Regarding style, this technique of checking "what am I" is particularly frowned upon in stylesheet: ... where you should be using test="self::li" ... which, actually, you are using elsewhere in your stylesheet: <xsl:apply-templates select="@* | node()[not(self::ol)]"> And your depth counting may be able to be addressed with counting nodes in the source node tree declaratively rather than imperatively maintaining depth counters in raw stylesheet code. I hope this is helpful. . . . . . . . . . Ken -- Public XSLT, XSL-FO, and UBL classes in the Netherlands Oct 2013 | Public XSLT, XSL-FO, UBL and code list classes in Australia Oct 2013 | Contact us for world-wide XML consulting and instructor-led training | Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm | Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ | G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx | Google+ profile: https://plus.google.com/116832879756988317389/about | Legal business disclaimers: http://www.CraneSoftwrights.com/legal |
|

Cart



