gpt4 book ai didi

org.cyberneko.html.xercesbridge.XercesBridge类的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 22:52:40 27 4
gpt4 key购买 nike

本文整理了Java中org.cyberneko.html.xercesbridge.XercesBridge类的一些代码示例,展示了XercesBridge类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XercesBridge类的具体详情如下:
包路径:org.cyberneko.html.xercesbridge.XercesBridge
类名称:XercesBridge

XercesBridge介绍

[英]This class allows to transparently handle Xerces methods that have changed among versions.
[中]该类允许透明地处理在不同版本之间更改的Xerces方法。

代码示例

代码示例来源:origin: kohlschutter/boilerpipe

/** End prefix mapping. */
public void endPrefixMapping(String prefix, Augmentations augs)
  throws XNIException {
  
  // check for end of document
  if (fSeenRootElementEnd) {
    return;
  }
  // call handler
  if (fDocumentHandler != null) {
    XercesBridge.getInstance().XMLDocumentHandler_endPrefixMapping(fDocumentHandler, prefix, augs);
  }

} // endPrefixMapping(String,Augmentations)

代码示例来源:origin: kohlschutter/boilerpipe

XercesBridge.getInstance().XMLDocumentHandler_startDocument(fDocumentHandler, locator, encoding, nscontext, augs);

代码示例来源:origin: kohlschutter/boilerpipe

/** Start prefix mapping. */
public void startPrefixMapping(String prefix, String uri, Augmentations augs)
  throws XNIException {
  
  // check for end of document
  if (fSeenRootElementEnd) {
    return;
  }
  // call handler
  if (fDocumentHandler != null) {
    XercesBridge.getInstance().XMLDocumentHandler_startPrefixMapping(fDocumentHandler, prefix, uri, augs);
  }

} // startPrefixMapping(String,String,Augmentations)

代码示例来源:origin: net.sourceforge.nekohtml/com.springsource.org.cyberneko.html

String prefix = fNamespaceContext.getDeclaredPrefixAt(i);
  String uri = fNamespaceContext.getURI(prefix);
  XercesBridge.getInstance().XMLDocumentHandler_startPrefixMapping(fDocumentHandler, prefix, uri, augs);
