gpt4 book ai didi

org.apache.xerces.xni.grammars.XSGrammar类的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 16:09:05 31 4
gpt4 key购买 nike

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

XSGrammar介绍

[英]Representing a schema grammar. It contains declaratoin/definitions from a certain namespace. When a grammar is preparsed, and its grammar type is XML Schema, it can be casted to this interface. Objects of this interface can be converted to XSModel, from which further information about components in this grammar can be obtained.
[中]表示模式语法。它包含来自特定命名空间的声明/定义。当一个语法已经准备好,并且它的语法类型是XMLSchema时,它可以被转换到这个接口。此接口的对象可以转换为XSModel,从中可以获得有关此语法中组件的更多信息。

代码示例

代码示例来源:origin: org.opengis.cite/cite1-utils

public void parse(String baseUri, String schemaText) throws IOException {
  this.model = ((XSGrammar) GrammarUtil.parseGrammar(baseUri, schemaText,
      null, this.grammarErrorHandler)).toXSModel();
  initialize();
}

代码示例来源:origin: org.opengis.cite/schema-utils

for (int i = 0; i < grammars.length; i++) {
  XSGrammar xsGrammar = (XSGrammar) grammars[i];
  if (xsGrammar.getGrammarDescription().getNamespace()
      .equals(targetNamespace)) {
    xsModel = xsGrammar.toXSModel();
    break;

代码示例来源:origin: org.opengis.cite/cite1-utils

public void parse(String baseUri, Reader in) throws IOException {
  this.model = ((XSGrammar) GrammarUtil.parseGrammar(baseUri, in, null,
      this.grammarErrorHandler)).toXSModel();
  initialize();
}

代码示例来源:origin: org.opengis.cite/cite1-utils

public void parse(File file) throws IOException {
  this.model = ((XSGrammar) GrammarUtil.parseGrammar(file, null,
      this.grammarErrorHandler)).toXSModel();
  initialize();
}

代码示例来源:origin: org.opengis.cite/cite1-utils

public void parse(URL grammarUrl) throws IOException {
  this.model = ((XSGrammar) GrammarUtil.parseGrammar(grammarUrl, null,
      this.grammarErrorHandler)).toXSModel();
  initialize();
}

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

public XSModel load(LSInput is) {
  try {
    Grammar g = loadGrammar(dom2xmlInputSource(is));
    return ((XSGrammar) g).toXSModel();
  } catch (Exception e) {
    reportDOMFatalError(e);
    return null;
  }
}

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

public XSModel loadURI(String uri) {
  try {
    Grammar g = loadGrammar(new XMLInputSource(null, uri, null));
    return ((XSGrammar)g).toXSModel();
  }
  catch (Exception e){
    reportDOMFatalError(e);
    return null;
  }
}

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

/**
 *  Parse an XML Schema document from a resource identified by a 
 * <code>LSInput</code> . 
 * @param is  The <code>LSInput</code> from which the source 
 *   document is to be read. 
 * @return An XSModel representing this schema.
 */
public XSModel load(LSInput is) {
  try {
    fGrammarPool.clear();
    return ((XSGrammar) fSchemaLoader.loadGrammar(fSchemaLoader.dom2xmlInputSource(is))).toXSModel();
  } 
  catch (Exception e) {
    fSchemaLoader.reportDOMFatalError(e);
    return null;
  }
}

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

/**
 * Parse an XML Schema document from a location identified by a URI 
 * reference. If the URI contains a fragment identifier, the behavior is 
 * not defined by this specification. 
 * @param uri The location of the XML Schema document to be read.
 * @return An XSModel representing this schema.
 */
public XSModel loadURI(String uri) {
  try {
    fGrammarPool.clear();
    return ((XSGrammar) fSchemaLoader.loadGrammar(new XMLInputSource(null, uri, null))).toXSModel();
  }
  catch (Exception e){
    fSchemaLoader.reportDOMFatalError(e);
    return null;
  }
}

代码示例来源:origin: de.tudarmstadt.ukp.dkpro.core/de.tudarmstadt.ukp.dkpro.core.io.wsdl-asl

schemaModel = xsGrammar.toXSModel();

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-core

try {
  XSGrammar xsg = (XSGrammar) parser.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, source);
  org.apache.xerces.xs.XSModel xsm = xsg.toXSModel();
  XSNamedMap map = xsm.getComponents(XSTypeDefinition.SIMPLE_TYPE);
  int numDefs = map.getLength();

代码示例来源:origin: org.eclipse/org.eclipse.wst.wsi

xsModel = grammar.toXSModel();

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

xsModel = grammar.toXSModel();

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

StringList namespaces = grammar.toXSModel().getNamespaces();
    if(namespaces.contains(targetNamespace))
xsModel = grammar.toXSModel();

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