[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Filtering using XSL
> I thought it will work as ".//", will traverse the children's children > also... It does, but just in the filter, not in the construction of the nodelist. You wrote match="Main[ . . . ]" so whatever you put inside the filter (ie inside the [] ) you will only ever get a node list of elements called main, the ones for which the filter expression is true) In your case the filter expression is true for any Main elements that have a chapter descendednt with the specified attribute. But as there is only one Main element this node list will have length 0 or 1. > I tried using <xsl:template match = "Main//Chapter[@Value = 'false']"/> > It is filtering all the direct children Chapters of Main which has attribute > value = 'true' If it is doing that, report it as a bug to the author of your xsl system. > What i want is I want only Chapters(direct/indirect children > of Main) which has a Value = true.. so you want the expression you give. However it is rather perverse to apply templates to _all_ nodes and then use a complicated match for those nodes that you want (and presumably a default template for the other cases that just recurses on the children) It is more direct if you _only_ want to process those nodes to select those nodes for processing as in <xsl:template match="Main> <xsl:apply-templates select=".//Chapter[@Value = 'false']"/> ... David XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|