locked
How to generate XSL stylesheet(XSLT) from DOCX file?

    Question

  • Hi,

    I need to generate XSLT file from DOCX file(document.xml, fonttable.xml, numbering.xml, settings.xml, styles.xml, websettings.xml). Once the complete XSLT file is generated I can use xsltprocessor to transform the document.xml to html string, where the html will be previewed in C# winRT Webview. Please help in how to generate a complete XSLT file for the given DOCX file.

    I have tried with docx2html.xslt and able to generate html and display in Webview control. But docx2html.xslt is not a complete xsl stylesheet, so the html is not having images, ordered list and fonts properly.

    I  need a complete XSLT file with all the word 2007 to 2013 stylesheet to achieve the same. Kindly let me know to generate the complete(with all word 2007 to 2013 features) XSLT file from DOCX file or is the complete(with all word 2007 to word 2013features) XSLT file is available to download.

    Ashok

    Wednesday, March 12, 2014 4:37 AM

Answers

  • Hi Ashok,

    Sorry, I cannot tell and I cannot confirm, the only thing I can do is to submit to our senior engineers. This could be a customer request, as I know API for office is a popular request.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, March 25, 2014 6:42 AM
    Moderator

All replies

  • This would be better asked on an Office developer forum, or an XML developer forum.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, March 12, 2014 1:27 PM
    Moderator
  • Hi Ashok,

    Agree with Matt, you have three sub questions in your post, you should post in different forums for better supports.

    1, How to get a XML from DOCX, could be ask at Word for Developers forum.

    2, How to generate XSLT from xml, could be ask at Open XML Format SDK or read the documentation Open XML SDK 2.5 should helps. (I'm not familiar with this)

    3, How to use winrt api XsltProcessor class and display in webview, you can get solution from this forum.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, March 13, 2014 3:35 AM
    Moderator
  • Hi Matt & James,

    Thanks for your reply.

    I am creating a C# Windows Store app to view the docx file in Webview, hope this is the right forum. More over Open XML SDK is not able to use in Windows Store app. Please just help in how to generate a XSLT from DOCX file. I will also ask at Word for Developers forum.

    Ashok

    Thursday, March 13, 2014 4:24 AM
  • Hi Ashok,

    As I know there is no in-build WinRT API for directly access the DOCX file. However I found a interesting discussion here: http://social.msdn.microsoft.com/Forums/windowsapps/en-US/b08b8332-ca2c-4dc3-a960-ebde44b3d77d/windowsdataxmlxslxsltprocessor?forum=winappswithcsharp

    I don't know if there is some way that you can get a xml from docx. But hope this helps.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, March 14, 2014 7:04 AM
    Moderator
  • Hi James,

    Thanks for your reply.

    In future, Will Microsoft provide any API to preview the office document(docx, xlsx, pptx) inside Windows Store app?

    We are excepting those API's from Microsoft.

    Ashok

    Friday, March 14, 2014 9:36 AM
  • Hi Ashok,

    Sorry, I cannot tell and I cannot confirm, the only thing I can do is to submit to our senior engineers. This could be a customer request, as I know API for office is a popular request.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, March 25, 2014 6:42 AM
    Moderator
  • Hi James,

    Thanks for your initiative and understanding.

    Ashok

    Tuesday, March 25, 2014 1:29 PM