Hiding a valid attribute from Attributes View

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
dcramer
Posts: 134

Hiding a valid attribute from Attributes View

Mon Oct 02, 2017 7:01 pm

I have a situation where I need certain attributes to be valid in my schema, but I do not want users to add this attribute manually or have them be confused the attributes cluttering up the Attributes View. Is there a way to configure my Document Type so that certain attributes do not appear in the Attributes View (and other places where it might be suggested, like content completion) even though they're valid according to the schema?

Thanks,
David
sorin_carbunaru
Site Admin
Posts: 111

Re: Hiding a valid attribute from Attributes View

Tue Oct 03, 2017 9:34 am

Hello David,

For this purpose you can use a content completion configuration file, about which you can read more at https://www.oxygenxml.com/doc/versions/ ... ually.html. In short, you have to edit (or maybe create) the OXYGEN_INSTALL_DIR/frameworks/YOUR_FRAMEWORK/resources/cc_config.xml file and add a line such as

Code: Select all

<elementProposals rejectAttributes="YOU_ATTRIBUTE_NAME" />
inside. This way you should be able to achieve what you desire.

All the best wishes,
Sorin Carbunaru
oXygen XML
dcramer
Posts: 134

Re: Hiding a valid attribute from Attributes View

Tue Oct 03, 2017 10:48 pm

Ah, this looks like a very useful file. What I really want to do is the following to suppress these attributes on all elements in the docbook namespace:

Code: Select all

<elementProposals  xmlns:db="http://docbook.org/ns/docbook"
                                path="db:*"
                                rejectAttributes="db:idfixup db:idprefix db:linkscope" />

But "db:*" isn't allowed by the schema: "Value 'db:*' is not facet-valid with respect to pattern '([\i\c]+(\[.*\])*)+(/([\i\c]+(\[.*\])*))*' for type 'pathType'." Do I really need to repeat this element once for each element in DocBook?
sorin_carbunaru
Site Admin
Posts: 111

Re: Hiding a valid attribute from Attributes View

Wed Oct 04, 2017 12:29 pm

Hello David,

It seems to me that even if the schema complains about the path, still oXygen rejects those attributes. I tried on my side with xlink:href. Please let me know if you get to the same conclusion.

On the other hand, you could probably just remove the path attribute, which means the customization will then apply to the proposals for all elements.

Sorin C.
dcramer
Posts: 134

Re: Hiding a valid attribute from Attributes View

Wed Oct 04, 2017 7:41 pm

Unfortuantely, path="db:*" ends up being the same as omitting the path attribute and applies the rule to all elements.

My goal is to hide these attributes from elements in the DocBook namespace, but to allow them on the xi:include element. These attributes must be legal on all elements that can be included via xi:include (and I allow any element to be includable) because xinclude 1.1 passes these attributes down when it resolves the xincludes. But I don't want users to see these attributes anywhere in Oxygen since it makes no sense (and might do harm) if they add them to DocBook elements.

For now, I've made a list of DocBook elements from TDG and included them all as separate elementProposals in my cc_config.xml. Not idea, but it works for now.

Thanks,
David
sorin_carbunaru
Site Admin
Posts: 111

Re: Hiding a valid attribute from Attributes View

Thu Oct 05, 2017 4:07 pm

Hi David,

Thank you for explaining the use case! It really is helpful. I will add an issue regarding the behavior of the path, and we will update this thread when we will solve the problem.

Sorin C.

Return to “Common Problems”

Who is online

Users browsing this forum: No registered users and 3 guests