Simplified XPath syntax in cc_config.xml

Post here questions and problems related to oXygen frameworks/document types.
Doug_Burgess
Posts: 1
Joined: Wed Jul 29, 2020 2:17 am

Simplified XPath syntax in cc_config.xml

Post by Doug_Burgess »

Hello,

I have a couple of questions regarding the simplified XPath syntax available in cc-config.xml, referenced here:
https://www.oxygenxml.com/doc/versions/ ... completion

We're trying to add constraints to the lists of available elements at the insertion point in Web Author v23.1.
  1. Does the syntax support any XPath functions not explicitly mentioned in the Help topic? We're using our own DITA specialization and it would be helpful if we could use DITA-style class references, e.g. *[contains(@class, ' topic/topic ')]
  2. I see that the simplified expressions can begin with the '//' all descendants operator. Is it possible to use that as a path step, e.g. conbody//duration?
The latter case would be very helpful for us, as our duration element is specialized from DITA's <data> element, so we'd have to mention a lot of contexts to exclude it from a topic's body.

Thanks a lot for any info....
Doug
=======================================================
Doug Burgess
Learning System Applications Engineering
SAP Learning
SAP Canada, 910 Mainland St., Vancouver, BC, Canada, V6B 1A9
doug.burgess@sap.com
cosminef
Site Admin
Posts: 234
Joined: Wed Aug 30, 2023 2:33 pm

Re: Simplified XPath syntax in cc_config.xml

Post by cosminef »

Hello,

Thank you for contacting us.
For the first case, the syntax you provided in the XPath function is not supported. (*[contains(@class, ' topic/topic ')])
For the second case, we have tested it in the DITA framework.
We have added the following rule in the cc_config.xml file:

Code: Select all

<elementProposals path="body//p" insertAttributes="id"/>
After that, we restart the Web Author application, opened the "Gardenia.dita" file and added a <p> element inside the <body> element.
As a result, the new paragraph was introduced with an empty id, as specified in the cc_config.xml.

Best,
Cosmin
Cosmin Eftenie
www.oxygenxml.com
Post Reply