• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java XMLParser类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中beast.util.XMLParser的典型用法代码示例。如果您正苦于以下问题:Java XMLParser类的具体用法?Java XMLParser怎么用?Java XMLParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: process

import beast.util.XMLParser; //导入依赖的package包/类
void process(Alignment data, int iteration) throws IOException, XMLParserException, IllegalArgumentException, IllegalAccessException {
	// read template
	String templateXML = BeautiDoc.load(templateFile);
	templateXML = templateXML.replaceAll("\\$\\(n\\)", iteration+"");
	XMLParser parser = new XMLParser();
	BEASTInterface b = parser.parseBareFragment(templateXML, false);

	// repalce alignment
	Alignment a = getAlignment(b);
	List<Sequence> sequences = a.sequenceInput.get();
	sequences.clear();
	sequences.addAll(data.sequenceInput.get());

	// write file
	String outputFile = outputFileInput.get();
	outputFile = outputFile.replaceAll("\\$\\(n\\)", iteration+"");
	FileWriter outfile = new FileWriter(outputFile);
	
	Set<BEASTInterface> beastObjects = new HashSet<>();
	String xml = new XMLProducer().toXML(b, beastObjects);
       outfile.write(xml);
       outfile.close();
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:24,代码来源:MergeDataWith.java


示例2: testScaleWithInt

import beast.util.XMLParser; //导入依赖的package包/类
@Test
public void testScaleWithInt() throws Exception {
    Randomizer.setSeed(1);

    XMLParser parser = new XMLParser();
    beast.core.Runnable runnable = parser.parseFile(
            new File("test/epiinf/xmltests/ScaleWithIntTest.xml"));
    Logger.FILE_MODE = Logger.LogFileMode.overwrite;
    runnable.run();


    List<Expectation> expectations = new ArrayList<>();
    expectations.add(new Expectation("x1", 0.5, 0.01));
    expectations.add(new Expectation("y1", 0.5, 0.01));
    expectations.add(new Expectation("y2", 0.5, 0.01));
    expectations.add(new Expectation("y3", 0.5, 0.01));
    expectations.add(new Expectation("n", 50.0, 1.0));
    LogAnalyser logAnalyser = new LogAnalyser("ScaleWithIntTest.log", expectations);

    try {
        for (Expectation expectation : expectations) {
            assertTrue(expectation.isValid());
            assertTrue(expectation.isPassed());
        }
    } catch (Exception e) {
        throw e;

    } finally {
        Files.deleteIfExists(Paths.get("ScaleWithIntTest.xml.state"));
        Files.deleteIfExists(Paths.get("ScaleWithIntTest.log"));
    }
}
 
开发者ID:tgvaughan,项目名称:EpiInf,代码行数:33,代码来源:OperatorTests.java


示例3: test2Taxon

import beast.util.XMLParser; //导入依赖的package包/类
@Test
public void test2Taxon() throws Exception {
    Randomizer.setSeed(1);

    XMLParser parser = new XMLParser();
    beast.core.Runnable runnable = parser.parseFile(
            new File("examples/ACGsimulations/simulateACGs2taxon.xml"));
    runnable.run();

    List<Expectation> expectations = new ArrayList<>();
    expectations.add(new Expectation("acg.CFheight", 1.0, 1e-2));
    expectations.add(new Expectation("acg.CFlength", 2.0, 1e-2));
    expectations.add(new Expectation("acg.nConv", 10.0, 5e-2));

    LogAnalyser logAnalyser = new LogAnalyser("simulateACGs2taxon.stats",
            expectations);

    for (int i=0; i<expectations.size(); i++) {
        assertTrue(expectations.get(i).isValid());
        assertTrue(expectations.get(i).isPassed());
    }

    Files.deleteIfExists(Paths.get("simulateACGs2taxon.stats"));
    Files.deleteIfExists(Paths.get("simulateACGs2taxon.converted"));
    Files.deleteIfExists(Paths.get("simulateACGs2taxon.trees"));
}
 
开发者ID:tgvaughan,项目名称:bacter,代码行数:27,代码来源:SimulatedACGTest.java


示例4: testShortMultiLocus

import beast.util.XMLParser; //导入依赖的package包/类
@Test
public void testShortMultiLocus() throws Exception {
    Randomizer.setSeed(1);

    XMLParser parser = new XMLParser();
    beast.core.Runnable runnable = parser.parseFile(
            new File("examples/allOperatorTests/allOperatorTestShortSSML.xml"));
    disableScreenLog(runnable);
    runnable.run();

    List<Expectation> expectations = new ArrayList<>();
    expectations.add(new Expectation("acg.CFheight", 1.601, 0.2));
    expectations.add(new Expectation("acg.CFlength", 4.17, 0.5));
    expectations.add(new Expectation("acg.nConv", 39.61, 0.5));

    LogAnalyser logAnalyser = new LogAnalyser("allOperatorTestShortSSML.stats",
            expectations);

    for (Expectation expectation : expectations) {
        assertTrue(expectation.isValid());
        assertTrue(expectation.isPassed());
    }

    Files.deleteIfExists(Paths.get("allOperatorTestShortSSML.stats"));
    Files.deleteIfExists(Paths.get("allOperatorTestShortSSML.converted"));
    Files.deleteIfExists(Paths.get("allOperatorTestShortSSML.trees"));
    Files.deleteIfExists(Paths.get("allOperatorTestShortSSML.cf"));
    Files.deleteIfExists(Paths.get("allOperatorTestShortSSML.xml.state"));
}
 
开发者ID:tgvaughan,项目名称:bacter,代码行数:30,代码来源:AllOperatorTest.java


示例5: loadFile

import beast.util.XMLParser; //导入依赖的package包/类
public void loadFile(String fileName) {
    m_objects.clear();
    XMLParser parser = new XMLParser();
    try {
        //fileName;
        StringBuilder xml = new StringBuilder();
        String NL = System.getProperty("line.separator");
        Scanner scanner = new Scanner(new File(fileName));
        try {
            while (scanner.hasNextLine()) {
                xml.append(scanner.nextLine() + NL);
            }
        } finally {
            scanner.close();
        }
        BEASTInterface plugin0 = parser.parseBareFragment(xml.toString(), false);
        init(plugin0);
    } catch (Exception e) {
        e.printStackTrace();
        // TODO: handle exception
    }
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:23,代码来源:Document.java


示例6: loadTemplate

import beast.util.XMLParser; //导入依赖的package包/类
void loadTemplate(String xml) throws XMLParserException, SAXException, IOException, ParserConfigurationException  {
    // load the template and its beauti configuration parts
    XMLParser parser = new XMLParser();
    BEASTObjectPanel.init();
    List<BEASTInterface> beastObjects = parser.parseTemplate(xml, new HashMap<>(), true);
    for (BEASTInterface beastObject : beastObjects) {
        if (beastObject instanceof beast.core.Runnable) {
            mcmc.setValue(beastObject, this);
        } else if (beastObject instanceof BeautiConfig) {
            beautiConfig = (BeautiConfig) beastObject;
            beautiConfig.setDoc(this);
        } else {
            Log.warning.println("template item " + beastObject.getID() + " is ignored");
        }
        BEASTObjectPanel.addPluginToMap(beastObject, this);
    }
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:18,代码来源:BeautiDoc.java


示例7: makeSureXMLParses

import beast.util.XMLParser; //导入依赖的package包/类
void makeSureXMLParses() {
		warning("Make sure that XML that BEAUti produces parses");
		File XMLFile = new File(org.fest.util.Files.temporaryFolder() + "/x.xml");
		if (XMLFile.exists()) {
			XMLFile.delete();
		}
		
		saveFile(""+org.fest.util.Files.temporaryFolder(), "x.xml");

//		JFileChooserFixture fileChooser = findFileChooser().using(robot());
//		fileChooser.setCurrentDirectory(org.fest.util.Files.temporaryFolder());
//		fileChooser.selectFile(new File("x.xml")).approve();
		
		XMLParser parser = new XMLParser();
		XMLFile = new File(org.fest.util.Files.temporaryFolder() + "/x.xml");
		try {
			parser.parseFile(XMLFile);
		} catch (Exception e) {
			e.printStackTrace();
			assertThat(0).as("Parser exception: " + e.getMessage()).isEqualTo(1);
		}
	}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:23,代码来源:BeautiBase.java


示例8: testAnnotatedConstructor2

import beast.util.XMLParser; //导入依赖的package包/类
@Test
public void testAnnotatedConstructor2() throws Exception {
	List<Taxon> taxa = new ArrayList<>();
	taxa.add(new Taxon("first one"));
	taxa.add(new Taxon("second one"));

	AnnotatedRunnableTestClass t = new AnnotatedRunnableTestClass(3, taxa);
	
	XMLProducer producer = new XMLProducer();
	String xml = producer.toXML(t);

	assertEquals(3, (int) t.getParam1());

	
    FileWriter outfile = new FileWriter(new File("/tmp/XMLTest.xml"));
    outfile.write(xml);
    outfile.close();

	
	XMLParser parser = new XMLParser();
	BEASTInterface b = parser.parseFile(new File("/tmp/XMLTest.xml"));
	assertEquals(3, (int) ((AnnotatedRunnableTestClass) b).getParam1());
	assertEquals(2, ((AnnotatedRunnableTestClass) b).getTaxon().size());
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:25,代码来源:XMLTest.java


示例9: testCFSTS

import beast.util.XMLParser; //导入依赖的package包/类
@Test
public void testCFSTS() throws Exception {
    Randomizer.setSeed(1);

    XMLParser parser = new XMLParser();
    beast.core.Runnable runnable = parser.parseFile(
            new File("examples/CFOperatorTests/CFSubtreeSlideTest5taxon.xml"));
    disableScreenLog(runnable);
    runnable.run();

    List<Expectation> expectations = new ArrayList<>();
    expectations.add(new Expectation("acg.CFheight", 1.606, 0.2));
    expectations.add(new Expectation("acg.CFlength", 4.181, 0.5));
    expectations.add(new Expectation("acg.nConv", 21.0, 0.5));

    new LogAnalyser("CFSubtreeSlideTest5taxon.stats", expectations);

    for (Expectation expectation : expectations) {
        assertTrue(expectation.isValid());
        assertTrue(expectation.isPassed());
    }

    Files.deleteIfExists(Paths.get("CFSubtreeSlideTest5taxon.stats"));
    Files.deleteIfExists(Paths.get("CFSubtreeSlideTest5taxon.trees"));
    Files.deleteIfExists(Paths.get("CFSubtreeSlideTest5taxon.xml.state"));
}
 
开发者ID:tgvaughan,项目名称:bacter,代码行数:27,代码来源:CFOperatorTest.java


示例10: testCFSTX

import beast.util.XMLParser; //导入依赖的package包/类
@Test
public void testCFSTX() throws Exception {
    Randomizer.setSeed(1);

    XMLParser parser = new XMLParser();
    beast.core.Runnable runnable = parser.parseFile(
            new File("examples/CFOperatorTests/CFSubtreeExchangeTest5taxon.xml"));
    disableScreenLog(runnable);
    runnable.run();

    List<Expectation> expectations = new ArrayList<>();
    expectations.add(new Expectation("acg.CFheight", 1.606, 0.2));
    expectations.add(new Expectation("acg.CFlength", 4.181, 0.5));
    expectations.add(new Expectation("acg.nConv", 21.0, 0.5));

    new LogAnalyser("CFSubtreeExchangeTest5taxon.stats", expectations);

    for (Expectation expectation : expectations) {
        assertTrue(expectation.isValid());
        assertTrue(expectation.isPassed());
    }

    Files.deleteIfExists(Paths.get("CFSubtreeExchangeTest5taxon.stats"));
    Files.deleteIfExists(Paths.get("CFSubtreeExchangeTest5taxon.trees"));
    Files.deleteIfExists(Paths.get("CFSubtreeExchangeTest5taxon.xml.state"));
}
 
开发者ID:tgvaughan,项目名称:bacter,代码行数:27,代码来源:CFOperatorTest.java


示例11: test5Taxon

import beast.util.XMLParser; //导入依赖的package包/类
@Test
public void test5Taxon() throws Exception {
    Randomizer.setSeed(1);

    XMLParser parser = new XMLParser();
    beast.core.Runnable runnable = parser.parseFile(
            new File("examples/ACGsimulations/simulateACGs5taxon.xml"));
    runnable.run();

    List<Expectation> expectations = new ArrayList<>();
    expectations.add(new Expectation("acg.CFheight", 1.606, 1e-2));
    expectations.add(new Expectation("acg.CFlength", 4.181, 1e-2));
    expectations.add(new Expectation("acg.nConv", 21.0, 5e-2));

    LogAnalyser logAnalyser = new LogAnalyser("simulateACGs5taxon.stats",
            expectations);

    for (int i=0; i<expectations.size(); i++) {
        assertTrue(expectations.get(i).isValid());
        assertTrue(expectations.get(i).isPassed());
    }

    Files.deleteIfExists(Paths.get("simulateACGs5taxon.stats"));
    Files.deleteIfExists(Paths.get("simulateACGs5taxon.converted"));
    Files.deleteIfExists(Paths.get("simulateACGs5taxon.trees"));
}
 
开发者ID:tgvaughan,项目名称:bacter,代码行数:27,代码来源:SimulatedACGTest.java


示例12: test5TaxonDynamicPopSize

import beast.util.XMLParser; //导入依赖的package包/类
@Test
public void test5TaxonDynamicPopSize() throws Exception {
    Randomizer.setSeed(1);

    XMLParser parser = new XMLParser();
    beast.core.Runnable runnable = parser.parseFile(
            new File("examples/ACGsimulations/simulateACGs5taxonDynamicPopSize.xml"));
    runnable.run();

    List<Expectation> expectations = new ArrayList<>();
    expectations.add(new Expectation("acg.CFheight", 8.840, 1e-2));
    expectations.add(new Expectation("acg.CFlength", 25.312, 1e-2));
    expectations.add(new Expectation("acg.nConv", 25.464, 5e-2));

    LogAnalyser logAnalyser = new LogAnalyser("simulateACGs5taxonDynamicPopSize.stats",
            expectations);

    for (int i=0; i<expectations.size(); i++) {
        assertTrue(expectations.get(i).isValid());
        assertTrue(expectations.get(i).isPassed());
    }

    Files.deleteIfExists(Paths.get("simulateACGs5taxonDynamicPopSize.stats"));
    Files.deleteIfExists(Paths.get("simulateACGs5taxonDynamicPopSize.converted"));
    Files.deleteIfExists(Paths.get("simulateACGs5taxonDynamicPopSize.trees"));
}
 
开发者ID:tgvaughan,项目名称:bacter,代码行数:27,代码来源:SimulatedACGTest.java


示例13: test5TaxonSerialSampling

import beast.util.XMLParser; //导入依赖的package包/类
@Test
public void test5TaxonSerialSampling() throws Exception {
    Randomizer.setSeed(1);

    XMLParser parser = new XMLParser();
    beast.core.Runnable runnable = parser.parseFile(
            new File("examples/ACGsimulations/simulateACGs5taxonSerialSampling.xml"));
    runnable.run();

    List<Expectation> expectations = new ArrayList<>();
    expectations.add(new Expectation("acg.CFheight", 1.909, 1e-2));
    expectations.add(new Expectation("acg.CFlength", 4.655, 1e-2));
    expectations.add(new Expectation("acg.nConv", 23.381, 5e-2));

    LogAnalyser logAnalyser = new LogAnalyser("simulateACGs5taxonSerialSampling.stats",
            expectations);

    for (int i=0; i<expectations.size(); i++) {
        assertTrue(expectations.get(i).isValid());
        assertTrue(expectations.get(i).isPassed());
    }

    Files.deleteIfExists(Paths.get("simulateACGs5taxonSerialSampling.stats"));
    Files.deleteIfExists(Paths.get("simulateACGs5taxonSerialSampling.converted"));
    Files.deleteIfExists(Paths.get("simulateACGs5taxonSerialSampling.trees"));
}
 
开发者ID:tgvaughan,项目名称:bacter,代码行数:27,代码来源:SimulatedACGTest.java


示例14: test5TaxonMultiLocus

import beast.util.XMLParser; //导入依赖的package包/类
@Test
public void test5TaxonMultiLocus() throws Exception {
    Randomizer.setSeed(1);

    XMLParser parser = new XMLParser();
    beast.core.Runnable runnable = parser.parseFile(
            new File("examples/ACGsimulations/simulateACGs5taxonMultiLocus.xml"));
    runnable.run();

    List<Expectation> expectations = new ArrayList<>();
    expectations.add(new Expectation("acg.CFheight", 1.917, 1e-2));
    expectations.add(new Expectation("acg.CFlength", 4.672, 1e-2));
    expectations.add(new Expectation("acg.nConv", 23.614, 5e-2));

    LogAnalyser logAnalyser = new LogAnalyser("simulateACGs5taxonMultiLocus.stats",
            expectations);

    for (int i=0; i<expectations.size(); i++) {
        assertTrue(expectations.get(i).isValid());
        assertTrue(expectations.get(i).isPassed());
    }

    Files.deleteIfExists(Paths.get("simulateACGs5taxonMultiLocus.stats"));
    Files.deleteIfExists(Paths.get("simulateACGs5taxonMultiLocus.converted"));
    Files.deleteIfExists(Paths.get("simulateACGs5taxonMultiLocus.trees"));
}
 
开发者ID:tgvaughan,项目名称:bacter,代码行数:27,代码来源:SimulatedACGTest.java


示例15: initAndValidate

import beast.util.XMLParser; //导入依赖的package包/类
@Override
public void initAndValidate() {
	particlePool = new LinkedHashMap<>();
	threadCount = threadsInput.get();
    exec = Executors.newFixedThreadPool(threadCount);
    
    
    XMLProducer xmlProducer = new XMLProducer();
    String xml = xmlProducer.toRawXML(this);
    xml = "<beast version='2.4'>\n" +
    		xml.replaceAll("spec='" + this.getClass().getCanonicalName() + "'",
    		"spec='" + NSThread.class.getCanonicalName() + "'").
    		replaceAll("threads='" + threadCount+"'", "")
    	+ "\n</beast>";
    
    NS = new NSThread[threadCount];
    runnable = new CoreRunnable[threadCount];
    
    for (int i = 0; i < threadCount; i++) {
    	try {
    	    XMLParser xmlParser = new XMLParser();
    		String xml2 = xml.replaceAll("fileName='", "fileName='" + i);
    		Object o = xmlParser.parseFragment(xml2, true);
			NS[i] = (NSThread) o;
			runnable[i] = new CoreRunnable(NS[i]);
		} catch (XMLParserException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
    
}
 
开发者ID:BEAST2-Dev,项目名称:nested-sampling,代码行数:33,代码来源:MultiThreadedNS.java


示例16: main

import beast.util.XMLParser; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static void main(String[] args) {
	try {
		// parse arguments
		if (args.length < 2) {
			printUsageAndExit();
		}
		String sFile = args[0];
		PrintStream out = System.out;
		if (args.length == 3) {
			File file = new File(args[2]);
			out = new PrintStream(file);
		}

		// grab the file
		String sXML = "";
		BufferedReader fin = new BufferedReader(new FileReader(sFile));
		while (fin.ready()) {
			sXML += fin.readLine();
		}
		fin.close();
		// parse the xml
		XMLParser parser = new XMLParser();
		BEASTInterface plugin = parser.parseFragment(sXML, true);

		root = ((Input<Sequence>) plugin.getInput("root")).get();
		root.initAndValidate();
		m_tree = ((Input<Tree>) plugin.getInput("tree")).get();
		m_tree.initAndValidate();
		m_subModel = ((Input<LanguageSubsitutionModel>) plugin.getInput("subModel")).get();
		m_subModel.initAndValidate();
		m_missingModel = ((Input<MissingDataModel>) plugin.getInput("missingModel")).get();
		m_subModel.initAndValidate();

		// feed to sequence simulator and generate leaves
		LanguageSequenceGen treeSimulator = new LanguageSequenceGen();
		XMLProducer producer = new XMLProducer();
		HashMap<Alignment, String> alignmentHash = treeSimulator.simulate(Integer.parseInt(args[1]));
		Alignment alignment = (Alignment) alignmentHash.keySet().toArray()[0];
		String meaningClasses = alignmentHash.get(alignment);
		sXML = producer.toRawXML(alignment);
		String timestamp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date());
		out.println("<beast version='2.0'>");
		out.print(sXML);
		out.println("<!-- Meaning Classes: " + meaningClasses + " -->");
		out.println("<!-- Created at: " + timestamp + " -->");
		out.println("</beast>");
		
		if (args.length == 3) {
			System.out.println("XML successfully created! Location: " + args[2]);
		}
		
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:lutrasdebtra,项目名称:Beast-Borrowing-Plugin,代码行数:57,代码来源:LanguageSequenceGen.java


示例17: main

import beast.util.XMLParser; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
	XMLParser parser = new XMLParser();
	BEASTObject o = parser.parseFile(new File(args[0]));
	if (!(o instanceof TreeDrawingGrid)) {
		throw new RuntimeException("Expected top level element of type TreeDrawingGrid");
	}
	TreeDrawingGrid grid = (TreeDrawingGrid) o;
	JFrame frame = new JFrame();
	TreeDrawPanel panel = new TreeDrawPanel(grid);
	frame.add(panel);
	frame.setSize(1024, 768);
	frame.setVisible(true);
       frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
 
开发者ID:CompEvol,项目名称:beastshell,代码行数:15,代码来源:TreeDrawPanel.java


示例18: reinit

import beast.util.XMLParser; //导入依赖的package包/类
void reinit() {
	String xml = toXML();
    m_objects.clear();
    try {
        XMLParser parser = new XMLParser();
        BEASTInterface plugin0 = parser.parseBareFragment(xml, false);
        init(plugin0);
    } catch (Exception e) {
        e.printStackTrace();
        // TODO: handle exception
    }
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:13,代码来源:Document.java


示例19: initAndValidate

import beast.util.XMLParser; //导入依赖的package包/类
@Override
    public void initAndValidate() {
        parseSet(inlineInput.get(), null, inlineBEASTObject);
        parseSet(collapsedInput.get(), null, collapsedBEASTObjects);
        inlineBEASTObject.addAll(collapsedBEASTObjects);
//		parseSet(m_hidePanels.get(), "TAXON_SETS_PANEL,TIP_DATES_PANEL,PRIORS_PANEL,OPERATORS_PANEL", g_sHidePanels);
        parseSet(suppressInputs.get(), null, suppressBEASTObjects);
        parseSet(disableMenus.get(), null, disabledMenus);
        parseSet(disableButtons.get(), null, disabledButtons);

        parseMap(inputLabelMapInput.get(), inputLabelMap);
        parseMap(buttonLabelMapInput.get(), buttonLabelMap);
//		parseMap(m_editButtonStatus.get(), g_sEditButtonStatus);
        for (BeautiPanelConfig panel : panelsInput.get()) {
            panels.add(panel);
            // check for duplicates
            for (BeautiPanelConfig panel2 : panels) {
                if (panel2.nameInput.get().equals(panel.nameInput.get()) && panel2 != panel) {
                    panels.remove(panels.size() - 1);
                    break;
                }
            }
        }
        //InputEditor.setExpertMode(isExpertInput.get());
        subTemplates = subTemplatesInput.get();
        alignmentProvider = alignmentProviderInput.get();

        try {
            XMLParser parser = new XMLParser();
        	hyperPriorTemplate = (BeautiSubTemplate) parser.parseBareFragment(HYPER_PRIOR_XML, true);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    }
 
开发者ID:CompEvol,项目名称:beast2,代码行数:36,代码来源:BeautiConfig.java


示例20: processBeautiConfig

import beast.util.XMLParser; //导入依赖的package包/类
void processBeautiConfig(Document doc) throws XMLParserException, TransformerException  {
    // find configuration elements, process and remove
    NodeList nodes = doc.getElementsByTagName("beauticonfig");
    Node topNode = doc.getElementsByTagName("*").item(0);
    String nameSpaceStr = XMLParser.getAttribute(topNode, "namespace");
    for (int configElementIndex = 0; configElementIndex < nodes.getLength(); configElementIndex++) {
        Node configElement = nodes.item(configElementIndex);
        String xml = nodeToString(configElement);
        XMLParser parser = new XMLParser();
        parser.setNameSpace(nameSpaceStr);
        parser.parseBareFragment(xml, true);
        configElement.getParentNode().removeChild(configElement);
    }
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:15,代码来源:BeautiDoc.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CodeGeneration类代码示例发布时间:2022-05-22
下一篇:
Java ImageRaster类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap