How convert an xml to string for a textflow

Hi
usually I use fields type String to feed the textFlows.
now for visual convenience, I would like to store them in file formatted XML, and the thing succeeds well, but when I want use them I have problems, because the formatting XML creates line spacings that I don't want,
for example:
<TextFlow columnCount="inherit" columnGap="inherit" columnWidth="inherit" lineBreak="toFit" paddingBottom="4" paddingLeft="4" paddingRight="4" paddingTop="4" paragraphSpaceAfter="15" paragraphSpaceBefore="0" verticalAlign="top" id="flow" whiteSpaceCollapse="preserve" xmlns="http://ns.adobe.com/textLayout/2008">
  <linkActiveFormat>
    <TextLayoutFormat color="#cc00cc" fontWeight="bold" textDecoration="underline"/>
  </linkActiveFormat>
  <linkHoverFormat>
    <TextLayoutFormat color="#cc0000" fontWeight="bold" textDecoration="underline"/>
  </linkHoverFormat>
  <linkNormalFormat>
    <TextLayoutFormat color="#000099" fontWeight="bold" textDecoration="none"/>
  </linkNormalFormat>
  <p color="#990099" fontSize="15">
    <span>Gestione dei testi con TLF e Testo classico</span>
  </p>
  <p color="#666555" fontFamily="Arial" fontSize="14">
    <span>Le novità introdotte con l'ultima release di Flash CS5 sono molteplici, una di queste novità riguarda i campi di testo.</span>
  </p>
  <p color="#990099" fontSize="15">
    <span>Cosa c'è da sapere sul Text Layout Framework (TLF)?</span>
    <img id="1|emot|0" height="18" width="18" source="[object Bitmap]"/>
    <span></span>
  </p>
  <p color="#666555" fontFamily="Arial" fontSize="14">
    <span>Che rispetto al Testo Classico,</span>
  </p>
</TextFlow>
produce me:
init--------------------------------------------------------------
    Gestione dei testi con TLF e Testo classico
    Le novità introdotte con l'ultima release di Flash CS5 sono molteplici, una di queste novità riguarda i campi di testo.
    Cosa c'è da sapere sul Text Layout Framework (TLF)?
    Che rispetto al Testo Classico,
--------------------------------------------------------------------- end
instead of:
init--------------------------------------------------------------
Gestione dei testi con TLF e Testo classico
Le novità introdotte con l'ultima release di Flash CS5 sono molteplici, una di queste novità riguarda i campi di testo.
Cosa c'è da sapere sul Text Layout Framework (TLF)?
Che rispetto al Testo Classico,
--------------------------------------------------------------------- end
as I will want.
Now i see that with spark.utils i can use importFromXML to convert in a textFlow with collapse the line in excess, but unfortunately the class spark is not visible in Flash/as3.
can you help me?
thanks in advance
jeanPaul

hi
I tested with this code:
package 
  import flash.net.URLRequest;
  import flash.net.URLLoader;
  import flash.display.Sprite;
  import flash.events.*;
  import flashx.textLayout.elements.*;
  import flashx.textLayout.conversion.*;
  import flashx.textLayout.formats.TextLayoutFormat;
  public class importer extends Sprite
   private var urlRequest:URLRequest;
   private var urlLoader:URLLoader;
   public function importer()
     urlRequest = new URLRequest('newPRV_scritto.xml');
     urlLoader = new URLLoader();
     urlLoader.addEventListener(Event.COMPLETE, caricato);
     urlLoader.addEventListener(IOErrorEvent.IO_ERROR, erroreCaric);
     urlLoader.load(urlRequest);
   private function erroreCaric(e:IOErrorEvent):void
    { trace("error: file not found"); }
  private function caricato(e:Event):void
    var markup:String = e.target.data;
    var config:Configuration = new Configuration();
    var format:TextLayoutFormat = new TextLayoutFormat(config.textFlowInitialFormat);
    format.whiteSpaceCollapse = "collapse";
    config.textFlowInitialFormat = format;
    var imp:ITextImporter = TextConverter.getImporter(TextConverter.TEXT_LAYOUT_FORMAT, config);
    imp.throwOnError = false;
    var flow:TextFlow = new TextFlow;
    flow = imp.importToFlow(markup);
    if (flow==null)
      trace('----------not imported---------');
      else
      trace( TextConverter.export(flow, TextConverter.TEXT_LAYOUT_FORMAT,ConversionType.STRING_TYPE) as String);
