This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
["array","of","elems"].sort().each { | |
elem -> println "\\item \\tr{" + elem + "}" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# requires xmllint and diff to be in the PATH | |
class Test | |
BPELVAL_DIR = "c:/projects/bpelval-proj/tool/Testcases" | |
BETSY_DIR = "c:/projects/betsy/src/main/tests/language-features" | |
def self.compute_wsdl_diffs | |
main_wsdl = "#{BETSY_DIR}/TestInterface.wsdl" | |
partner_wsdl = "#{BETSY_DIR}/TestPartner.wsdl" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String path = "my/test/path/to/file.xsd"; | |
SchemaFactory sFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); | |
sFactory.newSchema(new File(path)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String path = "my/test/path/to/file.xml"; | |
SchemaFactory sFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); | |
Schema schema = sFactory.newSchema(new Source[]{ | |
new StreamSource(new File("/path/to/schema1.xsd")), | |
new StreamSource(new File("/path/to/schema2.xsd")) | |
}); | |
Validator validator = schema.newValidator(); | |
validator.validate(new StreamSource(new File(path))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String path = "my/test/path/to/file.xml"; | |
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); | |
DocumentBuilder db = dbf.newDocumentBuilder(); | |
db.parse(new File(path)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String path = "my/test/path/to/file.xml"; | |
SchemaFactory sFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); | |
Schema schema = sFactory.newSchema(new File("path/to/schema.xsd")); | |
Validator validator = schema.newValidator(); | |
validator.validate(new StreamSource(new File(path))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Desktop; | |
Desktop.getDesktop().browse(new File("test.html").toURI()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
digraph g{ | |
//nodes | |
wsdl[label="WSDL 1.1"] | |
xsd[label="XML Schema 1.0"] | |
xpath[label="XPath 1.0"] | |
xslt[label="XSLT 1.0"] | |
infoset[label="InfoSet"] | |
// edges | |
wsdl -> bpel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package betsy; | |
public class CodePuzzler { | |
public static void main(String[] args) { | |
// init array | |
String[] array = new String[2]; | |
array[0] = "One"; | |
array[1] = "Two"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.xml.bind.JAXB; | |
import javax.xml.bind.JAXBException; | |
public class Person { | |
private String name; | |
private int age; | |
public String getName() { | |
return name; |