Get element value with javascript
Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
			- 
				NicoAMP
 - Posts: 103
 - Joined: Tue Mar 06, 2018 2:07 pm
 - Contact:
 
Get element value with javascript
Hello,
In my custom framework, with javascript, I would like to get attibute value of a specific element of my opened XHTML document.
How can I do that?
Thanks a lot.
			
			
									
									In my custom framework, with javascript, I would like to get attibute value of a specific element of my opened XHTML document.
How can I do that?
Thanks a lot.
Nicolas Delobel
AmeXio
nicolas.delobel at amexiogroup.com
						AmeXio
nicolas.delobel at amexiogroup.com
- 
				mihai_coanda
 - Posts: 81
 - Joined: Wed Jul 20, 2016 8:22 am
 
Re: Get element value with javascript
Post by mihai_coanda »
Hello,
To get an attribute of a node you will need to obtain a reference to an XML element[1] js instance which has a getAttribute(name) method.
You can obtain such an instance from a Selection [2] instance which in turn can be obtained from a SelectionManager[3] instance.
The SelectionManager instance can be obtained from an EditingSupport[3] instance.
You can obtain an EditingSupport instance using the sync.api.Editor.getEditingSupport [4] method.
An instance of the Editor class can be obtained by listening on the EDITOR_LOADED event whose listener is called with an instance of Workspace.EditorLifecycleEvent.[5].
Best Regards,
Michael
1. https://www.oxygenxml.com/maven/com/oxy ... ement.html
2. https://www.oxygenxml.com/maven/com/oxy ... et__anchor
3. https://www.oxygenxml.com/maven/com/oxy ... er__anchor
4. https://www.oxygenxml.com/maven/com/oxy ... rt__anchor
5. https://www.oxygenxml.com/maven/com/oxy ... Event.html
			
			
									
									To get an attribute of a node you will need to obtain a reference to an XML element[1] js instance which has a getAttribute(name) method.
You can obtain such an instance from a Selection [2] instance which in turn can be obtained from a SelectionManager[3] instance.
The SelectionManager instance can be obtained from an EditingSupport[3] instance.
You can obtain an EditingSupport instance using the sync.api.Editor.getEditingSupport [4] method.
An instance of the Editor class can be obtained by listening on the EDITOR_LOADED event whose listener is called with an instance of Workspace.EditorLifecycleEvent.[5].
Best Regards,
Michael
1. https://www.oxygenxml.com/maven/com/oxy ... ement.html
2. https://www.oxygenxml.com/maven/com/oxy ... et__anchor
3. https://www.oxygenxml.com/maven/com/oxy ... er__anchor
4. https://www.oxygenxml.com/maven/com/oxy ... rt__anchor
5. https://www.oxygenxml.com/maven/com/oxy ... Event.html
Michael
https://www.oxygenxml.com
						https://www.oxygenxml.com
- 
				NicoAMP
 - Posts: 103
 - Joined: Tue Mar 06, 2018 2:07 pm
 - Contact:
 
Re: Get element value with javascript
Hi Michael,
Thanks a lot for these informations.
Regards,
Nicolas
			
			
									
									Thanks a lot for these informations.
Regards,
Nicolas
Nicolas Delobel
AmeXio
nicolas.delobel at amexiogroup.com
						AmeXio
nicolas.delobel at amexiogroup.com
			
				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