void processNonNcNames(TreeBuilder<?> treeBuilder, XmlViolationPolicy namePolicy) throws SAXException { for (int i = 0; i < length; i++) { AttributeName attName = names[i]; if (!attName.isNcName(mode)) { String name = attName.getLocal(mode); switch (namePolicy) { case ALTER_INFOSET: names[i] = AttributeName.create(NCName.escapeName(name)); // fall through case ALLOW: if (attName != AttributeName.XML_LANG) { treeBuilder.warn("Attribute \u201C" + name + "\u201D is not serializable as XML 1.0."); } break; case FATAL: treeBuilder.fatal("Attribute \u201C" + name + "\u201D is not serializable as XML 1.0."); break; } } } }
private String checkPopName(@Local String name) throws SAXException { if (NCName.isNCName(name)) { return name; } else { switch (namePolicy) { case ALLOW: warn("Element name \u201C" + name + "\u201D cannot be represented as XML 1.0."); return name; case ALTER_INFOSET: warn("Element name \u201C" + name + "\u201D cannot be represented as XML 1.0."); return NCName.escapeName(name); case FATAL: fatal("Element name \u201C" + name + "\u201D cannot be represented as XML 1.0."); } } return null; // keep compiler happy }
private String checkPopName(@Local String name) throws SAXException { if (NCName.isNCName(name)) { return name; } else { switch (namePolicy) { case ALLOW: warn("Element name \u201C" + name + "\u201D cannot be represented as XML 1.0."); return name; case ALTER_INFOSET: warn("Element name \u201C" + name + "\u201D cannot be represented as XML 1.0."); return NCName.escapeName(name); case FATAL: fatal("Element name \u201C" + name + "\u201D cannot be represented as XML 1.0."); } } return null; // keep compiler happy }
void processNonNcNames(TreeBuilder<?> treeBuilder, XmlViolationPolicy namePolicy) throws SAXException { for (int i = 0; i < length; i++) { AttributeName attName = names[i]; if (!attName.isNcName(mode)) { String name = attName.getLocal(mode); switch (namePolicy) { case ALTER_INFOSET: names[i] = AttributeName.create(NCName.escapeName(name)); // fall through case ALLOW: if (attName != AttributeName.XML_LANG) { treeBuilder.warn("Attribute \u201C" + name + "\u201D is not serializable as XML 1.0."); } break; case FATAL: treeBuilder.fatal("Attribute \u201C" + name + "\u201D is not serializable as XML 1.0."); break; } } } }
void processNonNcNames(TreeBuilder<?> treeBuilder, XmlViolationPolicy namePolicy) throws SAXException { for (int i = 0; i < length; i++) { AttributeName attName = names[i]; if (!attName.isNcName(mode)) { String name = attName.getLocal(mode); switch (namePolicy) { case ALTER_INFOSET: names[i] = AttributeName.create(NCName.escapeName(name)); // fall through case ALLOW: if (attName != AttributeName.XML_LANG) { treeBuilder.warn("Attribute \u201C" + name + "\u201D is not serializable as XML 1.0."); } break; case FATAL: treeBuilder.fatal("Attribute \u201C" + name + "\u201D is not serializable as XML 1.0."); break; } } } }
private String checkPopName(@Local String name) throws SAXException { if (NCName.isNCName(name)) { return name; } else { switch (namePolicy) { case ALLOW: warn("Element name \u201C" + name + "\u201D cannot be represented as XML 1.0."); return name; case ALTER_INFOSET: warn("Element name \u201C" + name + "\u201D cannot be represented as XML 1.0."); return NCName.escapeName(name); case FATAL: fatal("Element name \u201C" + name + "\u201D cannot be represented as XML 1.0."); } } return null; // keep compiler happy }