Package org.jdom.output

Examples of org.jdom.output.XMLOutputter.outputString()


        Namespace schema4SchemaNS = Namespace.getNamespace(XMLToolsForYAWL.getSchema4SchemaNameSpace());
        Element schemElem = specificationElem.getChild("schema", schema4SchemaNS);
        if (null != schemElem) {
            XMLOutputter outputter = new XMLOutputter(Format.getCompactFormat());
            _specification.setSchema(outputter.outputString(schemElem));
        }

        // if name and doco fields missing from spec, see if they are in metadata
        // Added MJA 31/03/2006
        if (name == null)
View Full Code Here


    private void addSchema(Element specificationElem) throws YSyntaxException {

        Element schemaElem = specificationElem.getChild("schema");
        if (schemaElem != null) {
            XMLOutputter xmlo = new XMLOutputter(Format.getCompactFormat());
            String schemaStr = xmlo.outputString(schemaElem);
            try {
                _specification.setSchema(schemaStr);
            } catch (YSchemaBuildingException e) {
                YSyntaxException f = new YSyntaxException(e.getMessage());
                f.setStackTrace(e.getStackTrace());
View Full Code Here

     * @return A string representation of the specified element.
     */
    public static String toString(Element e) {
        Format format = Format.getPrettyFormat();
        XMLOutputter p = new XMLOutputter(format);
        return p.outputString(e);
    }
}
View Full Code Here

      fileData = fileData.substring(fileData.indexOf("/>")+2);
      fileData = fileData.substring(0,Integer.parseInt(fileLength));
      xml = xml.substring(0, xml.indexOf(">",xml.indexOf("file fiop="))+1)+xml.substring(xml.indexOf(">",xml.indexOf("file fiop="))+1+Integer.parseInt(fileLength)+"</file>".length());
    }
    Document doc2 = sax.build(new StringReader(xml));
log.write(("REQUEST:"+xmlOut.outputString(doc2)+"\r\n\r\n").getBytes());
    Element response = processXML(xml);

    Document doc = new Document(response);
    xml = xmlOut.outputString(doc);
    if (xml.indexOf("type=\"getfile\"") >= 0)
View Full Code Here

    Document doc2 = sax.build(new StringReader(xml));
log.write(("REQUEST:"+xmlOut.outputString(doc2)+"\r\n\r\n").getBytes());
    Element response = processXML(xml);

    Document doc = new Document(response);
    xml = xmlOut.outputString(doc);
    if (xml.indexOf("type=\"getfile\"") >= 0)
    {
      xml = Common.replace_str(xml,"___fileData___",fileData);
      fileData = "";
    }
View Full Code Here

        if (xmlFilter != null) {
            SAXBuilder parser = new SAXBuilder();
            parser.setXMLFilter(xmlFilter);
            try {
                currentDocument = parser.build(new StringReader(
                        outputter.outputString(document)));
            } catch (JDOMException e) {
                e.printStackTrace();
                throw new UndeclaredThrowableException(e,
                        "Could not build the a filtered document.");
            }
View Full Code Here

        _xmlToolsForYAWL = new XMLToolsForYAWL();
        URL url = getClass().getResource("SelfContainedPerson.xsd");
        SAXBuilder builder = new SAXBuilder();
        Document document = builder.build(url);
        XMLOutputter output = new XMLOutputter(Format.getCompactFormat());
        _xmlToolsForYAWL.setPrimarySchema(output.outputString(document));
    }


    public void testSelfContainedRefs() throws YSchemaBuildingException {
        List instructions = new ArrayList();
View Full Code Here

        String marshalledSpecsString = YMarshal.marshal(specifications);
        SAXBuilder builder = new SAXBuilder();
        StringReader marshalledSpecsStringReader = new StringReader(marshalledSpecsString);
        Document marshalledSpecsStringDoc = builder.build(marshalledSpecsStringReader);
        XMLOutputter marshalledSpecsStringOutputter = new XMLOutputter(Format.getPrettyFormat());
        marshalledSpecsString = marshalledSpecsStringOutputter.outputString(marshalledSpecsStringDoc);
System.out.println("marshalledSpecsString = " + marshalledSpecsString);
        File derivedSpecFile = new File(
                specificationFile.getParent() + File.separator + tempfileName);
        try {
            FileWriter fw = new FileWriter(derivedSpecFile);
View Full Code Here

            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        XMLOutputter outputter = new XMLOutputter(Format.getCompactFormat());
        String groomedOriginalXMLString = outputter.outputString(doc);
        groomedOriginalXMLString = groomedOriginalXMLString.replaceAll(" />", "/>");
        try {
            BufferedReader reader = new BufferedReader(new FileReader(testFile));
            String line = null;
            for (int i = 1; (line = reader.readLine()) != null; i++) {
View Full Code Here

        String marshalledSpecsString = YMarshal.marshal(specifications);
        SAXBuilder builder = new SAXBuilder();
        StringReader marshalledSpecsStringReader = new StringReader(marshalledSpecsString);
        Document marshalledSpecsStringDoc = builder.build(marshalledSpecsStringReader);
        XMLOutputter marshalledSpecsStringOutputter = new XMLOutputter(Format.getPrettyFormat());
        marshalledSpecsString = marshalledSpecsStringOutputter.outputString(marshalledSpecsStringDoc);
System.out.println("marshalledSpecsString = " + marshalledSpecsString);
        File derivedSpecFile = new File(
                specificationFile.getParent() + File.separator + tempfileName);
        try {
            FileWriter fw = new FileWriter(derivedSpecFile);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.