XPath unions in Code Completion
Are you missing a feature? Request its implementation here.
-
RuffMatt
- Posts: 2
- Joined: Wed Jan 07, 2026 10:05 pm
XPath unions in Code Completion
I've searched and not found an answer to this in the forums, but I may have overlooked - anyone feel free to point me to existing answers!
--
I'm currently developing a content completion config file for some custom outputclass attribute values. I was able to set up something that works, but I'm trying to distill it down to a more sustainable implementation (read as: no duplicate definitions of values!)
Working example (not efficient):
This, however, is VERY repetitive and inefficient. I do want to precisely define where "foo" is offered (ie - not all elements), but I'd much rather use a union to combine all the types of element/attribute combinations that use the same set of values so I can define the list ONCE.
I tried this:
But it doesn't work for me. I asked AI Positron and part of the response was:
TIA!
--
I'm currently developing a content completion config file for some custom outputclass attribute values. I was able to set up something that works, but I'm trying to distill it down to a more sustainable implementation (read as: no duplicate definitions of values!)
Working example (not efficient):
Code: Select all
<match elementName="p" attributeName="outputclass">
<items action="append">
<item value="foo" annotation="This is a foo!"/>
<item value="text-color-orange" annotation="ORANGE"/>
<item value="text-color-red" annotation="RED"/>
<item value="text-color-turquoise" annotation="TURQUOISE"/>
</items>
</match>
<match elementName="li" attributeName="outputclass">
<items action="append">
<item value="foo" annotation="This is a foo!"/>
<item value="text-color-orange" annotation="ORANGE"/>
<item value="text-color-red" annotation="RED"/>
<item value="text-color-turquoise" annotation="TURQUOISE"/>
</items>
</match>
<match elementName="title" attributeName="outputclass">
<items action="append">
<item value="foo" annotation="This is a foo!"/>
<item value="text-color-orange" annotation="ORANGE"/>
<item value="text-color-red" annotation="RED"/>
<item value="text-color-turquoise" annotation="TURQUOISE"/>
</items>
</match>
I tried this:
Code: Select all
<valueProposals path="p/@outputclass | li/@outputclass | title/@outputclass | desc/@outputclass | row/@outputclass | ph/@outputclass">
<items action="append">
<item value="foo" annotation="This is a foo!"/>
<item value="text-color-orange" annotation="ORANGE"/>
<item value="text-color-red" annotation="RED"/>
<item value="text-color-turquoise" annotation="TURQUOISE"/>
</items>
</valueProposals>So TL;DR - How can I get support for unions like this that is reliably processed?- **In practice**, Oxygen supports only a _single attribute_ per `<valueProposals>` rule for reliable, context-sensitive content completion.
- **XPath unions** (e.g., `p/@outputclass | li/@outputclass`) are _syntactically valid_ in XML, but Oxygen’s content completion engine does **not** always apply the value proposals to all listed targets. It may only apply to the first, or may not work at all, depending on the context and Oxygen version.
TIA!
Matt Ruff
Information Development Tools Developer
Semiconductor Industry
Information Development Tools Developer
Semiconductor Industry
-
Radu
- Posts: 9629
- Joined: Fri Jul 09, 2004 5:18 pm
Re: XPath unions in Code Completion
Hello Matt,
I'm afraid Oxygen only interprets very simple XPaths used in the "cc_config.xml" file.
I added an internal issue based on your request, pasting the issue ID below:
EXM-56644 Make unions of elements with specific attributes work in cc_config expressions
If we manage to improve this in a future Oxygen version we will let you know.
In the meantime maybe you can use XML entities in the XML file to reuse certain pieces of XML content:
Regards,
Radu
I'm afraid Oxygen only interprets very simple XPaths used in the "cc_config.xml" file.
I added an internal issue based on your request, pasting the issue ID below:
EXM-56644 Make unions of elements with specific attributes work in cc_config expressions
If we manage to improve this in a future Oxygen version we will let you know.
In the meantime maybe you can use XML entities in the XML file to reuse certain pieces of XML content:
Code: Select all
<!DOCTYPE config[
<!ENTITY abc '<items action="append">
<item value="foo3" annotation="This is a foo!"/>
<item value="text-color-orange" annotation="ORANGE"/>
<item value="text-color-red" annotation="RED"/>
<item value="text-color-turquoise" annotation="TURQUOISE"/>
</items>'>
]>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.oxygenxml.com/ns/ccfilter/config http://www.oxygenxml.com/ns/ccfilter/config/ccConfigSchemaFilter.xsd"
xmlns="http://www.oxygenxml.com/ns/ccfilter/config">
<match elementName="p" attributeName="outputclass">
&abc;
</match>Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
RuffMatt
- Posts: 2
- Joined: Wed Jan 07, 2026 10:05 pm
Re: XPath unions in Code Completion
Radu,
Thank you for the quick response & for the suggestion. I may try that technique, although it is new to me in this context. It does address my initial concern about having a single definition to manage, but I also don't know if it will work for us long term. I'll look into that.
Best Regards,
Matt
Thank you for the quick response & for the suggestion. I may try that technique, although it is new to me in this context. It does address my initial concern about having a single definition to manage, but I also don't know if it will work for us long term. I'll look into that.
Best Regards,
Matt
Matt Ruff
Information Development Tools Developer
Semiconductor Industry
Information Development Tools Developer
Semiconductor Industry
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service