<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆 - 175  文章 - 202  trackbacks - 0
    <2009年10月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    第一個Blog,記錄哈哈的生活

    常用鏈接

    留言簿(16)

    隨筆分類

    隨筆檔案

    文章分類

    文章檔案

    收藏夾

    Java links

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    
    

    xsl 里增加

       function valueOf(context, elem) {
        return tools.valueOf(context, elem);
       }
    代碼里增加


     public String valueOf(XSLProcessorContext context, ElemExtensionCall elem) {
      String value = elem.getAttribute("select");
      String maxStr = elem.getAttribute("max");
      try {
       value = executeExpression(context, elem, value);
      } catch (TransformerException e) {
      }
      if (isNotBlank(maxStr)) {
       try {
        int max = Integer.parseInt(maxStr);
        value = shortStr(value, max);
       } finally {
       }
      }
      return value;
     }

     private String executeExpression(XSLProcessorContext context, ElemExtensionCall elem, String value)
       throws TransformerException {
      XPathContext xctxt = context.getTransformer().getXPathContext();
      XPath path = new XPath(value, elem, xctxt.getNamespaceContext(), XPath.SELECT);
      XObject data = path.execute(xctxt, context.getContextNode(), elem);
      if (data != null)
       value = data.xstr().toString();
      return value == null ? "" : value;
     }











    參考了下面的文檔






    [prev in list] [next in list] [prev in thread] [next in thread]
    List: xalan-j-users Subject: Re: Extension element with subelements From: John Gentilin <gentijo () eyecatching ! com> Date: 2007-09-07 21:48:37 Message-ID: 46E1C735.2080504 () eyecatching ! com [Download message RAW] Oops... this might be what you are after instead... executeChildTemplatesToXML or ToString or ToXMLString may be what you are after.. /** * A repository for common functions that can be used but the extension * functions and extension elements. * * * Title: Base Functions * Copyright: Copyright (c) 2005 * Company: Eye Catching Solutions Inc. * @version 1.0 * @author John Gentilin */ public class BaseFunctions { private static Category m_Log = Category.getInstance("RapidXSL.Interface"); private static DocumentBuilderFactory m_dfactory = null; private static DocumentBuilder m_docBuilder = null; /** * @param context * @param elem * @throws TransformerException */ protected void executeChildTemplates( XSLProcessorContext context, ElemExtensionCall elem ) throws TransformerException { TransformerImpl transf = context.getTransformer(); transf.executeChildTemplates(elem, context.getContextNode(), context.getMode(), transf.getResultTreeHandler()); } /** * @param context * @param elem * @throws TransformerException */ protected Document executeChildTemplatesToXML(Document doc, XSLProcessorContext context, ElemExtensionCall elem ) throws XMLServerException { DOMBuilder builder = null; TransformerImpl transformer = context.getTransformer(); try { builder = new DOMBuilder(doc); transformer.executeChildTemplates(elem, context.getContextNode(), context.getMode(), builder); } catch (Exception e) { throw new XMLServerException("RXSL_IFACE", "XSL Interface Error - " + e.getLocalizedMessage()); } return doc; } /** * @param context * @param elem * @throws TransformerException */ protected String executeChildTemplatesToString(XSLProcessorContext context, ElemExtensionCall elem ) throws XMLServerException { TransformerImpl transformer = context.getTransformer(); try { TextSerializationHandler handler = new TextSerializationHandler(); transformer.executeChildTemplates(elem, context.getContextNode(), context.getMode(), handler); return handler.toString(); } catch (Exception e) { throw new XMLServerException("RXSL_IFACE", "XSL Interface Error - " + e.getLocalizedMessage()); } } protected String executeChildTemplatestoXMLString(XSLProcessorContext context, ElemExtensionCall elem) throws TransformerException, SAXException { try { TransformerImpl transformer = context.getTransformer(); // This should be worked on so that the output format can be // defined by a first child of the redirect element. OutputProperties format = transformer.getOutputFormat(); Properties prop = format.getProperties(); format.setProperty("indent","no"); format.setProperty("{[prev in list] [next in list] [prev in thread] [next in thread]
    
    
    Configure | About | News | Donate | Add a list | Sponsors: 10EastKoreLogicTerra-InternationalChakpak.com
    posted on 2009-10-21 17:19 哈哈的日子 閱讀(355) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發(fā)表評論。


    網(wǎng)站導航:
     
    主站蜘蛛池模板: 四虎影视精品永久免费网站| 免费视频专区一国产盗摄| 国产乱子伦精品免费女| 亚洲国产精品无码中文lv | 波霸在线精品视频免费观看| 免费人妻无码不卡中文字幕18禁| 婷婷亚洲综合一区二区| 免费看国产一级片| 国产vA免费精品高清在线观看| 亚洲综合久久夜AV | yy一级毛片免费视频| 国产成人麻豆亚洲综合无码精品| 一级午夜免费视频| 国产AV无码专区亚洲精品| 99精品视频在线观看免费播放 | 久久久久久久尹人综合网亚洲| 国内精品免费在线观看| 麻豆亚洲av熟女国产一区二| 国产精品永久免费10000| 精品亚洲国产成人| 免费观看亚洲人成网站| 美女网站在线观看视频免费的| 婷婷亚洲久悠悠色悠在线播放| 国产在线观看麻豆91精品免费| 精品亚洲国产成人| 亚洲一级片免费看| 0588影视手机免费看片| 国产产在线精品亚洲AAVV| 久久91亚洲人成电影网站| 成人免费黄色网址| 无码日韩人妻AV一区免费l | 国产成人免费ā片在线观看| 国产精品极品美女自在线观看免费| 亚洲AV日韩AV永久无码久久 | 国产AV无码专区亚洲AV手机麻豆| 久久久久久久岛国免费播放| 亚洲 欧洲 自拍 另类 校园| 亚洲国产一成久久精品国产成人综合| 无码人妻久久一区二区三区免费 | 亚洲午夜福利717| 三年片在线观看免费大全|