How to get list of attributes which can be added to selected tag
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 93
- Joined: Mon Aug 08, 2022 2:32 pm
How to get list of attributes which can be added to selected tag
Post by SmitaPatil »
Hi Team,
Is there any method using which I can check what are all attribute I can add for selected element and what attributes are required for given element.
Please let me know if there any methods to get it.
Thanks,
Smita
Is there any method using which I can check what are all attribute I can add for selected element and what attributes are required for given element.
Please let me know if there any methods to get it.
Thanks,
Smita
-
- Posts: 515
- Joined: Wed May 20, 2009 2:40 pm
Re: How to get list of attributes which can be added to selected tag
Hello,
To get the list of available attributes for a specific node you can use the following API: ro.sync.ecss.extensions.api.AuthorSchemaManager.whatAttributesCanGoHere(WhatAttributesCanGoHereContext).
To create the context to be passed to the previous method, use the ro.sync.ecss.extensions.api.AuthorSchemaManager.createWhatAttributesCanGoHereContext(AuthorElement) API.
The whatAttributesCanGoHere method returns a list of ro.sync.contentcompletion.xml.CIAttribute.
You can find if one attribute is required by using the ro.sync.contentcompletion.xml.CIAttribute.isRequired() method.
Please let us know if you need more information.
Best Regards,
Mihaela
To get the list of available attributes for a specific node you can use the following API: ro.sync.ecss.extensions.api.AuthorSchemaManager.whatAttributesCanGoHere(WhatAttributesCanGoHereContext).
To create the context to be passed to the previous method, use the ro.sync.ecss.extensions.api.AuthorSchemaManager.createWhatAttributesCanGoHereContext(AuthorElement) API.
The whatAttributesCanGoHere method returns a list of ro.sync.contentcompletion.xml.CIAttribute.
You can find if one attribute is required by using the ro.sync.contentcompletion.xml.CIAttribute.isRequired() method.
Please let us know if you need more information.
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 93
- Joined: Mon Aug 08, 2022 2:32 pm
Re: How to get list of attributes which can be added to selected tag
Post by SmitaPatil »
Hi,
Thank you so much.
Thanks,
Smita
Thank you so much.
Thanks,
Smita
Last edited by SmitaPatil on Fri Sep 02, 2022 8:45 am, edited 1 time in total.
-
- Posts: 93
- Joined: Mon Aug 08, 2022 2:32 pm
Re: How to get list of attributes which can be added to selected tag
Post by SmitaPatil »
Hi Team,
can you please tell is there any method to remove attribute of selected element and also modify it.
Thanks,
Smita
can you please tell is there any method to remove attribute of selected element and also modify it.
Thanks,
Smita
-
- Posts: 515
- Joined: Wed May 20, 2009 2:40 pm
Re: How to get list of attributes which can be added to selected tag
Hello,
The ro.sync.ecss.extensions.api.AuthorDocumentController API class contains methods for modifying the Author document, so here is the place were you can first search when you need a method to modify or remove an element or an attribute.
These are the methods that you need now: ro.sync.ecss.extensions.api.AuthorDocumentController.setAttribute(String, AttrValue, AuthorElement) and ro.sync.ecss.extensions.api.AuthorDocumentController.removeAttribute(String, AuthorElement)
Best Regards,
Mihaela
The ro.sync.ecss.extensions.api.AuthorDocumentController API class contains methods for modifying the Author document, so here is the place were you can first search when you need a method to modify or remove an element or an attribute.
These are the methods that you need now: ro.sync.ecss.extensions.api.AuthorDocumentController.setAttribute(String, AttrValue, AuthorElement) and ro.sync.ecss.extensions.api.AuthorDocumentController.removeAttribute(String, AuthorElement)
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 93
- Joined: Mon Aug 08, 2022 2:32 pm
Re: How to get list of attributes which can be added to selected tag
Post by SmitaPatil »
Hi Team,
Thank you.
the method which you have suggested required attribute name.
Actually I wanted to remove all attributes of the element where cursor is present.
Please let me know if something is present to achieve this with caretoffset and element name.
Thanks,
Smita
Thank you.
the method which you have suggested required attribute name.
Actually I wanted to remove all attributes of the element where cursor is present.
Please let me know if something is present to achieve this with caretoffset and element name.
Thanks,
Smita
-
- Posts: 515
- Joined: Wed May 20, 2009 2:40 pm
Re: How to get list of attributes which can be added to selected tag
Hello,
From ro.sync.ecss.extensions.api.node.AuthorElement you can get all the attributes and then use the ro.sync.ecss.extensions.api.AuthorDocumentController.removeAttribute(String, AuthorElement) API that I mentioned earlier, for each attribute, to remove it.
Best Regards,
Mihaela
From ro.sync.ecss.extensions.api.node.AuthorElement you can get all the attributes and then use the ro.sync.ecss.extensions.api.AuthorDocumentController.removeAttribute(String, AuthorElement) API that I mentioned earlier, for each attribute, to remove it.
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ 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