Package org.apache.xalan.templates

Examples of org.apache.xalan.templates.KeyDeclaration


      int nDeclarations = keys.size();

      // Walk through each of the declarations made with xsl:key
      for (int i = 0; i < nDeclarations; i++)
      {
        KeyDeclaration kd = (KeyDeclaration) keys.elementAt(i);

        // Only continue if the name on this key declaration
        // matches the name on the iterator for this walker.
        if(!kd.getName().equals(name))
          continue;
       
        foundKey = true;
        ki.getXPathContext().setNamespaceContext(ki.getPrefixResolver());

        // See if our node matches the given key declaration according to
        // the match attribute on xsl:key.
        double score = kd.getMatch().getMatchScore(ki.getXPathContext(),
                                                   testNode);

        if (score == kd.getMatch().MATCH_SCORE_NONE)
          continue;       
               
        // Query from the node, according the the select pattern in the
        // use attribute in xsl:key.
        XObject xuse = kd.getUse().execute(ki.getXPathContext(), testNode,
                                           ki.getPrefixResolver());

        if (xuse.getType() != xuse.CLASS_NODESET)
        {
          String exprResult = xuse.str();
View Full Code Here


  public void startElement(
          StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes)
            throws org.xml.sax.SAXException
  {

    KeyDeclaration kd = new KeyDeclaration(handler.getStylesheet(), handler.nextUid());

    kd.setDOMBackPointer(handler.getOriginatingNode());
    kd.setLocaterInfo(handler.getLocator());
    setPropertiesFromAttributes(handler, rawName, attributes, kd);
    handler.getStylesheet().setKey(kd);
  }
View Full Code Here

      int nDeclarations = keys.size();

      // Walk through each of the declarations made with xsl:key
      for (int i = 0; i < nDeclarations; i++)
      {
        KeyDeclaration kd = (KeyDeclaration) keys.elementAt(i);

        // Only continue if the name on this key declaration
        // matches the name on the iterator for this walker.
        if(!kd.getName().equals(name))
          continue;
       
        ki.getXPathContext().setNamespaceContext(ki.getPrefixResolver());

        // See if our node matches the given key declaration according to
        // the match attribute on xsl:key.
        double score = kd.getMatch().getMatchScore(ki.getXPathContext(),
                                                   testNode);

        if (score == kd.getMatch().MATCH_SCORE_NONE)
          continue;       
               
        // Query from the node, according the the select pattern in the
        // use attribute in xsl:key.
        XObject xuse = kd.getUse().execute(ki.getXPathContext(), testNode,
                                           ki.getPrefixResolver());

        if (xuse.getType() != xuse.CLASS_NODESET)
        {
          String exprResult = xuse.str();
View Full Code Here

TOP

Related Classes of org.apache.xalan.templates.KeyDeclaration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.