and the result is the trace:  '----------not imported---------'
what you say of it?

Similar Messages

  • How to use multiple VCI strings for lap 1300 and 1200 (option 60) in one pool?

    Hi All,
    Hope to you a very happy new year,
    I have two differnt LAP 1300 and 1200 in my network and I need to add theme to the WLC,
    I successed to add one of theme by the option 60 in the DHCP pool at the Core SW,
    So my quetion is below:
    How to use multiple VCI strings for lap 1300 and 1200 (option 60) in one pool?
    Thanks in Advanced,
    Ahmed,

    To add to Scott's post.  Option 60 would be useful if you needed to put certain types of AP on specific controllers.  Otherwise, no real need to use it for the most part.
    Though, I do recall an issue a few years ago that some windows machines had issues getting DHCP if option 43 is being returned.
    Now, on an IOS switch, you can only configure one option 60 per DHCP scope
    HTH,
    Steve
    Please remember to rate useful posts, and mark questions as answered

  • How to use XML Anonymizer Module for receiver mail Adapter?

    Hi All,
             I would like to know how to use XML Anonymizer Module for receiver mail adapter so as to change the namespace to http://sap.com/xi/XI/Mail/30 from my original namespace? Thank you all in advance?

    Hi,
    This may help u:
    Replacing one namespace with another using XML Anonymizer Module
    Thanks
    Amit

  • When we use XML,XSD,WSDL files to create SOA webservices in jdeveloper ,what will happen means internally,how will useful xml ,xsd,wsdl for composite ?

    When we use XML,XSD,WSDL files to create SOA webservices in jdeveloper ,what will happen means internally,how will useful xml ,xsd,wsdl for composite ?
    How xml will send message to XSD then how wsdl interaction then to composite ?

    XSD (XML Schema Definition), is an abstract representation of a XML characteristics.
    The WSDL (Web Services Description Language), describes the functionality offered by your web service.
    You can say what operations your services offers, and describe the messages used for this operations in your XSD.

  • Strange problem in converting between XML to string and vice versa

    i have an application that needs to send an XML document
    over the wire. For this reason, I need to convert the
    doc into a String at the sending side and back to Doc
    at the receiving side. This document is stored in a "CLOB"
    column in a table in the database. I use XDK to retrieve
    this entire row (including the CLOB - hence this is an XML
    document which has a column that itself is an xml document in
    string format - this is just the clob read in by XDK).
    Thus the row looks like
    <ROWSET>
    <ROW>
    <col1> A <col1>
    <CLOB_COL> ..clob value of an xml doc..</CLOB_COL>
    </ROW>
    </ROWSET>
    When I convert this document into String and back, one of the "<"
    tags in the clob column document gets changed to "&lt;" and hence
    the parsing fails! I have used the latest label of the XDK build
    to get the latest parser jar but still i have the same problem.
    I am using the following routines for the conversion.
    /* for converting document to string */
    public static String convertToString(XMLDocument xml) throws
    IOException
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    xml.print(pw);
    String result = sw.toString();
    return result;
    /* for converting string to document */
    public static XMLDocument convertToXml(String xmlStr)
    throws
    IOException,SAXException
    ByteArrayInputStream inStream = new
    ByteArrayInputStream(xmlStr.getBytes());
    DOMParser parser = new DOMParser();
    parser.setPreserveWhitespace(false);
    parser.parse(inStream);
    return parser.getDocument();

    How do you get the XML document? Do you use XSU? You can use:
    String str = qry.getXMLString();
    to get the result XML document in String.
    XSU will escape all of the < and >. Or the the XML document in
    one of the column will make the result XML doc not well-formed.
    Not quite understand your problem. You can send me your test
    case.
    i have an application that needs to send an XML document
    over the wire. For this reason, I need to convert the
    doc into a String at the sending side and back to Doc
    at the receiving side. This document is stored in a "CLOB"
    column in a table in the database. I use XDK to retrieve
    this entire row (including the CLOB - hence this is an XML
    document which has a column that itself is an xml document in
    string format - this is just the clob read in by XDK).
    Thus the row looks like
    <ROWSET>
    <ROW>
    <col1> A <col1>
    <CLOB_COL> ..clob value of an xml doc..</CLOB_COL>
    </ROW>
    </ROWSET>
    When I convert this document into String and back, one of the "<"
    tags in the clob column document gets changed to "<" and hence
    the parsing fails! I have used the latest label of the XDK build
    to get the latest parser jar but still i have the same problem.
    I am using the following routines for the conversion.
    /* for converting document to string */
    public static String convertToString(XMLDocument xml) throws
    IOException
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    xml.print(pw);
    String result = sw.toString();
    return result;
    /* for converting string to document */
    public static XMLDocument convertToXml(String xmlStr)
    throws
    IOException,SAXException
    ByteArrayInputStream inStream = new
    ByteArrayInputStream(xmlStr.getBytes());
    DOMParser parser = new DOMParser();
    parser.setPreserveWhitespace(false);
    parser.parse(inStream);
    return parser.getDocument();

  • 3rd party integration: How to get XML Schema (.xsd) for a custom entity, to use with a mapper

    Is there an easy way to get the xml schema/DTD for a custom entity, specifically an .XSD file for that entity (which will then be used to create a map to be able to transform the fields of the entity to a 3rd-party message format)?
    So have a custom entity with lots and lots of fields. Each of the fields will map to a differently named field to match the schema of the 3rd party entity. A very common situation. Looking to use a tool like the Biztalk mapper or Altova's MapForce to generate
    an .xslt file to transform the downloaded entity (service.Retrieve with all columns) to the new format. (Will implement a typical VETR pattern.)
    Apparently with CRM 4 there was a call that provided this, but from 2011 has not been available. Working with a crm 2015 system.

    That will give a descriptor of the table and allow creation of an .XSD file, but it's really complex in terms of types, and the there's type conversion. It might be an easy way to get a schema, with the downside being it's hard to use that schema. 
    It seems easier to do a fetch of the record with all fields filled in using service.Retrieve, and then converting this to xml, using Microsoft's guidance leads to using https://msdn.microsoft.com/en-us/library/hh675409.aspx which will serialize the entity
    into XML with all the fields converted to type string, and with complex fields likewise converted to strings with additional information about the type. 
    Using this it's possible using an number of tools to create an easier to use .XSD file.
    However, it would seem most integrations of this type are using 3rd party CRM connectors. Perhaps this is why Microsoft hasn't provided anything direct (and took away what they did have in crm4.0 due to it generating a hard to use .XSD or due to letting
    their partners continue income streams from selling connectors").
    But without using 3rd party connectors, or following the still tedious method of generating .XSD (a useable .xsd), have not yet come up with an easy, automatic way to get an .XSD or to easily integrate with 3rd party message format.

  • How to dynamically set connection string for report in C# code?

    Hi,
    I have installed CRVS2010. I have created new Crystal Report WPF Application and new report. I would like to set connection string for report in code dynamically.
    Is this possible?
    Thanks
    Ivana

    Lots of posts in this forum on how to set database connections. WPF should not be a consideration as it's just a viewer. The report engine is still the same. Search these forums. Use the search box at the top right corner of this page. Look at samples here:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    Note that none of the samples above are using WPF, but like I said, the WPF is just a different viewer and will not impact how the report engine logs on to a database. (I think of it as a gray car vs. a red car. Same engine, just the color is different)
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • How to Parse XML into String in BPEL?

    Hi,
    Can anyone tell me, how can I parse XML into String?
    I am taking input from File Adapter, File adapter is reading that XML.
    Then in assign activity i am using XPath expression(built functions) using XMLParser(),doTranslateToNative() etc.. many functions I have tried but XML is not getting parsed into String Variable.
    Please help me asap.
    Thanks
    Shikha

    Thanks a lot Eric.
    I am trying this, oraext:get-content-as-string('receiveInput_Read_InputVariable','body','/ns3:orders')
    but getting this error
    <bpelFault><faultType>0</faultType><subLanguageExecutionFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>XPath expression failed to execute. An error occurs while processing the XPath expression; the expression is oraext:get-content-as-string('receiveInput_Read_InputVariable','body','/ns3:orders'). The XPath expression failed to execute; the reason was: internal xpath error. Check the detailed root cause described in the exception message text and verify that the XPath query is correct. </summary></part><part name="code"><code>XPathExecutionError</code></part></subLanguageExecutionFault></bpelFault>

  • How to Convert Time Stamp to String for Filename use

    I'm writing an Labview application in which I would like to convert pull time stamp infor from Time Stamp VI and convert to string so I can use to append as part of filename.
    The fomat that I want may look something like basefilename081208_1300.  This would represent a file name that has elements consisting of the date 08/12/08 and 13:00 hours zulu.
    Paul 

    Hello:
    Use the Format Date/Time String VI, and use as the format string the following: %d%m%y_%H%M
     This way you'll get the date string you want. 
    Then concatenate the output to other strings you need to name your file.
    I've attached an screenshot.
    Hope this helps.
    Robst.
    Robst - CLD
    Using LabVIEW since version 7.0
    Attachments:
    datetime string.JPG ‏20 KB

  • How to handle xml CDATA string element when OSB calling a webservice

    Hi
    Right, I'm new to OSB so bear with me.
    The following is a response from am operation in a webservice.
    As you can see there is a CDATA string in "<m:return>" element. I want to transform the CDATA string to XML.
    I have searched the forum and found a couple of similar queries and tried following the answers and this is what I'm getting.
    Please advise as to where I have gone wrong and how I can correct it.
    <env:Body xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
         <m:ReservationCancelResponse xmlns:m="http://domain/jws">
              <m:return>
                   <![CDATA[<?xml version="1.0" encoding="UTF-8"?><ReservationCancelNegativeAck><MessageId>HGv2OWS6hq</MessageId><ReservationNum>1234</ReservationNum><CsrId></CsrId><ErrorCode>02</ErrorCode><ErrorMessage>Reservation '1234' does not exist.</ErrorMessage></ReservationCancelNegativeAck>]]>
              </m:return>
         </m:ReservationCancelResponse>
    </env:Body>
    In my response pipeline I have an Assign and Replace action.
    My Assign is:
    Expression: fn-bea:inlinedXML($body)
    Variable: reservationCancelReponse
    When I log $reservationCancelReponseI get... so this bit is OK.
    <ReservationCancelNegativeAck>
    <MessageId>HGv2OWS6hq</MessageId>
    <ReservationNum>1234</ReservationNum>
    <CsrId/>
    <ErrorCode>02</ErrorCode>
    <ErrorMessage>Reservation '1234' does not exist.</ErrorMessage>
    </ReservationCancelNegativeAck>
    My Replace
    XPath: executeResponse/executeReturn/text()
    In Variable: body
    Expression: responseTransform.xq (binding with $reservationCancelReponse)
    Replace Node Contents is checked
    When I test the operation using the proxy service I get the following:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header/>
    <env:Body>
    <m:ReservationCancelResponse xmlns:m="http://com/ventyx/abws/jws">
    <m:return>
    &lt;?xml version="1.0" encoding="UTF-8"?>&lt;ReservationCancelNegativeAck>&lt;MessageId>HGv2OWS6hq&lt;/MessageId>&lt;ReservationNum>1234&lt;/ReservationNum>&lt;CsrId>&lt;/CsrId>&lt;ErrorCode>02&lt;/ErrorCode>&lt;ErrorMessage>Reservation &amp;apos;1234&amp;apos; does not exist.&lt;/ErrorMessage>&lt;/ReservationCancelNegativeAck>
    </m:return>
    </m:ReservationCancelResponse>
    </env:Body>
    </env:Envelope>
    The CDATA string hasn't been transformed.
    Please help. What I have I missed.
    Thanks in advance.
    MI

    OK
    I have made some amendments to the original process and made some progress but still isn't quite right.
    I have created a schema:
    <complexType name="ReservationCancelNegativeAckType">
         <sequence>
                   <element name="MessageId" minOccurs="0">
                        <annotation>
                             <documentation>
                             </documentation>
                        </annotation>
                        <simpleType>
                             <restriction base="string" />
                        </simpleType>
                   </element>
                   <element name="ReservationNum" minOccurs="0">
                        <annotation>
                             <documentation>
                             </documentation>
                        </annotation>
                        <simpleType>
                             <restriction base="string" />
                        </simpleType>
                   </element>
                   <element name="CsrID" minOccurs="0">
                        <annotation>
                             <documentation>
                             </documentation>
                        </annotation>
                        <simpleType>
                             <restriction base="string" />
                        </simpleType>
                   </element>
                   <element name="ErrorCode" minOccurs="0">
                        <annotation>
                             <documentation>
                             </documentation>
                        </annotation>
                        <simpleType>
                             <restriction base="string" />
                        </simpleType>
                   </element>
                   <element name="ErrorDescription" minOccurs="0">
                        <annotation>
                             <documentation>
                             </documentation>
                        </annotation>
                        <simpleType>
                             <restriction base="string" />
                        </simpleType>
                   </element>
         </sequence>
    </complexType>
    <element name="ReservationCancelNegativeAckType"
         type="tns:ReservationCancelNegativeAckType">
    </element>
    I have amended the earlier Assign action to use an XQ to extract the CDATA string into the schema
    My Assign is:
    Expression: responseToSchema.xq
    Variable: reservationCancelReponse
    When I log $reservationCancelReponse variable I get... so this bit is OK.
    <ReservationCancelNegativeAck>
    <MessageId>HGv2OWS6hq</MessageId>
    <ReservationNum>1234</ReservationNum>
    <CsrId/>
    <ErrorCode>02</ErrorCode>
    <ErrorMessage>Reservation '1234' does not exist.</ErrorMessage>
    </ReservationCancelNegativeAck>
    I have also changed my Replace, this time I am using an XQ which will map the schema to the XSD WSDL "ReservationCancelResponse"operation.
    XPath: .
    In Variable: body
    Expression: responseFromSchemaToService.xq (binding with $reservationCancelReponse)
    Replace Node Contents is checked
    XSD WSDL is:
    <xsd:element name="ReservationCancelResponse"
         type="tns:ReservationCancelResponseType">
    </xsd:element>
    <xsd:complexType name="ReservationCancelResponseType">
         <xsd:sequence>
              <xsd:element name="ResponseCode"
                   type="xsd:string">
              </xsd:element>
              <xsd:element name="ResponseDescription"
                   type="xsd:string">
              </xsd:element>
              <xsd:element name="MessageID" type="xsd:string">
              </xsd:element>
              <xsd:element name="ReservationNum" type="xsd:string">
              </xsd:element>
              <xsd:element name="CsrId" type="xsd:string">
              </xsd:element>
              <xsd:element name="ErrorCode" type="xsd:string"
                   minOccurs="0">
              </xsd:element>
              <xsd:element name="ErrorDescription" type="xsd:string" minOccurs="0"></xsd:element>
         </xsd:sequence>
    </xsd:complexType>
    This time the response is better but not right.
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"/>
    <env:Body xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <app:ReservationCancelResponse xmlns:app="http://www.example.org/AppointmentService/">
    <ResponseCode>0</ResponseCode>
    <ResponseDescription/>
    <MessageID/>
    <ReservationNum/>
    <CsrId/>
    </app:ReservationCancelResponse>
    </env:Body>
    </soapenv:Envelope>
    As you can see the tags are empty. (For info: The "ResponseCode" and "ResponseDescription" are constants)
    Where have I gone wrong?

  • How to set XML character encoding for a SOAP response?

    Hi,
    We're using Oracle J2EE web services,
    and are quite happy with them.
    However, it's a problem that we need to have
    characters outside the standard English alphabet
    in our service responses. So far, we have not been
    able to find a way to specify what encoding to use.
    Our version (9.0.3 release) produces SOAP-responses
    without any encoding specification in the XML header.
    Any ideas?

    Hello,
    If you are using the "Paper Layout", check the Reports's "Before Report Value" property:
    Before Report Value :
    <meta http-equiv="Content-Type" content="text/html; charset=&Encoding">
    If you are using the "Web Layout", take a look to the document :
    http://download-uk.oracle.com/docs/cd/B14099_17/bi.1012/b14048/pbr_nls.htm#i1006142
    18.3 Specifying a Character Set in a JSP or XML File
    Regards

  • How to convert an xml data(clob) in database to string format in bpel??

    Now I am learning SOA ,I have one scenario which I store the each record  in xml format in database  from file adapter ,extract the xml data and store the data in another  table ...Give me any suggestions which I slove these issue .
    Thanks in advance.

    Hi
    You can try the below xpath function to convert the xml into string - orcl:get-content-as-string(/xsdLocal:SAPOrderRequest)
    To convert the string back to XML - ora:parseEscapedXML(bpws:getVariableData('stringpayloadVar'))
    Regards
    Albin I

  • EBS search string for check number

    Hello Gurus
    My client is using MT940 FORMAT for EBS,requirement is in a bank statement we are having 10 transactions which are having the same amount for ex:rs.1000 for ten payment transactions. now system is not able to post the document when we import the bank statement.
    I wanted to use search string for check number,  note to payee in bank statement is check number.Please find the below refference
    /EI/400229001       010013
    0000010013
    Reference 010013
    How could i use search string for this i tried but im not getting the solution im getting the following error difference is too large F5 263.
    Appreciated for our help............
    Thanks a lot in advance...............

    Hi Paulo,
    Thanks for the reply. However i have the following setting and it still does not work..
    Mapping -> AB01
    When i do the simulation it shows the Number and the hits and mapping.
    In the Seach String use i have following settings:
    CC 1000
    Interpretation : ALL Interpretation
    Search String : TEST1 ( this is the name that i gave to above search string)
    Target : Posting RUle
    Active checked.
    But still when i upload the bank statement it is posting to Rule AB03 and not AB01
    Also when i try FEBSTS it says no document hits ???
    Your answer is greatly appreciated.

  • How to convert BLOB into a String

    Hi,
    I got a blob column from the database.
    It contains one XML File.
    How to convert it into String.
    I need the code for how to convert the blob into String
    Thanks in Advance.

    A blob would be a byte-array, which you can use in the String(byte[]) constructor

  • How to convert xslt file into string

    i'm writting a java program to use xslt to transform the xml file. i'm encountering the problem when i try to convert the xslt file into string. i've defined my utility class called 'XmlUtil' to carry out the operation of transform xml file through xslt. but in my main java program i need to convert both xml and xslt file into a string in order to input them in my function argument. my function argument is as follows:
    String htmlString = XmlUtil.applyXsltString(xmlContent, xsltString);
    i've already converted xmlcontent into string by using:
    xmlContent = xmlContentBuffer.toString();
    but i don't know how to convert 'xsltString' now ? i've searched the google for an hour but i cannot find the solution. anyone can help ?
    detail of my souce code is as follow:
    import java.io.*;
    import java.net.*;
    import java.lang.*;
    import java.io.StringReader;
    import java.lang.reflect.Array;
    import java.util.Properties;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.sax.SAXResult;
    import javax.xml.transform.sax.SAXSource;
    import javax.xml.transform.sax.SAXTransformerFactory;
    import javax.xml.transform.sax.TransformerHandler;
    import javax.xml.transform.stream.StreamSource;
    import org.apache.xml.serializer.OutputPropertiesFactory;
    import org.apache.xml.serializer.Serializer;
    import org.apache.xml.serializer.SerializerFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.xml.sax.InputSource;
    import org.xml.sax.XMLReader;
    import org.xml.sax.helpers.XMLReaderFactory;
    import XmlUtil;
    public class FileDownload {
    public static void download(String address, String localFileName){
    OutputStream out = null;
    URLConnection conn = null;
    InputStream in = null;
    StringBuffer xmlContentBuffer = new StringBuffer();
    String temp = new String();
    String xmlContent;
    try {
    URL url = new URL(address);
    out = new BufferedOutputStream(
    new FileOutputStream(localFileName));
    conn = url.openConnection();
    in = conn.getInputStream();
    byte[] buffer = new byte[1024];
    int numRead;
    long numWritten = 0;
    System.out.println (in.toString ());
    while ((numRead = in.read(buffer)) != -1) {
    out.write(buffer, 0, numRead);
    numWritten += numRead;
    temp = new String(buffer);
    xmlContentBuffer.append(temp);
    System.out.println(localFileName + "\t" + numWritten);
    xmlContent = xmlContentBuffer.toString();
    String htmlString = XmlUtil.applyXsltString(xmlContent, xsltString);
    } catch (Exception exception) {
    exception.printStackTrace();
    } finally {
    try {
    if (in != null) {
    in.close();
    if (out != null) {
    out.close();
    } catch (IOException ioe) {
    public static void download(String address) {
    int lastSlashIndex = address.lastIndexOf('/');
    if (lastSlashIndex >= 0 &&
    lastSlashIndex < address.length() - 1) {
    download(address, address.substring(lastSlashIndex + 1));
    } else {
    System.err.println("Could not figure out local file name for " + address);
    public static void main(String[] args) {
    for (int i = 0; i < args.length; i++) {
    download(args);
    }

    I don't understand why you need load the XML and XLS files into a String. A Transformer can be constructed from a Source and there is a StreamSouce which can be constructed from an InputStream. The transform() method can take a Source as input and can produce a Result. There is no need to go near a String representation of either the input.

Maybe you are looking for

  • Stop with an external monitor in Mavericks

    I moved to MacBook PRO Retina 13" from a MacBook PRO late 2009. Using an external monitor in Mavericks when unplugging power, the computer doesn't stop and the battery power slowly drains. In the old MacOS X and with the old MacBook PRO once you disc

  • Maintenance Mode never ends

    I want to put a scom gruop into Maintenance. The Management Server is not member of it. When I use the following Powershell Script with SCOM 2012.... Import-Module OperationsManager $Instance = Get-SCOMGroup -displayname "<Group>" $Time = ((Get-Date)

  • Acrobat 7.1.0 wont save preferences under windows 7 64 bit ultimate

    I try to setup preferences in acrobat 7.1.0 under w7 ultimate 64 bit and preferences always return to default. I use domain admin account which is under administrators group.

  • Forms 4.5 with Oracle 10g

    Hi, I have an application in - Front end tools : Oracle Forms/Reports 4.5. RPT, SQL, and PROC(all are in CUI-character user interface) Database : Oracle 7.3.4. I have a plan for migrating database to 10g keeping front-end as it is. Is there any compa

  • Listening for HttpURLConnections ?

    hi, I have implemented a client opening a HttpURLConnection to send an image to a servlet. I would like to know how should be the code on the server, listening for httpURLconnections... can you give me some tip ? Here is the client code... What I nee