xsl-list
[Top] [All Lists]

Re: [xsl] From XML to Windows clipboard as styled data to be pasted into a MS-Word document

2019-01-24 08:19:47
What is the authoring environment?

Oxygen XML has an available add-on that is a clipboard inspector--if you cut 
from Word and then inspect the result that might provide a clue.

You can certainly paste HTML into Word and get a decent result but it might not 
produce the complete result you want (e.g., setting appropriate styles).

I did some very quick research and this StackOverflow message suggests that 
Office's clipboard format is actually zipped up Office XML, in which case it 
wouldn't be too hard to generate with XSLT and Java.

My Wordinator project (wordinator.org) provides a Java-and-XSLT-based framework 
for generating DOCX from XML using the Apache POI library underneath. POI 
generates the actual DOCX file, which is a zip of Office OpenXML, so it might 
not be too hard to adapt to generating what you'd want on the clipboard (or it 
might be easier to just generate the Office Open XML directly if your use case 
is pretty focused).

Cheers,

E.
--
Eliot Kimber
http://contrext.com
 

On 1/24/19, 12:58 AM, "Larry Hayashi lhtrees(_at_)gmail(_dot_)com" 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

    I am wondering if anyone has any experience in transforming an XML document 
into a format that could be pasted from the Windows clipboard into a Word 
document. The Word document will have a particular doc template with named 
styles and the transformed data will need to utilize those styles (set in a 
preferences interface in a custom application). I want to use XSL on the XML 
source and I suspect that I need to generate Rich Text Format, but maybe there 
is a less verbose format than RTF, perhaps some XML doc format for pasting 
styled/formatted text into Word??
    The scenario would be something like this: 
    
    Linguistic application has interlinear text with sentences. User selects 
and copies one interlinear text sentence. On copy, the application uses an 
internal XML version of the selected text which would be transformed into RTF 
or equivalent. User pastes beautifully formatted example into their Word 
document with correct auto numbering styles, etc.
    
    Thanks for any advice.
    
    Larry
    
    
    XSL-List info and archive 
<http://www.mulberrytech.com/xsl/xsl-list>EasyUnsubscribe 
<http://lists.mulberrytech.com/unsub/xsl-list/1278982>
    (by email <>)
    
    
    
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>