com.sun.xml.internal.rngom.parse.IllegalSchemaException Java Examples

The following examples show how to use com.sun.xml.internal.rngom.parse.IllegalSchemaException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CompactSyntax.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
final public void Include(GrammarSection section, Scope scope, Annotations a) throws ParseException {
Token t;
String href;
String ns;
Include include = section.makeInclude();
  t = jj_consume_token(7);
  href = Literal();
  ns = Inherit();
  switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  case 11:
    jj_consume_token(11);
    a = IncludeBody(include, scope, a);
                                          topLevelComments(include);
    jj_consume_token(12);
    break;
  default:
    jj_la1[41] = jj_gen;
    ;
  }
  try {
    include.endInclude(parseable, resolve(href), ns, makeLocation(t), a);
  }
  catch (IllegalSchemaException e) { }
}
 
Example #2
Source File: CompactSyntax.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
final public void Include(GrammarSection section, Scope scope, Annotations a) throws ParseException {
Token t;
String href;
String ns;
Include include = section.makeInclude();
  t = jj_consume_token(7);
  href = Literal();
  ns = Inherit();
  switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  case 11:
    jj_consume_token(11);
    a = IncludeBody(include, scope, a);
                                          topLevelComments(include);
    jj_consume_token(12);
    break;
  default:
    jj_la1[41] = jj_gen;
    ;
  }
  try {
    include.endInclude(parseable, resolve(href), ns, makeLocation(t), a);
  }
  catch (IllegalSchemaException e) { }
}
 
Example #3
Source File: SchemaBuilderImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public ParsedPattern makeExternalRef(Parseable current, String uri, String ns, Scope scope,
        Location loc, Annotations anno)
        throws BuildException {
    for (OpenIncludes inc = openIncludes;
            inc != null;
            inc = inc.parent) {
        if (inc.uri.equals(uri)) {
            error("recursive_include", uri, (Locator) loc);
            return pb.makeError();
        }
    }
    try {
        return current.parseExternal(uri, new SchemaBuilderImpl(ns, uri, this), scope, ns);
    } catch (IllegalSchemaException e) {
        noteError();
        return pb.makeError();
    }
}
 
Example #4
Source File: CompactSyntax.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
final public void Include(GrammarSection section, Scope scope, Annotations a) throws ParseException {
Token t;
String href;
String ns;
Include include = section.makeInclude();
  t = jj_consume_token(7);
  href = Literal();
  ns = Inherit();
  switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  case 11:
    jj_consume_token(11);
    a = IncludeBody(include, scope, a);
                                          topLevelComments(include);
    jj_consume_token(12);
    break;
  default:
    jj_la1[41] = jj_gen;
    ;
  }
  try {
    include.endInclude(parseable, resolve(href), ns, makeLocation(t), a);
  }
  catch (IllegalSchemaException e) { }
}
 
Example #5
Source File: SchemaBuilderImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public ParsedPattern makeExternalRef(Parseable current, String uri, String ns, Scope scope,
        Location loc, Annotations anno)
        throws BuildException {
    for (OpenIncludes inc = openIncludes;
            inc != null;
            inc = inc.parent) {
        if (inc.uri.equals(uri)) {
            error("recursive_include", uri, (Locator) loc);
            return pb.makeError();
        }
    }
    try {
        return current.parseExternal(uri, new SchemaBuilderImpl(ns, uri, this), scope, ns);
    } catch (IllegalSchemaException e) {
        noteError();
        return pb.makeError();
    }
}
 
Example #6
Source File: CompactSyntax.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
final public void Include(GrammarSection section, Scope scope, Annotations a) throws ParseException {
Token t;
String href;
String ns;
Include include = section.makeInclude();
  t = jj_consume_token(7);
  href = Literal();
  ns = Inherit();
  switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  case 11:
    jj_consume_token(11);
    a = IncludeBody(include, scope, a);
                                          topLevelComments(include);
    jj_consume_token(12);
    break;
  default:
    jj_la1[41] = jj_gen;
    ;
  }
  try {
    include.endInclude(parseable, resolve(href), ns, makeLocation(t), a);
  }
  catch (IllegalSchemaException e) { }
}
 
