Syntax for InsertFragmentOperation
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 71
- Joined: Sat Jan 07, 2017 1:23 am
Syntax for InsertFragmentOperation
Hello!
I'm trying to create an action that will insert an XML fragment into a document, and some of the fragment's element content must be selected by the user.
This version of my fragment works:
However, this version does not:
The file which is the parameter of the 'doc' function looks like this:
What am I doing wrong?
I'm trying to create an action that will insert an XML fragment into a document, and some of the fragment's element content must be selected by the user.
This version of my fragment works:
Code: Select all
<article-categories>
<subj-group subj-group-type="badges">
<compound-subject>
<compound-subject-part content-type="code">${ask('Choose badge:',
combobox, ('001':'Badge 001'; '002':'Badge 002'), '001', @code)}</compound-subject-part>
<compound-subject-part content-type="label">You chose: ${answer(@code)}</compound-subject-part>
</compound-subject>
</subj-group>
</article-categories>
Code: Select all
<article-categories>
<subj-group subj-group-type="badges">
<compound-subject>
<compound-subject-part content-type="code">${ask('Choose badge:',
combobox, (string(doc('${framework}/resources/badges.xml'))), '001', @code)}</compound-subject-part>
<compound-subject-part content-type="label">You chose: ${answer(@code)}</compound-subject-part>
</compound-subject>
</subj-group>
</article-categories>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<badges>
'001':'Badge 1';
'002':'Badge 2'
</badges>
-
- Posts: 9423
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Syntax for InsertFragmentOperation
Hi,
You should use the xpath_eval editor variable to run the XPath, also normalize the text value of the "bagdes" element before returning it, this seemed to work for me:
Regards,
Radu
You should use the xpath_eval editor variable to run the XPath, also normalize the text value of the "bagdes" element before returning it, this seemed to work for me:
Code: Select all
<article-categories>
<subj-group subj-group-type="badges">
<compound-subject>
${ask('Choose badge:', combobox, (${xpath_eval(doc('${framework}/resources/badges.xml')/badges/normalize-space(text()))}), '001', @code)}
<compound-subject-part content-type="label">You chose: ${answer(@code)}</compound-subject-part>
</compound-subject>
</subj-group>
</article-categories>
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
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