Java Code Examples for com.sun.xml.internal.rngom.util.Uri#escapeDisallowedChars()

The following examples show how to use com.sun.xml.internal.rngom.util.Uri#escapeDisallowedChars() . 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: SchemaParser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
void attributes(Attributes atts) throws SAXException {
    int len = atts.getLength();
    for (int i = 0; i < len; i++) {
        String uri = atts.getURI(i);
        if (uri.length() == 0) {
            String name = atts.getLocalName(i);
            if (name.equals("name")) {
                setName(atts.getValue(i).trim());
            } else if (name.equals("ns")) {
                ns = atts.getValue(i);
            } else if (name.equals("datatypeLibrary")) {
                datatypeLibrary = atts.getValue(i);
                checkUri(datatypeLibrary);
                if (!datatypeLibrary.equals("")
                        && !Uri.isAbsolute(datatypeLibrary)) {
                    error("relative_datatype_library");
                }
                if (Uri.hasFragmentId(datatypeLibrary)) {
                    error("fragment_identifier_datatype_library");
                }
                datatypeLibrary = Uri.escapeDisallowedChars(datatypeLibrary);
            } else {
                setOtherAttribute(name, atts.getValue(i));
            }
        } else if (uri.equals(relaxngURI)) {
            error("qualified_attribute", atts.getLocalName(i));
        } else if (uri.equals(WellKnownNamespaces.XML)
                && atts.getLocalName(i).equals("base")) {
            xmlBaseHandler.xmlBaseAttribute(atts.getValue(i));
        } else {
            if (annotations == null) {
                annotations = schemaBuilder.makeAnnotations(null, getContext());
            }
            annotations.addAttribute(uri, atts.getLocalName(i), findPrefix(atts.getQName(i), uri),
                    atts.getValue(i), startLocation);
        }
    }
    endAttributes();
}
 
Example 2
Source File: SchemaParser.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private String resolve(String systemId) throws SAXException {
    if (Uri.hasFragmentId(systemId)) {
        error("href_fragment_id");
    }
    systemId = Uri.escapeDisallowedChars(systemId);
    return Uri.resolve(xmlBaseHandler.getBaseUri(), systemId);
}
 
Example 3
Source File: SchemaParser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
void attributes(Attributes atts) throws SAXException {
    int len = atts.getLength();
    for (int i = 0; i < len; i++) {
        String uri = atts.getURI(i);
        if (uri.length() == 0) {
            String name = atts.getLocalName(i);
            if (name.equals("name")) {
                setName(atts.getValue(i).trim());
            } else if (name.equals("ns")) {
                ns = atts.getValue(i);
            } else if (name.equals("datatypeLibrary")) {
                datatypeLibrary = atts.getValue(i);
                checkUri(datatypeLibrary);
                if (!datatypeLibrary.equals("")
                        && !Uri.isAbsolute(datatypeLibrary)) {
                    error("relative_datatype_library");
                }
                if (Uri.hasFragmentId(datatypeLibrary)) {
                    error("fragment_identifier_datatype_library");
                }
                datatypeLibrary = Uri.escapeDisallowedChars(datatypeLibrary);
            } else {
                setOtherAttribute(name, atts.getValue(i));
            }
        } else if (uri.equals(relaxngURI)) {
            error("qualified_attribute", atts.getLocalName(i));
        } else if (uri.equals(WellKnownNamespaces.XML)
                && atts.getLocalName(i).equals("base")) {
            xmlBaseHandler.xmlBaseAttribute(atts.getValue(i));
        } else {
            if (annotations == null) {
                annotations = schemaBuilder.makeAnnotations(null, getContext());
            }
            annotations.addAttribute(uri, atts.getLocalName(i), findPrefix(atts.getQName(i), uri),
                    atts.getValue(i), startLocation);
        }
    }
    endAttributes();
}
 
Example 4
Source File: SchemaParser.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private String resolve(String systemId) throws SAXException {
    if (Uri.hasFragmentId(systemId)) {
        error("href_fragment_id");
    }
    systemId = Uri.escapeDisallowedChars(systemId);
    return Uri.resolve(xmlBaseHandler.getBaseUri(), systemId);
}
 
Example 5
Source File: XmlBaseHandler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void xmlBaseAttribute(String value) {
  Entry entry = new Entry();
  entry.parent = stack;
  stack = entry;
  entry.attValue = Uri.escapeDisallowedChars(value);
  entry.systemId = getSystemId();
  entry.depth = depth;
}
 
Example 6
Source File: SchemaParser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private String resolve(String systemId) throws SAXException {
    if (Uri.hasFragmentId(systemId)) {
        error("href_fragment_id");
    }
    systemId = Uri.escapeDisallowedChars(systemId);
    return Uri.resolve(xmlBaseHandler.getBaseUri(), systemId);
}
 
