Subject: Re: [xsl] big hairy Xpath (Solved!) From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Mon, 20 Apr 2009 11:56:54 -0400 |
3. child::entry[false()] - by the inverse logic, returns an empty sequence. 'false()' is never true, so all 'entry' children are filtered out. (Only elements in the set for which the expression is true are kept.)
4. entry[@n='1'] - entry children that have an @n attribute with the string value "1". There may be any number of these, or none at all. Note that each 'entry' element is used separately as the evaluation context for the expression "@n='1'", which is how some of them pass and others fail.
5. Description[.='Special'] - 'Description' element children whose string value = "Special". Again, how many you get depends on your data and your context node (where you started the path).
8. child::child[child::grandchild] - 'child' element children that have 'grandchild' element children. This works because the expression 'child::grandchild' will cast to Boolean true() for any 'child' element children that have 'grandchild' children.
I hope this helps, Wendell
Hi All,
I ended using a variation of Wendells sugggest of:
1) //GenTable[count(.//entry
2) [Emphasis[@type='bold']
3) [(.='Address Offset') or
4) (.='Physical Address') or
5) (.='Instance') or
6) (.='Description') or
7) (.='Type') ] )
8) >= 4]
changing the entry to .//entry as entry IS a descendant of GenTable and not a direct child. To see if i got my head around this now. WRT to the lines numbered above:
1) Go to a GenTable child node. Within that element (that's what the '[' at this point means, right?) go to a descendant entry element. 2) Go to a child Emphasis element, looking for the type attribute set to 'bold'. 3) (Does the opening '[' at this point signal an AND being applied wrt to...) Within this same element see if it has the value of 'Address Offset'. 4) - 7) Of if the current element has any of these values, closing the checking with the ']' 8) if the number of these is >= 4 then return this GenTable.
Is that about right. The multiple predicates in this situation act like and AND?
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] big hairy Xpath (Solved!), Russell Urquhart | Thread | [xsl] Solution Needed for DB output, balaganesh mohan |
Re: [xsl] [fo] Standard font allove, G. Ken Holman | Date | [xsl] removing final space from nod, Lars Huttar |
Month |