当前位置: 首页>>代码示例>>Java>>正文


Java SAXSource.setSystemId方法代码示例

本文整理汇总了Java中javax.xml.transform.sax.SAXSource.setSystemId方法的典型用法代码示例。如果您正苦于以下问题:Java SAXSource.setSystemId方法的具体用法?Java SAXSource.setSystemId怎么用?Java SAXSource.setSystemId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.xml.transform.sax.SAXSource的用法示例。


在下文中一共展示了SAXSource.setSystemId方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDataValidator

import javax.xml.transform.sax.SAXSource; //导入方法依赖的package包/类
@DataProvider(name = "data_ValidatorA")
public Object[][] getDataValidator() {
    DOMSource ds = getDOMSource(xml_val_test, xml_val_test_id, true, true, xml_catalog);

    SAXSource ss = new SAXSource(new InputSource(xml_val_test));
    ss.setSystemId(xml_val_test_id);

    StAXSource stax = getStaxSource(xml_val_test, xml_val_test_id, true, true, xml_catalog);
    StAXSource stax1 = getStaxSource(xml_val_test, xml_val_test_id, true, true, xml_catalog);

    StreamSource source = new StreamSource(new File(xml_val_test));

    return new Object[][]{
        // use catalog
        {true, false, true, ds, null, null, xml_catalog, null},
        {false, true, true, ds, null, null, null, xml_catalog},
        {true, false, true, ss, null, null, xml_catalog, null},
        {false, true, true, ss, null, null, null, xml_catalog},
        {true, false, true, stax, null, null, xml_catalog, xml_catalog},
        {false, true, true, stax1, null, null, xml_catalog, xml_catalog},
        {true, false, true, source, null, null, xml_catalog, null},
        {false, true, true, source, null, null, null, xml_catalog},
    };
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:CatalogSupport4.java

示例2: getDataValidator

import javax.xml.transform.sax.SAXSource; //导入方法依赖的package包/类
@DataProvider(name = "data_ValidatorC")
public Object[][] getDataValidator() {
    DOMSource ds = getDOMSource(xml_val_test, xml_val_test_id, true, true, xml_catalog);

    SAXSource ss = new SAXSource(new InputSource(xml_val_test));
    ss.setSystemId(xml_val_test_id);

    StAXSource stax = getStaxSource(xml_val_test, xml_val_test_id, false, true, xml_catalog);
    StAXSource stax1 = getStaxSource(xml_val_test, xml_val_test_id, false, true, xml_catalog);

    StreamSource source = new StreamSource(new File(xml_val_test));

    return new Object[][]{
        // use catalog
        {false, false, true, ds, null, null, xml_bogus_catalog, null},
        {false, false, true, ds, null, null, null, xml_bogus_catalog},
        {false, false, true, ss, null, null, xml_bogus_catalog, null},
        {false, false, true, ss, null, null, null, xml_bogus_catalog},
        {false, false, true, stax, null, null, xml_bogus_catalog, null},
        {false, false, true, stax1, null, null, null, xml_bogus_catalog},
        {false, false, true, source, null, null, xml_bogus_catalog, null},
        {false, false, true, source, null, null, null, xml_bogus_catalog},
    };
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:CatalogSupport5.java

示例3: supportLSResourceResolver1

import javax.xml.transform.sax.SAXSource; //导入方法依赖的package包/类
@DataProvider(name = "supportLSResourceResolver1")
public Object[][] supportLSResourceResolver1() throws Exception {
    URI catalogFile = getClass().getResource("CatalogSupport.xml").toURI();
    URI catalogFileUri = getClass().getResource("CatalogSupport_uri.xml").toURI();

    /*
     * val_test.xml has a reference to system.dtd and val_test.xsd
    */
    SAXSource ss = new SAXSource(new InputSource(xml_val_test));
    ss.setSystemId(xml_val_test_id);

    return new Object[][]{
        {catalogFile, ss},
        {catalogFileUri, ss},
     };
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:CatalogTest.java

示例4: supportURIResolver

import javax.xml.transform.sax.SAXSource; //导入方法依赖的package包/类
@DataProvider(name = "supportURIResolver")
public Object[][] supportURIResolver() throws Exception {
    URI catalogFile = getClass().getResource("CatalogSupport.xml").toURI();
    URI catalogFileUri = getClass().getResource("CatalogSupport_uri.xml").toURI();
    SAXSource xslSource = new SAXSource(new InputSource(new File(xsl_doc).toURI().toASCIIString()));

    /*
     * val_test.xml has a reference to system.dtd and val_test.xsd
    */
    SAXSource ss = new SAXSource(new InputSource(xml_val_test));
    ss.setSystemId(xml_val_test_id);

    return new Object[][]{
        {catalogFile, new SAXSource(new InputSource(new File(xsl_doc).toURI().toASCIIString())),
            new StreamSource(new File(xml_doc)), "Resolved by a catalog"},
        {catalogFileUri, new SAXSource(new InputSource(new StringReader(xsl_include))),
            new StreamSource(new StringReader(xml_xsl)), null},
     };
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:CatalogTest.java

示例5: getDataValidator

import javax.xml.transform.sax.SAXSource; //导入方法依赖的package包/类
@DataProvider(name = "data_ValidatorC")
public Object[][] getDataValidator() {
    DOMSource ds = getDOMSource(xml_val_test, xml_val_test_id, true, true, xml_catalog);

    SAXSource ss = new SAXSource(new InputSource(xml_val_test));
    ss.setSystemId(xml_val_test_id);

    StAXSource stax = getStaxSource(xml_val_test, xml_val_test_id, false, true, xml_catalog);
    StAXSource stax1 = getStaxSource(xml_val_test, xml_val_test_id, false, true, xml_catalog);

    StreamSource source = new StreamSource(new File(xml_val_test));

    return new Object[][]{
        // use catalog
        {false, false, true, ds, null, null, xml_catalog, null},
        {false, false, true, ds, null, null, null, xml_catalog},
        {false, false, true, ss, null, null, xml_catalog, null},
        {false, false, true, ss, null, null, null, xml_catalog},
        {false, false, true, stax, null, null, xml_catalog, null},
        {false, false, true, stax1, null, null, null, xml_catalog},
        {false, false, true, source, null, null, xml_catalog, null},
        {false, false, true, source, null, null, null, xml_catalog},
    };
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:CatalogSupport2.java

示例6: transform

import javax.xml.transform.sax.SAXSource; //导入方法依赖的package包/类
void transform(TransformerFactory factory) throws TransformerConfigurationException, TransformerException {
    SAXSource xslSource = new SAXSource(new InputSource(xslFile));
    xslSource.setSystemId(xslFileId);
    Transformer transformer = factory.newTransformer(xslSource);
    StringWriter stringResult = new StringWriter();
    Result result = new StreamResult(stringResult);
    transformer.transform(new SAXSource(new InputSource(xmlFile)), result);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:XSLTExFuncTest.java

示例7: getDataValidator

import javax.xml.transform.sax.SAXSource; //导入方法依赖的package包/类
@DataProvider(name = "data_ValidatorC")
public Object[][] getDataValidator() {
    DOMSource ds = getDOMSource(xml_val_test, xml_val_test_id, false, true, xml_catalog);

    SAXSource ss = new SAXSource(new InputSource(xml_val_test));
    ss.setSystemId(xml_val_test_id);

    StAXSource stax = getStaxSource(xml_val_test, xml_val_test_id, false, true, xml_catalog);
    StAXSource stax1 = getStaxSource(xml_val_test, xml_val_test_id, false, true, xml_catalog);

    StreamSource source = new StreamSource(new File(xml_val_test));

    return new Object[][]{
        // use catalog disabled through factory
        {true, false, false, ds, null, null, xml_catalog, null},
        {true, false, false, ds, null, null, null, xml_catalog},
        {true, false, false, ss, null, null, xml_catalog, null},
        {true, false, false, ss, null, null, null, xml_catalog},
        {true, false, false, stax, null, null, xml_catalog, null},
        {true, false, false, stax1, null, null, null, xml_catalog},
        {true, false, false, source, null, null, xml_catalog, null},
        {true, false, false, source, null, null, null, xml_catalog},
        // use catalog disabled through validatory
        {false, true, false, ds, null, null, xml_catalog, null},
        {false, true, false, ds, null, null, null, xml_catalog},
        {false, true, false, ss, null, null, xml_catalog, null},
        {false, true, false, ss, null, null, null, xml_catalog},
        {false, true, false, stax, null, null, xml_catalog, null},
        {false, true, false, stax1, null, null, null, xml_catalog},
        {false, true, false, source, null, null, xml_catalog, null},
        {false, true, false, source, null, null, null, xml_catalog},
    };
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:34,代码来源:CatalogSupport3.java

示例8: getDataValidator

import javax.xml.transform.sax.SAXSource; //导入方法依赖的package包/类
@DataProvider(name = "data_ValidatorA")
public Object[][] getDataValidator() {
    DOMSource ds = getDOMSource(xml_val_test, xml_val_test_id, false, true, xml_catalog);

    SAXSource ss = new SAXSource(new InputSource(xml_val_test));
    ss.setSystemId(xml_val_test_id);

    StAXSource stax = getStaxSource(xml_val_test, xml_val_test_id, false, true, xml_catalog);
    StAXSource stax1 = getStaxSource(xml_val_test, xml_val_test_id, false, true, xml_catalog);

    StreamSource source = new StreamSource(new File(xml_val_test));

    String[] systemIds = {"system.dtd", "val_test.xsd"};
    XmlInput[] returnValues = {new XmlInput(null, dtd_system, null), new XmlInput(null, xsd_val_test, null)};
    LSResourceResolver resolver = new SourceResolver(null, systemIds, returnValues);

    StAXSource stax2 = getStaxSource(xml_val_test, xml_val_test_id, false, true, xml_catalog);

    return new Object[][]{
        // use catalog
        {false, false, true, ds, null, null, xml_catalog, null},
        {false, false, true, ds, null, null, null, xml_catalog},
        {false, false, true, ss, null, null, xml_catalog, null},
        {false, false, true, ss, null, null, null, xml_catalog},
        {false, false, true, stax, null, null, xml_catalog, null},
        {false, false, true, stax1, null, null, null, xml_catalog},
        {false, false, true, source, null, null, xml_catalog, null},
        {false, false, true, source, null, null, null, xml_catalog},
        // use resolver
        {false, false, true, ds, resolver, resolver, xml_bogus_catalog, xml_bogus_catalog},
        {false, false, true, ss, resolver, resolver, xml_bogus_catalog, xml_bogus_catalog},
        {false, false, true, stax2, resolver, resolver, xml_bogus_catalog, xml_bogus_catalog},
        {false, false, true, source, resolver, resolver, xml_bogus_catalog, xml_bogus_catalog}
    };
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:36,代码来源:CatalogSupport.java

示例9: getDataValidator

import javax.xml.transform.sax.SAXSource; //导入方法依赖的package包/类
@DataProvider(name = "data_ValidatorC")
public Object[][] getDataValidator() {
    DOMSource ds = getDOMSource(xml_val_test, xml_val_test_id, false, true, null);

    SAXSource ss = new SAXSource(new InputSource(xml_val_test));
    ss.setSystemId(xml_val_test_id);

    StAXSource stax = getStaxSource(xml_val_test, xml_val_test_id, false, true, xml_catalog);
    StAXSource stax1 = getStaxSource(xml_val_test, xml_val_test_id, false, true, xml_catalog);

    StreamSource source = new StreamSource(new File(xml_val_test));

    String[] systemIds = {"system.dtd", "val_test.xsd"};
    XmlInput[] returnValues = {new XmlInput(null, dtd_system, null), new XmlInput(null, xsd_val_test, null)};
    LSResourceResolver resolver = new SourceResolver(null, systemIds, returnValues);

    StAXSource stax2 = getStaxSource(xml_val_test, xml_val_test_id, false, true, xml_catalog);

    return new Object[][]{
        // use catalog
        {false, false, true, ds, null, null, null, null},
        {false, false, true, ds, null, null, null, null},
        {false, false, true, ss, null, null, null, null},
        {false, false, true, ss, null, null, null, null},
        {false, false, true, stax, null, null, null, null},
        {false, false, true, stax1, null, null, null, null},
        {false, false, true, source, null, null, null, null},
        {false, false, true, source, null, null, null, null},
        // use resolver
        {false, false, true, ds, resolver, resolver, xml_bogus_catalog, xml_bogus_catalog},
        {false, false, true, ss, resolver, resolver, xml_bogus_catalog, xml_bogus_catalog},
        {false, false, true, stax2, resolver, resolver, xml_bogus_catalog, xml_bogus_catalog},
        {false, false, true, source, resolver, resolver, xml_bogus_catalog, xml_bogus_catalog}
    };
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:36,代码来源:CatalogSupport1.java

示例10: source2inputsource03

import javax.xml.transform.sax.SAXSource; //导入方法依赖的package包/类
/**
 * This test case tries to get InputSource from SAXSource using
 * sourceToInputSource method. This will also check if the systemId
 * remained the same. This is a positive test case.
 *
 * @throws IOException reading file error.
 */
@Test
public void source2inputsource03() throws IOException {
    String SYSTEM_ID = "file:///" + XML_DIR;
    try (FileInputStream fis = new FileInputStream(TEST_FILE)) {
        SAXSource saxSource =
                new SAXSource(new InputSource(fis));
        saxSource.setSystemId(SYSTEM_ID);
        assertEquals(SAXSource.sourceToInputSource(saxSource).getSystemId(),
                SYSTEM_ID);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:SAXSourceTest.java


注:本文中的javax.xml.transform.sax.SAXSource.setSystemId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。