| ||||||
First off, the documentation on this stuff needs some work. I couldn't find anything on this website that talks about xpath. You have to actually download their docs before you even see it mentioned... Here's what I'm trying to do. Its a little more complicated than I'm going to describe here, but if I can get this bit to work, I can figure out the rest. I want to have a query that says: if this category=heading, and it has a descendant with a particular value in another field, do something. You can't nest IF statements from what I've read (though I haven't actually tried it). I would expect my code to look something like this (forgive the syntax): I've created a field called 'columncount' <%if(({Category}=="Heading") and ({xpath:name(./@columncount)}=="5"))%> True <%else%> False <%endif%> From experimentation with xpath, I can only seem to get it to count things and to spit out "Category" and "Item" using 'name'. So if I do name() I get 'Item', or if I do name(@*) I get 'col09' which is a field I created, but no idea why its returning it (its not the first or last field etc). If I do name(//@*) I get 'Category'. For giggles I did this: <%{Section}%> <%{xpath:name(*)}%> <%{xpath:name(//@*)}%> <%{xpath:name(*[@*])}%> <%{xpath:name(node())}%> Which should return the values of all of those for each line in a document. Whats interesting is that for everything thats <= 2 levels deep, i.e.: 1 (1 level) 1.1 (2 levels) 1.1.1 (3 levels) I get: 1 - the section number Item Category Item Item For > 2 levels I get 1.1.1 Category I'm no expert with xml or xpath, but since there's a huge lack of documentation on this, I can only experiment and draw my own conclusions. None of the example export files seem to go into much detail or do anything particularly fancy. Why are there no nested IF statements? No For loops, no variables or functions? |
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|