• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java XSLProcessorContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.xalan.extensions.XSLProcessorContext的典型用法代码示例。如果您正苦于以下问题:Java XSLProcessorContext类的具体用法?Java XSLProcessorContext怎么用?Java XSLProcessorContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



XSLProcessorContext类属于org.apache.xalan.extensions包,在下文中一共展示了XSLProcessorContext类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getAttributeBooleanValue

import org.apache.xalan.extensions.XSLProcessorContext; //导入依赖的package包/类
private static final boolean getAttributeBooleanValue(XSLProcessorContext ctx, ElemExtensionCall call, String attr, boolean defaultValue) throws TransformerException {
	Node node = ctx.getContextNode();
	String expr = call.getAttribute(attr);
	if (expr == null || expr.isEmpty())
		return defaultValue;
	XPathContext xpctx = ctx.getTransformer().getXPathContext();
	XPath xp = new XPath(expr, call, xpctx.getNamespaceContext(), XPath.SELECT);
	XObject xobj = xp.execute(xpctx, node, call);
	String value = xobj.str();
	if (value == null)
		return defaultValue;
	if (value.equals("yes"))
		return true;
	if (value.equals("true"))
		return true;
	if (value.equals("no"))
		return false;
	if (value.equals("false"))
		return false;
	return defaultValue;
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:22,代码来源:XMLReader.java


示例2: annotation

import org.apache.xalan.extensions.XSLProcessorContext; //导入依赖的package包/类
public static void annotation(XSLProcessorContext ctx, ElemExtensionCall call) throws TransformerException {
	TransformerImpl transformer = ctx.getTransformer();
	XMLReaderContext xrctx = (XMLReaderContext) transformer.getParameter(XML_READER_CONTEXT_PARAMETER);
	int start = getAttributeIntValue(ctx, call, START_ATTRNAME);
	int end = getAttributeIntValue(ctx, call, END_ATTRNAME);
	String layers0 = getAttributeStringValue(ctx, call, "xpath-layers", "layers");
	//System.err.println("a: " + start + "-" + end + " (" + layers0 + ")");
	if (layers0 == null)
		return;
	layers0 = layers0.trim();
	if (layers0.isEmpty())
		return;
	String[] layers = WHITESPACE.split(layers0);
	String ref = getAttributeStringValue(ctx, call, "xpath-ref", "ref");
	xrctx.startAnnotation(start, end, layers, ref);
	transformer.executeChildTemplates(call, false);
	xrctx.endAnnotation();
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:19,代码来源:XMLReader.java


示例3: getFilename

import org.apache.xalan.extensions.XSLProcessorContext; //导入依赖的package包/类
private String getFilename(XSLProcessorContext context, ElemExtensionCall elem)
  throws java.net.MalformedURLException,
  java.io.FileNotFoundException,
  java.io.IOException,
  javax.xml.transform.TransformerException {

  String fileName;

  fileName = ((ElemExtensionCall)elem).getAttribute ("href",
				       context.getContextNode(),
				       context.getTransformer());

  if(fileName == null) {
    context.getTransformer().getMsgMgr().error(elem,
				 "No 'href' on text, or not a filename");
  }

  return fileName;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:20,代码来源:Text.java


示例4: getFilename

import org.apache.xalan.extensions.XSLProcessorContext; //导入依赖的package包/类
private String getFilename(XSLProcessorContext context, ElemExtensionCall elem)
  throws java.net.MalformedURLException,
  java.io.FileNotFoundException,
  java.io.IOException,
  javax.xml.transform.TransformerException {

  String fileName;

  fileName = ((ElemExtensionCall)elem).getAttribute ("href",
				       context.getContextNode(),
				       context.getTransformer());

  if ("".equals(fileName)) {
    context.getTransformer().getMsgMgr().error(elem,
				 "No 'href' on text, or not a filename");
  }

  return fileName;
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:20,代码来源:Text.java


示例5: getEncoding

import org.apache.xalan.extensions.XSLProcessorContext; //导入依赖的package包/类
private String getEncoding(XSLProcessorContext context, ElemExtensionCall elem)
  throws java.net.MalformedURLException,
  java.io.FileNotFoundException,
  java.io.IOException,
  javax.xml.transform.TransformerException {

  String encoding;

  encoding = ((ElemExtensionCall)elem).getAttribute ("encoding",
				       context.getContextNode(),
				       context.getTransformer());

  if (encoding == null) {
    return "";
  } else {
    return encoding;
  }
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:19,代码来源:Text.java


示例6: getAttributeStringValue

import org.apache.xalan.extensions.XSLProcessorContext; //导入依赖的package包/类
private static final String getAttributeStringValue(XSLProcessorContext ctx, ElemExtensionCall call, String exprAttr, String valueAttr) throws TransformerException {
	Node node = ctx.getContextNode();
	String expr = call.getAttribute(exprAttr);
	if (expr == null || expr.isEmpty()) {
		return call.getAttribute(valueAttr);
	}
	XPathContext xpctx = ctx.getTransformer().getXPathContext();
	XPath xp = new XPath(expr, call, xpctx.getNamespaceContext(), XPath.SELECT);
	XObject xobj = xp.execute(xpctx, node, call);
	return xobj.str();
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:12,代码来源:XMLReader.java


示例7: getAttributeIntValue

import org.apache.xalan.extensions.XSLProcessorContext; //导入依赖的package包/类
private static final int getAttributeIntValue(XSLProcessorContext ctx, ElemExtensionCall call, String attr) throws TransformerException {
	Node node = ctx.getContextNode();
	String expr = call.getAttribute(attr);
	XPathContext xpctx = ctx.getTransformer().getXPathContext();
	XPath xp = new XPath(expr, call, xpctx.getNamespaceContext(), XPath.SELECT);
	XObject xobj = xp.execute(xpctx, node, call);
	return (int) xobj.num();
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:9,代码来源:XMLReader.java


示例8: document

import org.apache.xalan.extensions.XSLProcessorContext; //导入依赖的package包/类
public static void document(XSLProcessorContext ctx, ElemExtensionCall call) throws TransformerException {
	TransformerImpl transformer = ctx.getTransformer();
	XMLReaderContext xrctx = (XMLReaderContext) transformer.getParameter(XML_READER_CONTEXT_PARAMETER);
	String id = getAttributeStringValue(ctx, call, "xpath-id", "id");
	xrctx.startDocument(id);
	transformer.executeChildTemplates(call, false);
	xrctx.endDocument();
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:9,代码来源:XMLReader.java


示例9: section

import org.apache.xalan.extensions.XSLProcessorContext; //导入依赖的package包/类
public static void section(XSLProcessorContext ctx, ElemExtensionCall call) throws TransformerException {
	TransformerImpl transformer = ctx.getTransformer();
	XMLReaderContext xrctx = (XMLReaderContext) transformer.getParameter(XML_READER_CONTEXT_PARAMETER);
	String name = getAttributeStringValue(ctx, call, "xpath-name", "name");
	String contents = getAttributeStringValue(ctx, call, "xpath-contents", "contents");
	boolean referenceScope = getAttributeBooleanValue(ctx, call, "references", true);
	xrctx.startSection(name, contents);
	if (referenceScope)
		xrctx.startRefScope();
	transformer.executeChildTemplates(call, false);
	if (referenceScope)
		xrctx.endRefScope();
	xrctx.endSection();
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:15,代码来源:XMLReader.java


示例10: relation

import org.apache.xalan.extensions.XSLProcessorContext; //导入依赖的package包/类
public static final void relation(XSLProcessorContext ctx, ElemExtensionCall call) throws TransformerException {
	TransformerImpl transformer = ctx.getTransformer();
	XMLReaderContext xrctx = (XMLReaderContext) transformer.getParameter(XML_READER_CONTEXT_PARAMETER);
	String name = getAttributeStringValue(ctx, call, "xpath-name", "name");
	xrctx.startRelation(name);
	transformer.executeChildTemplates(call, false);
	xrctx.endRelation();
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:9,代码来源:XMLReader.java


示例11: tuple

import org.apache.xalan.extensions.XSLProcessorContext; //导入依赖的package包/类
public static final void tuple(XSLProcessorContext ctx, ElemExtensionCall call) throws TransformerException {
	TransformerImpl transformer = ctx.getTransformer();
	XMLReaderContext xrctx = (XMLReaderContext) transformer.getParameter(XML_READER_CONTEXT_PARAMETER);
	xrctx.startTuple();
	transformer.executeChildTemplates(call, false);
	xrctx.endTuple();
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:8,代码来源:XMLReader.java


示例12: arg

import org.apache.xalan.extensions.XSLProcessorContext; //导入依赖的package包/类
public static final void arg(XSLProcessorContext ctx, ElemExtensionCall call) throws TransformerException {
	TransformerImpl transformer = ctx.getTransformer();
	XMLReaderContext xrctx = (XMLReaderContext) transformer.getParameter(XML_READER_CONTEXT_PARAMETER);
	String role = getAttributeStringValue(ctx, call, "xpath-role", "role");
	String ref = getAttributeStringValue(ctx, call, "xpath-ref", "ref");
	xrctx.setArgument(role, ref);
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:8,代码来源:XMLReader.java


示例13: feature

import org.apache.xalan.extensions.XSLProcessorContext; //导入依赖的package包/类
public static void feature(XSLProcessorContext ctx, ElemExtensionCall call) throws TransformerException {
	TransformerImpl transformer = ctx.getTransformer();
	XMLReaderContext xrctx = (XMLReaderContext) transformer.getParameter(XML_READER_CONTEXT_PARAMETER);
	String name = getAttributeStringValue(ctx, call, "xpath-name", "name");
	String value = getAttributeStringValue(ctx, call, "xpath-value", "value");
	xrctx.setFeature(name, value);
	transformer.executeChildTemplates(call, false);
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:9,代码来源:XMLReader.java


示例14: references

import org.apache.xalan.extensions.XSLProcessorContext; //导入依赖的package包/类
public static void references(XSLProcessorContext ctx, ElemExtensionCall call) throws TransformerException {
	TransformerImpl transformer = ctx.getTransformer();
	XMLReaderContext xrctx = (XMLReaderContext) transformer.getParameter(XML_READER_CONTEXT_PARAMETER);
	xrctx.startRefScope();
	transformer.executeChildTemplates(call, false);
	xrctx.endRefScope();
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:8,代码来源:XMLReader.java


示例15: getEncoding

import org.apache.xalan.extensions.XSLProcessorContext; //导入依赖的package包/类
private String getEncoding(XSLProcessorContext context, ElemExtensionCall elem)
  throws java.net.MalformedURLException,
  java.io.FileNotFoundException,
  java.io.IOException,
  javax.xml.transform.TransformerException {

  String encoding;

  encoding = ((ElemExtensionCall)elem).getAttribute ("encoding",
				       context.getContextNode(),
				       context.getTransformer());

  return encoding;
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:15,代码来源:Text.java


示例16: encodeConstraints

import org.apache.xalan.extensions.XSLProcessorContext; //导入依赖的package包/类
public static String encodeConstraints(XSLProcessorContext context, Element constraintsElement) {

        return encodeConstraintsNode(constraintsElement);

    }
 
开发者ID:dbarowy,项目名称:java-aws-mturk,代码行数:6,代码来源:XsltHelper.java



注:本文中的org.apache.xalan.extensions.XSLProcessorContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JettyTestContainerFactory类代码示例发布时间:2022-05-22
下一篇:
Java SystemPermission类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap