xml editor

Products

Features

  EPUB
Supported platforms

Supports Windows 7 & Mac OS X Lion

Ready for XML Editor data server software
W3C Member

oxygen 11.2 , framework configuration for xpath not working

<oXygen/> general issues.

oxygen 11.2 , framework configuration for xpath not working

Postby guna@ebscohost.com » Thu Mar 18, 2010 10:14 pm

hi i have following xml
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>


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?
guna@ebscohost.com
 
Posts: 27
Joined: Tue Nov 17, 2009 10:16 pm

Re: oxygen 11.2 , framework configuration for xpath not working

Postby adrian » Fri Mar 19, 2010 4:38 pm

Hello,

I think what you're looking for is:
Code: Select all
self::article-id[not(starts-with(text(),'R'))]

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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
adrian
 
Posts: 854
Joined: Tue May 17, 2005 4:01 pm

Re: oxygen 11.2 , framework configuration for xpath not working

Postby Radu » Wed Mar 24, 2010 10:40 am

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
Radu Coravu
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Radu
 
Posts: 1374
Joined: Fri Jul 09, 2004 5:18 pm


Return to Other Issues

Who is online

Users browsing this forum: No registered users and 0 guests

XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>® XML Editor