Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.xmlcalabash.extensions.osutils;
 
Created by IntelliJ IDEA. User: ndw Date: Jun 3, 2009 Time: 7:48:27 PM To change this template use File | Settings | File Templates.
public class Info extends DefaultStep {
    private WritablePipe result = null;

    
Creates a new instance of UriInfo
    public Info(XProcRuntime runtimeXAtomicStep step) {
        super(runtime,step);
    }
    public void setOutput(String portWritablePipe pipe) {
         = pipe;
    }
    public void reset() {
        .resetWriter();
    }
    public void run() throws SaxonApiException {
        super.run();
        TreeWriter tree = new TreeWriter();
        tree.startDocument(.getNode().getBaseURI());
        tree.addAttribute(new QName("file-separator"), System.getProperty("file.separator"));
        tree.addAttribute(new QName("path-separator"), System.getProperty("path.separator"));
        tree.addAttribute(new QName("os-architecture"), System.getProperty("os.arch"));
        tree.addAttribute(new QName("os-name"), System.getProperty("os.name"));
        tree.addAttribute(new QName("os-version"), System.getProperty("os.version"));
        tree.addAttribute(new QName("cwd"), System.getProperty("user.dir"));
        tree.addAttribute(new QName("user-name"), System.getProperty("user.name"));
        tree.addAttribute(new QName("user-home"), System.getProperty("user.home"));
        tree.startContent();
        tree.addEndElement();
        tree.endDocument();
        .write(tree.getResult());
    }
New to GrepCode? Check out our FAQ X