Example #7
Source File: CompactSyntax.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
final public void Include(GrammarSection section, Scope scope, Annotations a) throws ParseException {
Token t;
String href;
String ns;
Include include = section.makeInclude();
  t = jj_consume_token(7);
  href = Literal();
  ns = Inherit();
  switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  case 11:
    jj_consume_token(11);
    a = IncludeBody(include, scope, a);
                                          topLevelComments(include);
    jj_consume_token(12);
    break;
  default:
    jj_la1[41] = jj_gen;
    ;
  }
  try {
    include.endInclude(parseable, resolve(href), ns, makeLocation(t), a);
  }
  catch (IllegalSchemaException e) { }
}
 
Example #8
Source File: CompactSyntax.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
final public ParsedPattern ExternalRefExpr(Scope scope, Annotations a) throws ParseException {
Token t;
String href;
String ns;
  t = jj_consume_token(33);
  href = Literal();
  ns = Inherit();
  try {
    {if (true) return sb.makeExternalRef(parseable, resolve(href), ns, scope, makeLocation(t), a);}
  }
  catch (IllegalSchemaException e) {
    {if (true) return sb.makeErrorPattern();}
  }
  throw new Error("Missing return statement in function");
}
 
Example #9
Source File: SchemaBuilderImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void endInclude(Parseable current, String uri, String ns,
        Location loc, Annotations anno) throws BuildException {
    for (OpenIncludes inc = sb.openIncludes;
            inc != null;
            inc = inc.parent) {
        if (inc.uri.equals(uri)) {
            sb.error("recursive_include", uri, (Locator) loc);
            return;
        }
    }

    for (Override o = overrides; o != null; o = o.next) {
        o.replacementStatus = o.prp.getReplacementStatus();
        o.prp.setReplacementStatus(RefPattern.REPLACEMENT_REQUIRE);
    }
    try {
        SchemaBuilderImpl isb = new SchemaBuilderImpl(ns, uri, sb);
        current.parseInclude(uri, isb, new GrammarImpl(isb, grammar), ns);
        for (Override o = overrides; o != null; o = o.next) {
            if (o.prp.getReplacementStatus() == RefPattern.REPLACEMENT_REQUIRE) {
                if (o.prp.getName() == null) {
                    sb.error("missing_start_replacement", (Locator) loc);
                } else {
                    sb.error("missing_define_replacement", o.prp.getName(), (Locator) loc);
                }
            }
        }
    } catch (IllegalSchemaException e) {
        sb.noteError();
    } finally {
        for (Override o = overrides; o != null; o = o.next) {
            o.prp.setReplacementStatus(o.replacementStatus);
        }
    }
}
 
Example #10
Source File: SchemaParser.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
ParsedPattern makePattern() {
    if (href != null) {
        try {
            return schemaBuilder.makeExternalRef(parseable,
                    href,
                    getNs(),
                    scope,
                    startLocation,
                    annotations);
        } catch (IllegalSchemaException e) {
        }
    }
    return schemaBuilder.makeErrorPattern();
}
 
Example #11
Source File: SchemaParser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
void end() throws SAXException {
    super.end();
    if (href != null) {
        try {
            include.endInclude(parseable, href, getNs(), startLocation, annotations);
        } catch (IllegalSchemaException e) {
        }
    }
}
 
Example #12
Source File: SchemaParser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
void end() throws SAXException {
    super.end();
    if (href != null) {
        try {
            include.endInclude(parseable, href, getNs(), startLocation, annotations);
        } catch (IllegalSchemaException e) {
        }
    }
}
 
Example #13
Source File: SchemaBuilderImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void endInclude(Parseable current, String uri, String ns,
        Location loc, Annotations anno) throws BuildException {
    for (OpenIncludes inc = sb.openIncludes;
            inc != null;
            inc = inc.parent) {
        if (inc.uri.equals(uri)) {
            sb.error("recursive_include", uri, (Locator) loc);
            return;
        }
    }

    for (Override o = overrides; o != null; o = o.next) {
        o.replacementStatus = o.prp.getReplacementStatus();
        o.prp.setReplacementStatus(RefPattern.REPLACEMENT_REQUIRE);
    }
    try {
        SchemaBuilderImpl isb = new SchemaBuilderImpl(ns, uri, sb);
        current.parseInclude(uri, isb, new GrammarImpl(isb, grammar), ns);
        for (Override o = overrides; o != null; o = o.next) {
            if (o.prp.getReplacementStatus() == RefPattern.REPLACEMENT_REQUIRE) {
                if (o.prp.getName() == null) {
                    sb.error("missing_start_replacement", (Locator) loc);
                } else {
                    sb.error("missing_define_replacement", o.prp.getName(), (Locator) loc);
                }
            }
        }
    } catch (IllegalSchemaException e) {
        sb.noteError();
    } finally {
        for (Override o = overrides; o != null; o = o.next) {
            o.prp.setReplacementStatus(o.replacementStatus);
        }
    }
}
 
