Re: [oXygen-user] Treating Selected Project Resources as XQuery Collection?

It looks like if I format my result as a number padded with zeros then I can sort the result list and get the top numbers to the top. format-number(max(count(/*/*[contains(@class, ' topic/body ')]//table/tgroup/tbody/row) ), '00000') Cheers, E. ---- Eliot Kimber, Owner Contrext, LLC http://contrext.com On 5/5/16, 1:26 PM, "Eliot Kimber" <oxygen-user-bounces@oxygenxml.com on behalf of ekimber@contrext.com> wrote:
I want to use the XQuery against files feature to do some quick analysis: Find topics with large tables and report those files and only those files.
It's not obvious, and I didn't find it in the help, how to do this. My hope would be that when the scope selected in the XPath/XQuery builder is "selected project resources" that those would be treated as a collection so I could do e.g.:
For $doc in collection() Return {do stuff with the docs}
Is this possible?
The analysis I'm trying to do is to find the largest tables within the set of documents and then report those tables sorted by size. I can do this as an Xpath but the results are ordered by the order of the documents in the input doc so I have to scroll through a list of 1500 results to find the few that I'm interested in.
Of course I could do this in a standalone Xquery but I was hoping there was a quick way to do it in the Xquery builder.
Thanks,
Eliot
---- Eliot Kimber, Owner Contrext, LLC http://contrext.com
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user

Hi Eliot, The scope basically executes the XPath expression on each file from the working set, but the sorting on the results view should work also without the need to use the format-number function... I tried on a few files an XPath like /*/count(*) and then I clicked on the Description column to sort the results and that worked fine. Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 05/05/16 21:38, Eliot Kimber wrote:
It looks like if I format my result as a number padded with zeros then I can sort the result list and get the top numbers to the top.
format-number(max(count(/*/*[contains(@class, ' topic/body ')]//table/tgroup/tbody/row) ), '00000')
Cheers,
E. ---- Eliot Kimber, Owner Contrext, LLC http://contrext.com
On 5/5/16, 1:26 PM, "Eliot Kimber" <oxygen-user-bounces@oxygenxml.com on behalf of ekimber@contrext.com> wrote:
I want to use the XQuery against files feature to do some quick analysis: Find topics with large tables and report those files and only those files.
It's not obvious, and I didn't find it in the help, how to do this. My hope would be that when the scope selected in the XPath/XQuery builder is "selected project resources" that those would be treated as a collection so I could do e.g.:
For $doc in collection() Return {do stuff with the docs}
Is this possible?
The analysis I'm trying to do is to find the largest tables within the set of documents and then report those tables sorted by size. I can do this as an Xpath but the results are ordered by the order of the documents in the input doc so I have to scroll through a list of 1500 results to find the few that I'm interested in.
Of course I could do this in a standalone Xquery but I was hoping there was a quick way to do it in the Xquery builder.
Thanks,
Eliot
---- Eliot Kimber, Owner Contrext, LLC http://contrext.com
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user

If the results aren't padded the sorting appears to be lexical, that is 9 sorts before 1000. Cheers, E. ---- Eliot Kimber, Owner Contrext, LLC http://contrext.com On 5/5/16, 1:50 PM, "George Bina" <george@oxygenxml.com> wrote:
Hi Eliot,
The scope basically executes the XPath expression on each file from the working set, but the sorting on the results view should work also without the need to use the format-number function... I tried on a few files an XPath like
/*/count(*)
and then I clicked on the Description column to sort the results and that worked fine.
Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 05/05/16 21:38, Eliot Kimber wrote:
It looks like if I format my result as a number padded with zeros then I can sort the result list and get the top numbers to the top.
format-number(max(count(/*/*[contains(@class, ' topic/body ')]//table/tgroup/tbody/row) ), '00000')
Cheers,
E. ---- Eliot Kimber, Owner Contrext, LLC http://contrext.com
On 5/5/16, 1:26 PM, "Eliot Kimber" <oxygen-user-bounces@oxygenxml.com on behalf of ekimber@contrext.com> wrote:
I want to use the XQuery against files feature to do some quick analysis: Find topics with large tables and report those files and only those files.
It's not obvious, and I didn't find it in the help, how to do this. My hope would be that when the scope selected in the XPath/XQuery builder is "selected project resources" that those would be treated as a collection so I could do e.g.:
For $doc in collection() Return {do stuff with the docs}
Is this possible?
The analysis I'm trying to do is to find the largest tables within the set of documents and then report those tables sorted by size. I can do this as an Xpath but the results are ordered by the order of the documents in the input doc so I have to scroll through a list of 1500 results to find the few that I'm interested in.
Of course I could do this in a standalone Xquery but I was hoping there was a quick way to do it in the Xquery builder.
Thanks,
Eliot
---- Eliot Kimber, Owner Contrext, LLC http://contrext.com
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user

I see... in my case all the results had only one digit. Then indeed, using the format-number() makes it easy to sort. We do not store type information in the results view, so the description is a string, thus the sorting results that you noticed. Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 05/05/16 21:58, Eliot Kimber wrote:
If the results aren't padded the sorting appears to be lexical, that is 9 sorts before 1000.
Cheers,
E. ---- Eliot Kimber, Owner Contrext, LLC http://contrext.com
On 5/5/16, 1:50 PM, "George Bina" <george@oxygenxml.com> wrote:
Hi Eliot,
The scope basically executes the XPath expression on each file from the working set, but the sorting on the results view should work also without the need to use the format-number function... I tried on a few files an XPath like
/*/count(*)
and then I clicked on the Description column to sort the results and that worked fine.
Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 05/05/16 21:38, Eliot Kimber wrote:
It looks like if I format my result as a number padded with zeros then I can sort the result list and get the top numbers to the top.
format-number(max(count(/*/*[contains(@class, ' topic/body ')]//table/tgroup/tbody/row) ), '00000')
Cheers,
E. ---- Eliot Kimber, Owner Contrext, LLC http://contrext.com
On 5/5/16, 1:26 PM, "Eliot Kimber" <oxygen-user-bounces@oxygenxml.com on behalf of ekimber@contrext.com> wrote:
I want to use the XQuery against files feature to do some quick analysis: Find topics with large tables and report those files and only those files.
It's not obvious, and I didn't find it in the help, how to do this. My hope would be that when the scope selected in the XPath/XQuery builder is "selected project resources" that those would be treated as a collection so I could do e.g.:
For $doc in collection() Return {do stuff with the docs}
Is this possible?
The analysis I'm trying to do is to find the largest tables within the set of documents and then report those tables sorted by size. I can do this as an Xpath but the results are ordered by the order of the documents in the input doc so I have to scroll through a list of 1500 results to find the few that I'm interested in.
Of course I could do this in a standalone Xquery but I was hoping there was a quick way to do it in the Xquery builder.
Thanks,
Eliot
---- Eliot Kimber, Owner Contrext, LLC http://contrext.com
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user

Hi, For a specific application, I need to parameterize the Oxygen editor in order to have a different display of list items depending on contained lists. More precisely, a level 1 item is bold if there are level 2 items contained in the list. Otherwise, it is regular. I know how to manage that while transforming for publishing bu I don't know how to reprensent that only using Oxygen CSS selectors. Any ideas ? Pierre

Dear Pierre, There is a CSS level 4 draft that specifies a relational pseudo-class ":has()" https://drafts.csswg.org/selectors-4/#relational which can be used to provide the functionality that you need. The good news is that oXygen implements this, so for example, if you have an XHTML document like <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <?xml-stylesheet type="text/css" href="test.css"?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <ul> <li>normal</li> <li>Bold!!! <ul> <li>1</li> <li>2</li> </ul> </li> <li>Normal again</li> </ul> </body> </html> then the test.css referred in the file needs to contain li:has(ul) { font-weight:bold; } in order to render the second list item with bold font. Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 06/05/16 12:40, Pierre Attar wrote:
Hi,
For a specific application, I need to parameterize the Oxygen editor in order to have a different display of list items depending on contained lists.
More precisely, a level 1 item is bold if there are level 2 items contained in the list. Otherwise, it is regular.
I know how to manage that while transforming for publishing bu I don't know how to reprensent that only using Oxygen CSS selectors.
Any ideas ?
Pierre _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user

Hi Georges, This work fine but does not exactely fits my requirement which are : as soon as *one *item has a contained list *all *first level items ar bolded. So, if 1 have a first level list of 10 items and only one has a sublist, then all the ten items need to be bolded. Any idea for that ? Pierre Le 06/05/2016 12:14, George Bina a écrit :
Dear Pierre,
There is a CSS level 4 draft that specifies a relational pseudo-class ":has()" https://drafts.csswg.org/selectors-4/#relational which can be used to provide the functionality that you need. The good news is that oXygen implements this, so for example, if you have an XHTML document like
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <?xml-stylesheet type="text/css" href="test.css"?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body>
<ul> <li>normal</li> <li>Bold!!! <ul> <li>1</li> <li>2</li> </ul> </li> <li>Normal again</li>
</ul> </body> </html>
then the test.css referred in the file needs to contain
li:has(ul) { font-weight:bold; }
in order to render the second list item with bold font.
Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 06/05/16 12:40, Pierre Attar wrote:
Hi,
For a specific application, I need to parameterize the Oxygen editor in order to have a different display of list items depending on contained lists.
More precisely, a level 1 item is bold if there are level 2 items contained in the list. Otherwise, it is regular.
I know how to manage that while transforming for publishing bu I don't know how to reprensent that only using Oxygen CSS selectors.
Any ideas ?
Pierre _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user

Hi Pierre, Then set the bold style on the ul which has a li containing ul - that means replacing the CSS with: ul:has(li>ul) { font-weight:bold; } Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 06/05/16 13:29, Pierre Attar wrote:
Hi Georges,
This work fine but does not exactely fits my requirement which are : as soon as *one *item has a contained list *all *first level items ar bolded. So, if 1 have a first level list of 10 items and only one has a sublist, then all the ten items need to be bolded.
Any idea for that ?
Pierre
Le 06/05/2016 12:14, George Bina a écrit :
Dear Pierre,
There is a CSS level 4 draft that specifies a relational pseudo-class ":has()" https://drafts.csswg.org/selectors-4/#relational which can be used to provide the functionality that you need. The good news is that oXygen implements this, so for example, if you have an XHTML document like
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <?xml-stylesheet type="text/css" href="test.css"?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body>
<ul> <li>normal</li> <li>Bold!!! <ul> <li>1</li> <li>2</li> </ul> </li> <li>Normal again</li>
</ul> </body> </html>
then the test.css referred in the file needs to contain
li:has(ul) { font-weight:bold; }
in order to render the second list item with bold font.
Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 06/05/16 12:40, Pierre Attar wrote:
Hi,
For a specific application, I need to parameterize the Oxygen editor in order to have a different display of list items depending on contained lists.
More precisely, a level 1 item is bold if there are level 2 items contained in the list. Otherwise, it is regular.
I know how to manage that while transforming for publishing bu I don't know how to reprensent that only using Oxygen CSS selectors.
Any ideas ?
Pierre _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user

Thanks Georges, this works. For those interested, the complete pb cas also to change the list-style-type and the complete solution becomes : *[class~='topic/ul'] > *[class~='topic/li'], *[class~='topic/ul'] > *[class~='topic/li'] *[class~='topic/ul'] > *[class~='topic/li'] { list-style-type:hyphen; } *[class~='topic/ul']:has(*[class~='topic/li'] > *[class~='topic/ul']) > *[class~='topic/li'] { font-weight:bold; list-style-type:disc; } li * li { font-weight:normal; } Pierre Le 06/05/2016 13:11, George Bina a écrit :
Hi Pierre,
Then set the bold style on the ul which has a li containing ul - that means replacing the CSS with:
ul:has(li>ul) { font-weight:bold; }
Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 06/05/16 13:29, Pierre Attar wrote:
Hi Georges,
This work fine but does not exactely fits my requirement which are : as soon as *one *item has a contained list *all *first level items ar bolded. So, if 1 have a first level list of 10 items and only one has a sublist, then all the ten items need to be bolded.
Any idea for that ?
Pierre
Le 06/05/2016 12:14, George Bina a écrit :
Dear Pierre,
There is a CSS level 4 draft that specifies a relational pseudo-class ":has()" https://drafts.csswg.org/selectors-4/#relational which can be used to provide the functionality that you need. The good news is that oXygen implements this, so for example, if you have an XHTML document like
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <?xml-stylesheet type="text/css" href="test.css"?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body>
<ul> <li>normal</li> <li>Bold!!! <ul> <li>1</li> <li>2</li> </ul> </li> <li>Normal again</li>
</ul> </body> </html>
then the test.css referred in the file needs to contain
li:has(ul) { font-weight:bold; }
in order to render the second list item with bold font.
Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 06/05/16 12:40, Pierre Attar wrote:
Hi,
For a specific application, I need to parameterize the Oxygen editor in order to have a different display of list items depending on contained lists.
More precisely, a level 1 item is bold if there are level 2 items contained in the list. Otherwise, it is regular.
I know how to manage that while transforming for publishing bu I don't know how to reprensent that only using Oxygen CSS selectors.
Any ideas ?
Pierre _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user
participants (3)
-
Eliot Kimber
-
George Bina
-
Pierre Attar