XPath unions in Code Completion
Are you missing a feature? Request its implementation here.
-
RuffMatt
- Posts: 1
- 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
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