Package com.caucho.relaxng.program

Examples of com.caucho.relaxng.program.Item


    else
      syntaxPrefix = "<" + parentName + "> syntax: ";
   
    String msg = "";

    Item topParent = null;
    for (Item parent = item;
         parent != null;
         parent = null) { // parent.getParent()) {
      if (qName != null && parent.allowsElement(qName)) {
        msg = "\n Check for duplicate and out-of-order tags.";

        if (expected != null)
          msg += expected + "\n";

        msg += "\n";

        String prefix = "Syntax: ";
        if (parent == parentItem)
          prefix = syntaxPrefix;

        msg += prefix + parent.toSyntaxDescription(prefix.length());
        break;
      }
     
      // topParent = parent;
    }

    if (topParent == null || topParent instanceof EmptyItem) {
      topParent = parentItem;

      if (qName != null && topParent.allowsElement(qName)) {
        msg = "\n Check for duplicate and out-of-order tags.";

        if (expected != null)
          msg += expected + "\n";

        msg += "\n";

        String prefix = syntaxPrefix;
        msg += prefix + topParent.toSyntaxDescription(prefix.length());
      }
    }

    if (msg.equals("")) {
      msg = "";

      if (expected != null)
        msg += expected + "\n";
     
      msg += "\n";

      String prefix = syntaxPrefix;
      msg += prefix + topParent.toSyntaxDescription(prefix.length());
    }

    return msg;
  }
View Full Code Here


    throws RelaxException
  {
    if (_patterns.size() == 0)
      return null;

    Item tail = _patterns.get(_patterns.size() - 1).createItem(grammar);

    for (int i = _patterns.size() - 2; i >= 0; i--)
      tail = GroupItem.create(_patterns.get(i).createItem(grammar), tail);
   
    return tail;
View Full Code Here

TOP

Related Classes of com.caucho.relaxng.program.Item

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.