Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
Hello Everybody,
A footer page is defined on Generated Contents tab of Arbortext Styler. Footer should contain an attribute conten valuet within the page. By selecting "Insert> Attribute Content" within "Generated Content" window, I can select the value based on the occurrence (1st,2nd,..., last) of the element. That's good but not enough for the customer requirement. The footer should show the greatest value of attributes within the page.
So I write the statement: (//lep/@lep_date[not(. < //@lep_date)])[1]
The statement selects max value of lep_date attribute of lep elements within an xml document.
When I put this statement within ElementContentPage as shown on the image, the text could not be generated, and I don't see any error messages regarding it.
When I put this statement within XPathString all footers show the same max value of lep_date within whole document. I want the max value of lep_date only within the page, so every page footer will have different values regarding its page content.
You can find the sample xml file that I'm working on, and you can test the statement with. Do you have any advice?
Thanks,
Andaç
Solved! Go to Solution.
Hi Andaç--
I'm afraid what you are asking for can't be done with XPath. That's because in the header and footer sections, there is no context node available, so all XPaths must be resolved as absolute paths, i.e. in the context of the entire document. There isn't a way to limit the scope of the XPath search to the current page.
I don't know of a way to do this in pure Styler. You will likely have to make some source edits (APP or FOSI) to handle this type of thing.
--Clay
Hi Andaç--
I'm afraid what you are asking for can't be done with XPath. That's because in the header and footer sections, there is no context node available, so all XPaths must be resolved as absolute paths, i.e. in the context of the entire document. There isn't a way to limit the scope of the XPath search to the current page.
I don't know of a way to do this in pure Styler. You will likely have to make some source edits (APP or FOSI) to handle this type of thing.
--Clay
Clay is correct. The XPath function will simply search the entire document, not only what is visible on the page. There are running header/footer features but they won't support your logic (e.g. find highest @lep_date on page). In fact many years ago Arbortext wrote their own product called CPA "Change Page Application" to specifically support looseleaf workflows for defense industry applications.
If you are using APP you can support this @lep_date logic but it would have to be through edited source. For each page you can gather all @lep_dates into a variable then in the footer you can run a function to calculate the highest value of @lep_date and display that. It is too difficult to explain in a message though, unless you already know APP Javascript FOM.
P.S. you should never use the // XPath construct unless absolutely necessary. This will search the entire document and consequently slow your processing down a lot.