/** * @see nu.validator.htmlparser.sax.XmlSerializer#checkNCName() */ @Override protected void checkNCName(String name) throws SAXException { if (!NCName.isNCName(name)) { throw new SAXException("Not an XML 1.0 4th ed. NCName: " + name); } }
/** * @see nu.validator.htmlparser.sax.XmlSerializer#checkNCName() */ @Override protected void checkNCName(String name) throws SAXException { if (!NCName.isNCName(name)) { throw new SAXException("Not an XML 1.0 4th ed. NCName: " + name); } }
/** * @see nu.validator.htmlparser.sax.XmlSerializer#checkNCName() */ @Override protected void checkNCName(String name) throws SAXException { if (!NCName.isNCName(name)) { throw new SAXException("Not an XML 1.0 4th ed. NCName: " + name); } }
/** * Creates an <code>AttributeName</code> for a local name. * * @param name * the name * @param checkNcName * whether to check ncnameness * @return an <code>AttributeName</code> */ static AttributeName createAttributeName(@Local String name // [NOCPP[ , boolean checkNcName // ]NOCPP] ) { // [NOCPP[ int flags = NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG; if (name.startsWith("xmlns:")) { flags = IS_XMLNS; } else if (checkNcName && !NCName.isNCName(name)) { flags = 0; } // ]NOCPP] return new AttributeName(AttributeName.ALL_NO_NS, AttributeName.SAME_LOCAL(name), ALL_NO_PREFIX, flags); }
/** * Creates an <code>AttributeName</code> for a local name. * * @param name * the name * @param checkNcName * whether to check ncnameness * @return an <code>AttributeName</code> */ private static AttributeName createAttributeName(@Local String name // [NOCPP[ , boolean checkNcName // ]NOCPP] ) { // [NOCPP[ int flags = NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG; if (name.startsWith("xmlns:")) { flags = IS_XMLNS; } else if (checkNcName && !NCName.isNCName(name)) { flags = 0; } // ]NOCPP] return new AttributeName(AttributeName.ALL_NO_NS, AttributeName.SAME_LOCAL(name), ALL_NO_PREFIX, flags); }
/** * Creates an <code>AttributeName</code> for a local name. * * @param name * the name * @param checkNcName * whether to check ncnameness * @return an <code>AttributeName</code> */ static AttributeName createAttributeName(@Local String name // [NOCPP[ , boolean checkNcName // ]NOCPP] ) { // [NOCPP[ int flags = NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG; if (name.startsWith("xmlns:")) { flags = IS_XMLNS; } else if (checkNcName && !NCName.isNCName(name)) { flags = 0; } // ]NOCPP] return new AttributeName(AttributeName.ALL_NO_NS, AttributeName.SAME_LOCAL(name), ALL_NO_PREFIX, flags); }
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 }
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 }
if (!NCName.isNCName(attLocal)) { err("Bad attribute name \u201c" + attLocal + "\u201d. Attribute names for the"