oxygen 11.2 , framework configuration for xpath not working
Oxygen general issues.
-
- Posts: 27
- Joined: Tue Nov 17, 2009 10:16 pm
oxygen 11.2 , framework configuration for xpath not working
Post by guna@ebscohost.com »
hi i have following xml
in framework configuration, we have custom framework. inside that we have custom frame work action. and we want this action to execute only if the article-id NOT starts with 'R'
i am trying to do configuration
option, preference, "customframework"(doubleclick), Author Tab, Actions, "selected the action"
then inside that i have following xpath expression
substring(normalize-space(//article-id/text()),1,1) != 'R'
once configuration is done. i tried to execute the action, the action is executing for all article-id, and dose not take the xpath into account.
i also tried
not(//article-id[starts-with (text(),'R')] )
but i could not achieve this. can you guide me?
Code: Select all
<front>
<article-meta>
<article-id pub-id-type="IID">RT114449-01</article-id>
<title-group>
<article-title>title - here</article-title>
</title-group>
</article-meta>
</front>
i am trying to do configuration
option, preference, "customframework"(doubleclick), Author Tab, Actions, "selected the action"
then inside that i have following xpath expression
substring(normalize-space(//article-id/text()),1,1) != 'R'
once configuration is done. i tried to execute the action, the action is executing for all article-id, and dose not take the xpath into account.
i also tried
not(//article-id[starts-with (text(),'R')] )
but i could not achieve this. can you guide me?
Re: oxygen 11.2 , framework configuration for xpath not working
Hello,
I think what you're looking for is:
This should only execute if the current node is article-id and its next node does not start with 'R'(capital R because starts-with is case sensitive).
Let me know if this works.
Regards,
Adrian
I think what you're looking for is:
Code: Select all
self::article-id[not(starts-with(text(),'R'))]
Let me know if this works.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Re: oxygen 11.2 , framework configuration for xpath not working
Update from the email discussions:
Hi Guna,
For now the only solution I can propose is to execute the operation in an empty XPath context and have the operation execute an XPath when executed to decide what to do:
/**
* @see ro.sync.ecss.extensions.api.AuthorOperation#doOperation(ro.sync.ecss.extensions.api.AuthorAccess, ro.sync.ecss.extensions.api.ArgumentsMap)
*/
public void doOperation(AuthorAccess authorAccess, ArgumentsMap args)
throws IllegalArgumentException, AuthorOperationException {
Object[] nodes = authorAccess.getDocumentController().evaluateXPath("//article-id[(@pub-id-type ='IID') and not(starts-with(text(),'R'))]", false, false, false);
if(nodes != null && nodes.length > 0) {
//Do the operation.
} else {
throw new AuthorOperationException("This is a Review Document");
}
}
Regards,
Radu
Hi Guna,
For now the only solution I can propose is to execute the operation in an empty XPath context and have the operation execute an XPath when executed to decide what to do:
/**
* @see ro.sync.ecss.extensions.api.AuthorOperation#doOperation(ro.sync.ecss.extensions.api.AuthorAccess, ro.sync.ecss.extensions.api.ArgumentsMap)
*/
public void doOperation(AuthorAccess authorAccess, ArgumentsMap args)
throws IllegalArgumentException, AuthorOperationException {
Object[] nodes = authorAccess.getDocumentController().evaluateXPath("//article-id[(@pub-id-type ='IID') and not(starts-with(text(),'R'))]", false, false, false);
if(nodes != null && nodes.length > 0) {
//Do the operation.
} else {
throw new AuthorOperationException("This is a Review 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