for (int i = dcount-1; i >= 0; i--) {
  String prefix = fNamespaceContext.getDeclaredPrefixAt(i);
  XercesBridge.getInstance().XMLDocumentHandler_endPrefixMapping(fDocumentHandler, prefix, augs);

代码示例来源:origin: net.sourceforge.nekohtml/nekohtml

/** Returns the parser's sub-version number. */
private static int getParserSubVersion() {
  try {
    String VERSION = XercesBridge.getInstance().getVersion();
    int index1 = VERSION.indexOf('.') + 1;
    int index2 = VERSION.indexOf('.', index1);
    if (index2 == -1) { index2 = VERSION.length(); }
    return Integer.parseInt(VERSION.substring(index1, index2));
  }
  catch (Exception e) {
    return -1;
  }
} // getParserSubVersion():int

代码示例来源:origin: net.sourceforge.nekohtml/nekohtml

/** Synthesize namespace binding. */
protected void synthesizeBinding(XMLAttributes attrs, String ns) {
  String prefix = "xmlns";
  String localpart = ns;
  String qname = prefix+':'+localpart;
  String uri = NamespaceBinder.NAMESPACES_URI;
  String atype = "CDATA";
  String avalue = SYNTHESIZED_NAMESPACE_PREFX+fSynthesizedNamespaceCount++;
  
  // add attribute
  fQName.setValues(prefix, localpart, qname, uri);
  attrs.addAttribute(fQName, atype, avalue);
  // bind namespace
  XercesBridge.getInstance().NamespaceContext_declarePrefix(fNamespaceContext, ns, avalue);
} // synthesizeBinding(XMLAttributes,String)

代码示例来源:origin: net.sourceforge.nekohtml/com.springsource.org.cyberneko.html

for (int i = 0; i < filters.length; i++) {
  XMLDocumentFilter filter = filters[i];
  XercesBridge.getInstance().XMLDocumentFilter_setDocumentSource(filter, lastSource);
  lastSource.setDocumentHandler(filter);
  lastSource = filter;

代码示例来源:origin: net.sourceforge.nekohtml/nekohtml

private static XercesBridge makeInstance()
{
  final String[] classNames = {
    "org.cyberneko.html.xercesbridge.XercesBridge_2_3",
    "org.cyberneko.html.xercesbridge.XercesBridge_2_2",
    "org.cyberneko.html.xercesbridge.XercesBridge_2_1",
    "org.cyberneko.html.xercesbridge.XercesBridge_2_0"
  };
  for (int i = 0; i != classNames.length; ++i) {
    final String className = classNames[i];
    final XercesBridge bridge = newInstanceOrNull(className);
    if (bridge != null) {
      return bridge;
    }
  }
  throw new IllegalStateException("Failed to create XercesBridge instance");
}

代码示例来源:origin: net.sourceforge.nekohtml/nekohtml

String prefix = fNamespaceContext.getDeclaredPrefixAt(i);
  String uri = fNamespaceContext.getURI(prefix);
  XercesBridge.getInstance().XMLDocumentHandler_startPrefixMapping(fDocumentHandler, prefix, uri, augs);
for (int i = dcount-1; i >= 0; i--) {
  String prefix = fNamespaceContext.getDeclaredPrefixAt(i);
  XercesBridge.getInstance().XMLDocumentHandler_endPrefixMapping(fDocumentHandler, prefix, augs);

代码示例来源:origin: net.sourceforge.nekohtml/com.springsource.org.cyberneko.html

/** Returns the parser's sub-version number. */
private static int getParserSubVersion() {
  try {
    String VERSION = XercesBridge.getInstance().getVersion();
    int index1 = VERSION.indexOf('.') + 1;
    int index2 = VERSION.indexOf('.', index1);
    if (index2 == -1) { index2 = VERSION.length(); }
    return Integer.parseInt(VERSION.substring(index1, index2));
  }
  catch (Exception e) {
    return -1;
  }
} // getParserSubVersion():int

代码示例来源:origin: net.sourceforge.nekohtml/com.springsource.org.cyberneko.html

/** Synthesize namespace binding. */
protected void synthesizeBinding(XMLAttributes attrs, String ns) {
  String prefix = "xmlns";
  String localpart = ns;
  String qname = prefix+':'+localpart;
  String uri = NamespaceBinder.NAMESPACES_URI;
  String atype = "CDATA";
  String avalue = SYNTHESIZED_NAMESPACE_PREFX+fSynthesizedNamespaceCount++;
  
  // add attribute
  fQName.setValues(prefix, localpart, qname, uri);
  attrs.addAttribute(fQName, atype, avalue);
  // bind namespace
  XercesBridge.getInstance().NamespaceContext_declarePrefix(fNamespaceContext, ns, avalue);
} // synthesizeBinding(XMLAttributes,String)

代码示例来源:origin: net.sourceforge.nekohtml/nekohtml

for (int i = 0; i < filters.length; i++) {
  XMLDocumentFilter filter = filters[i];
  XercesBridge.getInstance().XMLDocumentFilter_setDocumentSource(filter, lastSource);
  lastSource.setDocumentHandler(filter);
  lastSource = filter;

代码示例来源:origin: net.sourceforge.nekohtml/com.springsource.org.cyberneko.html

private static XercesBridge makeInstance()
{
  final String[] classNames = {
    "org.cyberneko.html.xercesbridge.XercesBridge_2_3",
    "org.cyberneko.html.xercesbridge.XercesBridge_2_2",
    "org.cyberneko.html.xercesbridge.XercesBridge_2_1",
    "org.cyberneko.html.xercesbridge.XercesBridge_2_0"
  };
  for (int i = 0; i != classNames.length; ++i) {
    final String className = classNames[i];
    XercesBridge bridge = (XercesBridge) newInstanceOrNull(className);
    if (bridge != null) {
      return bridge;
    }
  }
  throw new IllegalStateException("Failed to create XercesBridge instance");
}

代码示例来源:origin: net.sourceforge.nekohtml/nekohtml

/** Start prefix mapping. */
public void startPrefixMapping(String prefix, String uri, Augmentations augs)
  throws XNIException {
  
  // check for end of document
  if (fSeenRootElementEnd) {
    return;
  }
  // call handler
  if (fDocumentHandler != null) {
    XercesBridge.getInstance().XMLDocumentHandler_startPrefixMapping(fDocumentHandler, prefix, uri, augs);
  }

} // startPrefixMapping(String,String,Augmentations)

代码示例来源:origin: net.sourceforge.nekohtml/com.springsource.org.cyberneko.html

/** End prefix mapping. */
public void endPrefixMapping(String prefix, Augmentations augs)
  throws XNIException {
  if (fDocumentHandler != null) {
    XercesBridge.getInstance().XMLDocumentHandler_endPrefixMapping(fDocumentHandler, prefix, augs);
  }
} // endPrefixMapping(String,Augmentations)

代码示例来源:origin: net.sourceforge.nekohtml/com.springsource.org.cyberneko.html

/** Start document. */
public void startDocument(XMLLocator locator, String encoding, 
             NamespaceContext nscontext, Augmentations augs) 
  throws XNIException {
  if (fDocumentHandler != null) {
    XercesBridge.getInstance().XMLDocumentHandler_startDocument(fDocumentHandler, locator, encoding, nscontext, augs);
  }
} // startDocument(XMLLocator,String,Augmentations)

代码示例来源:origin: net.sourceforge.nekohtml/nekohtml

/** Doctype declaration. */
public void doctypeDecl(String root, String pubid, String sysid,
            Augmentations augs) throws XNIException {
  
  // NOTE: Xerces HTML DOM implementation (up to and including
  //       2.5.0) throws a heirarchy request error exception 
  //       when a doctype node is appended to the tree. So, 
  //       don't insert this node into the tree for those 
  //       versions... -Ac
  String VERSION = XercesBridge.getInstance().getVersion();
  boolean okay = true;
  if (VERSION.startsWith("Xerces-J 2.")) {
    okay = getParserSubVersion() > 5;
  }
  // REVISIT: As soon as XML4J is updated with the latest code
  //          from Xerces, then this needs to be updated to
  //          check XML4J's version. -Ac
  else if (VERSION.startsWith("XML4J")) {
    okay = false;
  }
  // if okay, insert doctype; otherwise, don't risk it
  if (okay) {
    super.doctypeDecl(root, pubid, sysid, augs);
  }
} // doctypeDecl(String,String,String,Augmentations)

代码示例来源:origin: net.sourceforge.nekohtml/com.springsource.org.cyberneko.html

/** Start prefix mapping. */
public void startPrefixMapping(String prefix, String uri, Augmentations augs)
  throws XNIException {
  if (fDocumentHandler != null) {
    XercesBridge.getInstance().XMLDocumentHandler_startPrefixMapping(fDocumentHandler, prefix, uri, augs);
  }
} // startPrefixMapping(String,String,Augmentations)

代码示例来源:origin: net.sourceforge.nekohtml/nekohtml

/** End prefix mapping. */
public void endPrefixMapping(String prefix, Augmentations augs)
  throws XNIException {
  
  // check for end of document
  if (fSeenRootElementEnd) {
    return;
  }
  // call handler
  if (fDocumentHandler != null) {
    XercesBridge.getInstance().XMLDocumentHandler_endPrefixMapping(fDocumentHandler, prefix, augs);
  }

} // endPrefixMapping(String,Augmentations)

代码示例来源:origin: net.sourceforge.nekohtml/nekohtml

/** Start document. */
public void startDocument(XMLLocator locator, String encoding, 
             NamespaceContext nscontext, Augmentations augs) 
  throws XNIException {
  if (fDocumentHandler != null) {
    XercesBridge.getInstance().XMLDocumentHandler_startDocument(fDocumentHandler, locator, encoding, nscontext, augs);
  }
} // startDocument(XMLLocator,String,Augmentations)

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com