Example #14
Source File: CheckingSchemaBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public ParsedPattern expandPattern(ParsedPattern p)
    throws BuildException, IllegalSchemaException {

    // just return the result from the user-given SchemaBuilder
    ParsedPatternHost r = (ParsedPatternHost)super.expandPattern(p);
    return r.rhs;
}
 
Example #15
Source File: ModelLoader.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Common part between the XML syntax and the compact syntax.
 */
private Model loadRELAXNG(Parseable p) {
    SchemaBuilder sb = new CheckingSchemaBuilder(new DSchemaBuilderImpl(),errorReceiver);

    try {
        DPattern out = (DPattern)p.parse(sb);
        return RELAXNGCompiler.build(out,codeModel,opt);
    } catch (IllegalSchemaException e) {
        errorReceiver.error(e.getMessage(),e);
        return null;
    }
}
 
Example #16
Source File: IncludeHost.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void endInclude(Parseable current, String uri, String ns, Location _loc, Annotations _anno) throws BuildException, IllegalSchemaException {
    LocationHost loc = cast(_loc);
    AnnotationsHost anno = cast(_anno);

    lhs.endInclude( current, uri, ns, loc.lhs, anno.lhs );
    rhs.endInclude( current, uri, ns, loc.rhs, anno.rhs );
}
 
Example #17
Source File: SchemaBuilderImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void endInclude(Parseable current, String uri, String ns,
        Location loc, Annotations anno) throws BuildException {
    for (OpenIncludes inc = sb.openIncludes;
            inc != null;
            inc = inc.parent) {
        if (inc.uri.equals(uri)) {
            sb.error("recursive_include", uri, (Locator) loc);
            return;
        }
    }

    for (Override o = overrides; o != null; o = o.next) {
        o.replacementStatus = o.prp.getReplacementStatus();
        o.prp.setReplacementStatus(RefPattern.REPLACEMENT_REQUIRE);
    }
    try {
        SchemaBuilderImpl isb = new SchemaBuilderImpl(ns, uri, sb);
        current.parseInclude(uri, isb, new GrammarImpl(isb, grammar), ns);
        for (Override o = overrides; o != null; o = o.next) {
            if (o.prp.getReplacementStatus() == RefPattern.REPLACEMENT_REQUIRE) {
                if (o.prp.getName() == null) {
                    sb.error("missing_start_replacement", (Locator) loc);
                } else {
                    sb.error("missing_define_replacement", o.prp.getName(), (Locator) loc);
                }
            }
        }
    } catch (IllegalSchemaException e) {
        sb.noteError();
    } finally {
        for (Override o = overrides; o != null; o = o.next) {
            o.prp.setReplacementStatus(o.replacementStatus);
        }
    }
}
 
Example #18
Source File: SchemaBuilderHost.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public ParsedPattern makeExternalRef(Parseable current, String uri,
    String ns, Scope _scope, Location _loc, Annotations _anno)
    throws BuildException, IllegalSchemaException {

    ScopeHost scope = (ScopeHost) _scope;
    LocationHost loc = cast(_loc);
    AnnotationsHost anno = cast(_anno);

    return new ParsedPatternHost(
        lhs.makeExternalRef(current, uri, ns, scope.lhs, loc.lhs, anno.lhs),
        rhs.makeExternalRef(current, uri, ns, scope.rhs, loc.rhs, anno.rhs) );
}
 
Example #19
Source File: CheckingSchemaBuilder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public ParsedPattern expandPattern(ParsedPattern p)
    throws BuildException, IllegalSchemaException {

    // just return the result from the user-given SchemaBuilder
    ParsedPatternHost r = (ParsedPatternHost)super.expandPattern(p);
    return r.rhs;
}
 
Example #20
Source File: CompactSyntax.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
final public ParsedPattern ExternalRefExpr(Scope scope, Annotations a) throws ParseException {
Token t;
String href;
String ns;
  t = jj_consume_token(33);
  href = Literal();
  ns = Inherit();
  try {
    {if (true) return sb.makeExternalRef(parseable, resolve(href), ns, scope, makeLocation(t), a);}
  }
  catch (IllegalSchemaException e) {
    {if (true) return sb.makeErrorPattern();}
  }
  throw new Error("Missing return statement in function");
}
 
