congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
LangFunction
Code IndexAdd Tabnine to your IDE (free)

How to use
LangFunction
in
org.jaxen.function

Best Java code snippets using org.jaxen.function.LangFunction (Showing top 6 results out of 315)

origin: jaxen/jaxen

private static Boolean evaluate(List contextNodes, Object lang, Navigator nav)
 throws UnsupportedAxisException
{
  return evaluate(contextNodes.get(0), 
    StringFunction.evaluate(lang, nav), nav)
    ? Boolean.TRUE : Boolean.FALSE;
}
origin: jaxen/jaxen

private static boolean evaluate(Object node, String lang, Navigator nav)
 throws UnsupportedAxisException
{
  
  Object element = node;
  if (! nav.isElement(element)) {
    element = nav.getParentNode(node);
  }
  while (element != null && nav.isElement(element)) 
  {
    Iterator attrs = nav.getAttributeAxisIterator(element);
    while(attrs.hasNext())
    {
      Object attr = attrs.next();
      if(LANG_LOCALNAME.equals(nav.getAttributeName(attr)) && 
        XMLNS_URI.equals(nav.getAttributeNamespaceUri(attr)))
      {
        return 
          isSublang(nav.getAttributeStringValue(attr), lang);
      }
    }
    element = nav.getParentNode(element);
  }
  return false;
}

origin: jaxen/jaxen

new LangFunction() );
origin: org.alfresco/alfresco-repository

"lang", new LangFunction());
origin: Alfresco/alfresco-repository

"lang", new LangFunction());
origin: jaxen/jaxen

return evaluate(context.getNodeSet(), arg, context.getNavigator() );
org.jaxen.functionLangFunction

Javadoc

4.3 boolean lang(string)

The lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang attribute on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang attribute on the nearest ancestor of the context node that has an xml:lang attribute. If there is no such attribute, then lang returns false. If there is such an attribute, then lang returns true if the attribute value is equal to the argument ignoring case, or if there is some suffix starting with - such that the attribute value is equal to the argument ignoring that suffix of the attribute value and ignoring case. For example, lang("en") would return true if the context node is any of these five elements:

 
<para xml:lang="en"/> 
<div xml:lang="en"><para/></div> 
<para xml:lang="EN"/> 
<para xml:lang="en-us"/> 

Most used methods

  • <init>
    Create a new LangFunction object.
  • evaluate
  • isSublang

Popular in Java

  • Start an intent from android
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • getSharedPreferences (Context)
  • Kernel (java.awt.image)
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JFileChooser (javax.swing)
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now