Package nu.xom.xslt

Examples of nu.xom.xslt.XSLTransform.transform()


        String data = "<a xmlns:pre='http://www.example.org/'>" +
                "<b xmlns:pre='http://www.example.org/'>in B</b></a>";
        Document doc = builder.build(data, "http://www.example.org/");
       
        Nodes result = xform.transform(doc);
       
        assertEquals(doc.getRootElement(), result.get(0));
       
    }
View Full Code Here


          new AttributeFactory());

        String data = "<a><b>in B<c>in C</c></b></a>";
        Document doc = builder.build(data, "http://www.example.org/");
       
        Nodes result = xform.transform(doc);
       
        assertEquals(1, result.size());
        Element a = (Element) result.get(0);
        assertEquals("a", a.getLocalName());
        assertEquals(0, a.getChildCount());
View Full Code Here

          new AttributesToElements());

        String data = "<a name='value'><b x='y' a='b'/></a>";
        Document doc = builder.build(data, "http://www.example.org/");
       
        Nodes result = xform.transform(doc);
       
        assertEquals(1, result.size());
        Element a = (Element) result.get(0);
        assertEquals("a", a.getLocalName());
        assertEquals(2, a.getChildCount());
View Full Code Here

        XSLTransform xform = new XSLTransform(stylesheetDoc);

        String data = "<a><!--test--></a>";
        Document doc = builder.build(data, "http://www.example.org/");
       
        Nodes result = xform.transform(doc);
       
        assertEquals(1, result.size());
        Element a = (Element) result.get(0);
        assertEquals("a", a.getLocalName());
        assertEquals(1, a.getChildCount());
View Full Code Here

        });

        String data = "<a><!--test--></a>";
        Document doc = builder.build(data, "http://www.example.org/");
       
        Nodes result = xform.transform(doc);
       
        assertEquals(1, result.size());
        Element a = (Element) result.get(0);
        assertEquals("a", a.getLocalName());
        assertEquals(0, a.getChildCount());
View Full Code Here

        String data = "<pre:a xmlns:pre='http://www.example.org' " +
                "xmlns='http://www.example.net'>data</pre:a>";
        Document doc = builder.build(data, "http://www.example.org/");
       
        Nodes result = xform.transform(doc);
       
        assertEquals(1, result.size());
        Element a = (Element) result.get(0);
        assertEquals("a", a.getLocalName());
        assertEquals("pre:a", a.getQualifiedName());
View Full Code Here

                        XSLTransform xform;
                        if (indentYes(styleDoc)) {
                            xform = new XSLTransform(styleDoc, stripper);
                        }
                        else xform = new XSLTransform(styleDoc);
                        Nodes result = xform.transform(inputDoc);
                        if (output == null) {
                            // transform should have failed
                            fail("Transformed " + id);
                        }
                        else {
View Full Code Here

                    }
                    Document inputDoc = builder.build(input);
                    XSLTransform xform;
                    if (strip) xform = new XSLTransform(styleDoc, stripper);
                    else xform = new XSLTransform(styleDoc);
                    Nodes result = xform.transform(inputDoc);
                    if (output == null) {
                        if ("Attributes__89463".equals(id)
                          || "Attributes__89465".equals(id)) {
                            // Processors are allowed to recover from
                            // this problem.
View Full Code Here

        File output = new File(base, "MSFT_CONFORMANCE_TESTS/KEYS/out/PerfRepro3.txt");;
        Document styleDoc = builder.build(style);
        Document inputDoc = builder.build(input);
        XSLTransform xform = new XSLTransform(styleDoc);
        Nodes result = xform.transform(inputDoc);
        Document expectedResult = builder.build(output);
        Document actualResult = XSLTransform.toDocument(result);
        assertEquals(expectedResult, actualResult);
    
    }
View Full Code Here

        File output = new File(base, "MSFT_CONFORMANCE_TESTS/Sorting/out/89749.txt");;
        Document styleDoc = builder.build(style);
        Document inputDoc = builder.build(input);
        XSLTransform xform = new XSLTransform(styleDoc);
        Nodes result = xform.transform(inputDoc);
        /*Document expectedResult = builder.build(output);
        Document actualResult = XSLTransform.toDocument(result);
        assertEquals(expectedResult, actualResult); */
    
    }
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.