Example 7
Source File: SchemaParser.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private String resolve(String systemId) throws SAXException {
    if (Uri.hasFragmentId(systemId)) {
        error("href_fragment_id");
    }
    systemId = Uri.escapeDisallowedChars(systemId);
    return Uri.resolve(xmlBaseHandler.getBaseUri(), systemId);
}
 
Example 8
Source File: SchemaParser.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
void attributes(Attributes atts) throws SAXException {
    int len = atts.getLength();
    for (int i = 0; i < len; i++) {
        String uri = atts.getURI(i);
        if (uri.length() == 0) {
            String name = atts.getLocalName(i);
            if (name.equals("name")) {
                setName(atts.getValue(i).trim());
            } else if (name.equals("ns")) {
                ns = atts.getValue(i);
            } else if (name.equals("datatypeLibrary")) {
                datatypeLibrary = atts.getValue(i);
                checkUri(datatypeLibrary);
                if (!datatypeLibrary.equals("")
                        && !Uri.isAbsolute(datatypeLibrary)) {
                    error("relative_datatype_library");
                }
                if (Uri.hasFragmentId(datatypeLibrary)) {
                    error("fragment_identifier_datatype_library");
                }
                datatypeLibrary = Uri.escapeDisallowedChars(datatypeLibrary);
            } else {
                setOtherAttribute(name, atts.getValue(i));
            }
        } else if (uri.equals(relaxngURI)) {
            error("qualified_attribute", atts.getLocalName(i));
        } else if (uri.equals(WellKnownNamespaces.XML)
                && atts.getLocalName(i).equals("base")) {
            xmlBaseHandler.xmlBaseAttribute(atts.getValue(i));
        } else {
            if (annotations == null) {
                annotations = schemaBuilder.makeAnnotations(null, getContext());
            }
            annotations.addAttribute(uri, atts.getLocalName(i), findPrefix(atts.getQName(i), uri),
                    atts.getValue(i), startLocation);
        }
    }
    endAttributes();
}
 
Example 9
Source File: XmlBaseHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void xmlBaseAttribute(String value) {
  Entry entry = new Entry();
  entry.parent = stack;
  stack = entry;
  entry.attValue = Uri.escapeDisallowedChars(value);
  entry.systemId = getSystemId();
  entry.depth = depth;
}
 
Example 10
Source File: SchemaParser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private String resolve(String systemId) throws SAXException {
    if (Uri.hasFragmentId(systemId)) {
        error("href_fragment_id");
    }
    systemId = Uri.escapeDisallowedChars(systemId);
    return Uri.resolve(xmlBaseHandler.getBaseUri(), systemId);
}
 
Example 11
Source File: XmlBaseHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void xmlBaseAttribute(String value) {
  Entry entry = new Entry();
  entry.parent = stack;
  stack = entry;
  entry.attValue = Uri.escapeDisallowedChars(value);
  entry.systemId = getSystemId();
  entry.depth = depth;
}
 
Example 12
Source File: XmlBaseHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void xmlBaseAttribute(String value) {
  Entry entry = new Entry();
  entry.parent = stack;
  stack = entry;
  entry.attValue = Uri.escapeDisallowedChars(value);
  entry.systemId = getSystemId();
  entry.depth = depth;
}
 
Example 13
Source File: SchemaParser.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private String resolve(String systemId) throws SAXException {
    if (Uri.hasFragmentId(systemId)) {
        error("href_fragment_id");
    }
    systemId = Uri.escapeDisallowedChars(systemId);
    return Uri.resolve(xmlBaseHandler.getBaseUri(), systemId);
}
 
Example 14
Source File: SchemaParser.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
void attributes(Attributes atts) throws SAXException {
    int len = atts.getLength();
    for (int i = 0; i < len; i++) {
        String uri = atts.getURI(i);
        if (uri.length() == 0) {
            String name = atts.getLocalName(i);
            if (name.equals("name")) {
                setName(atts.getValue(i).trim());
            } else if (name.equals("ns")) {
                ns = atts.getValue(i);
            } else if (name.equals("datatypeLibrary")) {
                datatypeLibrary = atts.getValue(i);
                checkUri(datatypeLibrary);
                if (!datatypeLibrary.equals("")
                        && !Uri.isAbsolute(datatypeLibrary)) {
                    error("relative_datatype_library");
                }
                if (Uri.hasFragmentId(datatypeLibrary)) {
                    error("fragment_identifier_datatype_library");
                }
                datatypeLibrary = Uri.escapeDisallowedChars(datatypeLibrary);
            } else {
                setOtherAttribute(name, atts.getValue(i));
            }
        } else if (uri.equals(relaxngURI)) {
            error("qualified_attribute", atts.getLocalName(i));
        } else if (uri.equals(WellKnownNamespaces.XML)
                && atts.getLocalName(i).equals("base")) {
            xmlBaseHandler.xmlBaseAttribute(atts.getValue(i));
        } else {
            if (annotations == null) {
                annotations = schemaBuilder.makeAnnotations(null, getContext());
            }
            annotations.addAttribute(uri, atts.getLocalName(i), findPrefix(atts.getQName(i), uri),
                    atts.getValue(i), startLocation);
        }
    }
    endAttributes();
}
 