Example #21
Source File: SchemaBuilderHost.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public ParsedPattern makeExternalRef(Parseable current, String uri,
    String ns, Scope _scope, Location _loc, Annotations _anno)
    throws BuildException, IllegalSchemaException {

    ScopeHost scope = (ScopeHost) _scope;
    LocationHost loc = cast(_loc);
    AnnotationsHost anno = cast(_anno);

    return new ParsedPatternHost(
        lhs.makeExternalRef(current, uri, ns, scope.lhs, loc.lhs, anno.lhs),
        rhs.makeExternalRef(current, uri, ns, scope.rhs, loc.rhs, anno.rhs) );
}
 
Example #22
Source File: SchemaParser.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
ParsedPattern makePattern() {
    if (href != null) {
        try {
            return schemaBuilder.makeExternalRef(parseable,
                    href,
                    getNs(),
                    scope,
                    startLocation,
                    annotations);
        } catch (IllegalSchemaException e) {
        }
    }
    return schemaBuilder.makeErrorPattern();
}
 
Example #23
Source File: SchemaParser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
ParsedPattern makePattern() {
    if (href != null) {
        try {
            return schemaBuilder.makeExternalRef(parseable,
                    href,
                    getNs(),
                    scope,
                    startLocation,
                    annotations);
        } catch (IllegalSchemaException e) {
        }
    }
    return schemaBuilder.makeErrorPattern();
}
 
Example #24
Source File: SchemaParser.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
void end() throws SAXException {
    super.end();
    if (href != null) {
        try {
            include.endInclude(parseable, href, getNs(), startLocation, annotations);
        } catch (IllegalSchemaException e) {
        }
    }
}
 
Example #25
Source File: SchemaBuilderHost.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public ParsedPattern makeExternalRef(Parseable current, String uri,
    String ns, Scope _scope, Location _loc, Annotations _anno)
    throws BuildException, IllegalSchemaException {

    ScopeHost scope = (ScopeHost) _scope;
    LocationHost loc = cast(_loc);
    AnnotationsHost anno = cast(_anno);

    return new ParsedPatternHost(
        lhs.makeExternalRef(current, uri, ns, scope.lhs, loc.lhs, anno.lhs),
        rhs.makeExternalRef(current, uri, ns, scope.rhs, loc.rhs, anno.rhs) );
}
 
Example #26
Source File: IncludeHost.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void endInclude(Parseable current, String uri, String ns, Location _loc, Annotations _anno) throws BuildException, IllegalSchemaException {
    LocationHost loc = cast(_loc);
    AnnotationsHost anno = cast(_anno);

    lhs.endInclude( current, uri, ns, loc.lhs, anno.lhs );
    rhs.endInclude( current, uri, ns, loc.rhs, anno.rhs );
}
 
Example #27
Source File: ModelLoader.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Common part between the XML syntax and the compact syntax.
 */
private Model loadRELAXNG(Parseable p) {
    SchemaBuilder sb = new CheckingSchemaBuilder(new DSchemaBuilderImpl(),errorReceiver);

    try {
        DPattern out = (DPattern)p.parse(sb);
        return RELAXNGCompiler.build(out,codeModel,opt);
    } catch (IllegalSchemaException e) {
        errorReceiver.error(e.getMessage(),e);
        return null;
    }
}
 
Example #28
Source File: CheckingSchemaBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public ParsedPattern expandPattern(ParsedPattern p)
    throws BuildException, IllegalSchemaException {

    // just return the result from the user-given SchemaBuilder
    ParsedPatternHost r = (ParsedPatternHost)super.expandPattern(p);
    return r.rhs;
}
 
Example #29
Source File: CompactSyntax.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
final public ParsedPattern ExternalRefExpr(Scope scope, Annotations a) throws ParseException {
Token t;
String href;
String ns;
  t = jj_consume_token(33);
  href = Literal();
  ns = Inherit();
  try {
    {if (true) return sb.makeExternalRef(parseable, resolve(href), ns, scope, makeLocation(t), a);}
  }
  catch (IllegalSchemaException e) {
    {if (true) return sb.makeErrorPattern();}
  }
  throw new Error("Missing return statement in function");
}
 
Example #30
Source File: CheckingSchemaBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public ParsedPattern expandPattern(ParsedPattern p)
    throws BuildException, IllegalSchemaException {

    // just return the result from the user-given SchemaBuilder
    ParsedPatternHost r = (ParsedPatternHost)super.expandPattern(p);
    return r.rhs;
}