WmlToHtml in Revision Tracked Document

Home Forums Open-Xml-PowerTools WmlToHtml in Revision Tracked Document

This topic contains 5 replies, has 4 voices, and was last updated by  Anonymous 3 years, 6 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #3710

    hans
    Participant

    Dear Eric,

    I tried to convert the result of the WmlComparer class to html
    but there is no formatting for the tracked changes.
    Is any workaround on this?

    Thank you in advance for your excellent library.

    #3713

    Eric White
    Keymaster

    Hi,

    I can’t remember specifically what I did with regards to formatting on the tracked changes. This is a brand new module, so I am not surprised that there are issues with regards to formatting.

    I will add this issue to the list, although it is difficult to say when I will be working on this module.

    I’m glad you enjoy the library. 🙂

    Cheers, Eric

    #3737

    hans
    Participant

    Dear Eric,

    The scenario that i have is the following
    -Compare 2 documents with WmlComparer and save it (compared.docx)
    -Open the compared.docx with Open xml sdk productivity tool i see elements like
    w:del, w:delText, w:ins etc. related with tracked revision.
    -I Use HtmlConverter in order to convert the compared.docx in html but all above elements removed.
    Is it possible to display them in html?

    Thanks
    Hans

    #3772

    Eric White
    Keymaster

    Hi Hans,

    The WmlToHtmlConverter (which is the new name for HtmlConverter) module does not display revision tracking marks. This is not a feature of the module.

    I have often contemplated adding this functionality to that module, but it has never risen to the top of the list of projects yet.

    If I recall correctly, the WmlToHtmlConverter module accepts all tracked revisions before doing the transform.

    I have also contemplated a transform that converts a DOCX with revision tracking marks to another DOCX where rev tracking marks are converted to red-line ordinary markup, in other words, a document with text that has strike-through for deleted text, and underline for inserted text, with appropriate colors. But that module also has never risen to the top of the pile.

    Sorry, wish I had a better answer for you, but I don’t.

    Cheers, Eric

    #8797

    grutt
    Participant

    Hi Eric, Hans,

    Reviving a dead thread because I’m currently looking at a similar use case. We’re exploring the option of generating a more traditional red-line ordinary docx based on the tracked changes file. I figured I’d check in to see if I was missing a more recent development or an alternative solution to this formatting (since as far as I understand revisions cannot be styled).

    Would appreciate any insight here,
    Thanks,
    Gabe

    #9783

    Anonymous

    This element specifies that applications shall track revisions made to the WordprocessingML document. Revisions are changes to a WordprocessingML document which are recorded such that they can be viewed independently, accepted or removed, and reverted if needed. When revisions are tracked, the resulting WordprocessingML markup in the Revisions subclause of this document describes the necessary syntax.

    If this element is omitted, then revisions shall not be generated by changes to the contents of this document.

    [Example: Consider a WordprocessingML document containing the text run Example that must not have revisions tracked. Example WordprocessingML from Document 1 is given below:

    XML

    Copy
    <w:document>
    <w:body>
    <w:p>
    <w:r>
    <w:t>Example</w:t>
    </w:r>
    </w:p>
    </w:body>
    </w:document>
    And the corresponding document settings:

    XML

    Copy
    <w:settings>
    <w:trackRevisions w:val=”false”/>
    …</w:settings>
    If the word text was added to the end of this document and bolded without revisions tracked, the resulting WordprocessingML would be output as follows:

    XML

    Copy
    <w:document>
    <w:body>
    <w:p>
    <w:r>
    <w:t>Example</w:t>
    </w:r>
    <w:r>
    <w:rPr>
    <w:b/>
    </w:rPr>
    <w:t>text</w:t>
    </w:r>
    </w:p>
    </w:body>
    </w:document>
    And the corresponding document settings:

    XML

    Copy
    <w:settings>
    <w:trackRevisions w:val=”false”/>
    …</w:settings>
    Finally, assume the same insertion and formatting took place when the trackRevisions element’s val attribute was set to true, the resulting WordprocessingML would be output as follows:

    XML

    Copy
    <w:document>
    <w:body>
    <w:p>
    <w:r>
    <w:t>Example</w:t>
    </w:r>
    <w:ins … >
    <w:r>
    <w:rPr>
    <w:b/>
    <w:rPrChange … >
    <w:rPr/>
    </w:rPrChange>
    </w:rPr>
    <w:t>text</w:t>
    </w:r>
    </w:ins>
    </w:p>
    </w:body>
    </w:document>
    And the corresponding document settings:

    XML

    Copy
    <w:settings>
    <w:trackRevisions w:val=”true”/>
    …</w:settings>
    The trackRevisions element’s val attribute was set to true, therefore the changes to the content of the document were inserted using the appropriate annotation elements in the document’s WordprocessingML. Specifically, inserting the text Text to the right of the existing text was tracked as a revision with the ins element. In addition, applying bold formatting to the text was tracked as a revision with the rPrChange element. end example]

    Admin
    Apps4Rent | O365CloudExperts

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.