Example 15
Source File: XmlBaseHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void xmlBaseAttribute(String value) {
  Entry entry = new Entry();
  entry.parent = stack;
  stack = entry;
  entry.attValue = Uri.escapeDisallowedChars(value);
  entry.systemId = getSystemId();
  entry.depth = depth;
}
 
Example 16
Source File: SchemaParser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private String resolve(String systemId) throws SAXException {
    if (Uri.hasFragmentId(systemId)) {
        error("href_fragment_id");
    }
    systemId = Uri.escapeDisallowedChars(systemId);
    return Uri.resolve(xmlBaseHandler.getBaseUri(), systemId);
}
 
Example 17
Source File: SchemaParser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
void attributes(Attributes atts) throws SAXException {
    int len = atts.getLength();
    for (int i = 0; i < len; i++) {
        String uri = atts.getURI(i);
        if (uri.length() == 0) {
            String name = atts.getLocalName(i);
            if (name.equals("name")) {
                setName(atts.getValue(i).trim());
            } else if (name.equals("ns")) {
                ns = atts.getValue(i);
            } else if (name.equals("datatypeLibrary")) {
                datatypeLibrary = atts.getValue(i);
                checkUri(datatypeLibrary);
                if (!datatypeLibrary.equals("")
                        && !Uri.isAbsolute(datatypeLibrary)) {
                    error("relative_datatype_library");
                }
                if (Uri.hasFragmentId(datatypeLibrary)) {
                    error("fragment_identifier_datatype_library");
                }
                datatypeLibrary = Uri.escapeDisallowedChars(datatypeLibrary);
            } else {
                setOtherAttribute(name, atts.getValue(i));
            }
        } else if (uri.equals(relaxngURI)) {
            error("qualified_attribute", atts.getLocalName(i));
        } else if (uri.equals(WellKnownNamespaces.XML)
                && atts.getLocalName(i).equals("base")) {
            xmlBaseHandler.xmlBaseAttribute(atts.getValue(i));
        } else {
            if (annotations == null) {
                annotations = schemaBuilder.makeAnnotations(null, getContext());
            }
            annotations.addAttribute(uri, atts.getLocalName(i), findPrefix(atts.getQName(i), uri),
                    atts.getValue(i), startLocation);
        }
    }
    endAttributes();
}
 
Example 18
Source File: XmlBaseHandler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void xmlBaseAttribute(String value) {
  Entry entry = new Entry();
  entry.parent = stack;
  stack = entry;
  entry.attValue = Uri.escapeDisallowedChars(value);
  entry.systemId = getSystemId();
  entry.depth = depth;
}
 
Example 19
Source File: SchemaParser.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private String resolve(String systemId) throws SAXException {
    if (Uri.hasFragmentId(systemId)) {
        error("href_fragment_id");
    }
    systemId = Uri.escapeDisallowedChars(systemId);
    return Uri.resolve(xmlBaseHandler.getBaseUri(), systemId);
}
 
Example 20
Source File: SchemaParser.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
void attributes(Attributes atts) throws SAXException {
    int len = atts.getLength();
    for (int i = 0; i < len; i++) {
        String uri = atts.getURI(i);
        if (uri.length() == 0) {
            String name = atts.getLocalName(i);
            if (name.equals("name")) {
                setName(atts.getValue(i).trim());
            } else if (name.equals("ns")) {
                ns = atts.getValue(i);
            } else if (name.equals("datatypeLibrary")) {
                datatypeLibrary = atts.getValue(i);
                checkUri(datatypeLibrary);
                if (!datatypeLibrary.equals("")
                        && !Uri.isAbsolute(datatypeLibrary)) {
                    error("relative_datatype_library");
                }
                if (Uri.hasFragmentId(datatypeLibrary)) {
                    error("fragment_identifier_datatype_library");
                }
                datatypeLibrary = Uri.escapeDisallowedChars(datatypeLibrary);
            } else {
                setOtherAttribute(name, atts.getValue(i));
            }
        } else if (uri.equals(relaxngURI)) {
            error("qualified_attribute", atts.getLocalName(i));
        } else if (uri.equals(WellKnownNamespaces.XML)
                && atts.getLocalName(i).equals("base")) {
            xmlBaseHandler.xmlBaseAttribute(atts.getValue(i));
        } else {
            if (annotations == null) {
                annotations = schemaBuilder.makeAnnotations(null, getContext());
            }
            annotations.addAttribute(uri, atts.getLocalName(i), findPrefix(atts.getQName(i), uri),
                    atts.getValue(i), startLocation);
        }
    }
    endAttributes();
}