We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Word to xml conversion

<span style=“font-size:11.0pt;font-family:“Calibri”,“sans-serif”;
mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:
minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:“Times New Roman”;
mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>Does ASPOSE Word support word to xml
conversion??

Hi Waheed,


Thanks for your interest in Aspose.Words for Cloud. Yes, you can save the document in the Microsoft Word 2003 WordprocessingML format. Please see the following code for example:

AsposeApp.AppSID = “your AppSID”;

AsposeApp.AppKey = "your AppKey";

string fileName = "Source.docx";

//build URI to convert MS Word file to other format using storage

string strURI = "http://api.aspose.com/v1.1/words/" + fileName + "?format=wml";

//sign URI

string signedURI = Utils.Sign(strURI);

//get response stream

Stream responseStream = Utils.ProcessCommand(signedURI, "GET");

using (Stream fileStream = System.IO.File.OpenWrite("c:\\temp\\MyFile.xml"))

{

Utils.CopyStream(responseStream, fileStream);

}

responseStream.Close();


public static string Sign(string
url)<o:p></o:p>

{<o:p></o:p>

try<o:p></o:p>

{<o:p></o:p>

// Add appSID parameter.<o:p></o:p>

UriBuilder builder = new
UriBuilder(url);<o:p></o:p>

<o:p></o:p>

if (builder.Query != null
&& builder.Query.Length > 1)<o:p></o:p>


builder.Query = builder.Query.Substring(1) + “&appSID=”

  • AsposeApp.AppSID;<o:p></o:p>

    else<o:p></o:p>


    builder.Query = “appSID=” +
    AsposeApp.AppSID;<o:p></o:p>

    <o:p></o:p>

    // Remove final slash here as it can be added
    automatically.
    <o:p></o:p>


    builder.Path = builder.Path.TrimEnd(’/’);<o:p></o:p>

    <o:p></o:p>

    // Compute the hash.<o:p></o:p>

    byte[] privateKey = System.Text.Encoding.UTF8.GetBytes(AsposeApp.AppKey);<o:p></o:p>


    System.Security.Cryptography.HMACSHA1
    algorithm = new System.Security.Cryptography.HMACSHA1(privateKey);<o:p></o:p>

    <o:p></o:p>

    byte[] sequence = System.Text.ASCIIEncoding.ASCII.GetBytes(builder.Uri.AbsoluteUri);<o:p></o:p>

    byte[] hash = algorithm.ComputeHash(sequence);<o:p></o:p>

    string signature = Convert.ToBase64String(hash);<o:p></o:p>

    <o:p></o:p>

    // Remove invalid symbols.<o:p></o:p>


    signature = signature.TrimEnd(’=’);<o:p></o:p>


    signature = System.Web.HttpUtility.UrlEncode(signature);<o:p></o:p>

    <o:p></o:p>

    // Convert codes to upper case as they can be updated
    automatically.
    <o:p></o:p>


    signature = System.Text.RegularExpressions.Regex.Replace(signature,
    “%[0-9a-f]{2}”, e =>
    e.Value.ToUpper());<o:p></o:p>

    // Add the signature to query string.<o:p></o:p>

    return string.Format("{0}&signature={1}", builder.Uri.AbsoluteUri,
    signature);<o:p></o:p>

    }<o:p></o:p>

    catch (Exception
    ex)<o:p></o:p>

    {<o:p></o:p>

    throw new Exception(ex.Message);<o:p></o:p>

    }<o:p></o:p>

}


I hope, this helps.

Best regards,