Examples of StringSource


Examples of org.springframework.xml.transform.StringSource

  private final WebServiceTemplate template = new WebServiceTemplate();

  @Test
  public void testWebServiceRequestAndResponse() {
    StringResult result = new StringResult();
    Source payload = new StringSource(
        "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
        "<echoRequest xmlns=\"http://www.springframework.org/spring-ws/samples/echo\">hello</echoRequest>");

    template.sendSourceAndReceiveToResult(WS_URI, payload, result);
    logger.info("RESULT: " + result.toString());
View Full Code Here

Examples of org.springframework.xml.transform.StringSource

    transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
    transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
    transformer.setOutputProperty(OutputKeys.INDENT, "yes");
    transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", String.valueOf(2));
    StreamResult streamResult = new StreamResult(new StringWriter());
    Source source = new StringSource(result);
    transformer.transform(source, streamResult);
    String xmlString = streamResult.getWriter().toString();
    return xmlString;
  }
View Full Code Here

Examples of org.springframework.xml.transform.StringSource

    String xmlString = "<weat:GetCityWeatherByZIP xmlns:weat=\"http://ws.cdyne.com/WeatherWS/\">" +
              "  <weat:ZIP>" + zip + "</weat:ZIP>" +
              "</weat:GetCityWeatherByZIP>";
    try {
      Transformer transformer = transformerFactory.newTransformer();
      transformer.transform(new StringSource(xmlString), result);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.oscar3.recogniser.document.StringSource

      //files = FileTools.getFilesFromDirectoryByName(new File("/home/ptc24/oscarworkspace/corpora/paperset1"), "source.xml");
      //files = FileTools.getFilesFromDirectoryByName(new File("/home/ptc24/newows/corpora/paperset1"), "source.xml");
      //files = FileTools.getFilesFromDirectoryByName(new File("/home/ptc24/newows/corpora/BioIE"), "source.xml");
      files = FileTools.getFilesFromDirectoryByName(new File("/home/ptc24/newows/corpora/roughPubMed"), "source.xml");
      //files = FileTools.getFilesFromDirectoryByName(new File("/scratch/pubmed/2005"), "source.xml");
      StringSource ss = new StringSource(files, false);
     
      Bag<String> wordCounts = new Bag<String>();
     
      ss.reset();
      for(String s : ss) {
        TokenSequence t = Tokeniser.getInstance().tokenise(s);
        for(String word : t.getTokenStringList()) {
          if(!word.matches(".*[a-z][a-z].*")) continue;
          word = StringTools.normaliseName(word);
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.