xml document not refreshed when attribute value changed
Oxygen general issues.
-
- Posts: 27
- Joined: Tue Nov 17, 2009 10:16 pm
xml document not refreshed when attribute value changed
Post by guna@ebscohost.com »
Hi,
we are using oxygen 11.1
i am trying to change the attribute value through api. the value has been changed,when i query back the attribute value.
but in oxygen editor the corresponding attribute value is not showing the correct value, as well as the the save button is not enable..
if i try the following workaround. then it is working.
edit the xml content and save the document. at this point it is showing the correct value.
following is my code
we are using oxygen 11.1
i am trying to change the attribute value through api. the value has been changed,when i query back the attribute value.
but in oxygen editor the corresponding attribute value is not showing the correct value, as well as the the save button is not enable..
if i try the following workaround. then it is working.
edit the xml content and save the document. at this point it is showing the correct value.
following is my code
Code: Select all
AuthorNode[] node= authorAccess.getDocumentController().findNodesByXPath("//article",true, true, true);
AuthorElement element = (AuthorElement)node[0];
element.setAttribute("article-type", new AttrValue(userSelectedType));
Re: xml document not refreshed when attribute value changed
Hi Guna,
Always make modifications to existing elements through the AuthorDocumentController like:
Using the controller to make modifications will also make undo/redo work for them and mark the document as modified.
The AuthorElement nodes indeed have the setAttribute() methods on them but they are only intended to be used when the AuthorElement's are not a part of the current document.
Regards,
Radu
Always make modifications to existing elements through the AuthorDocumentController like:
Code: Select all
authorAccess.getDocumentController().setAttribute("article-type", new AttrValue(userSelectedType), element);
The AuthorElement nodes indeed have the setAttribute() methods on them but they are only intended to be used when the AuthorElement's are not a part of the current document.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
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