Custom XML Changes in Word 2010

Oct 1, 2010 at 12:49 AM

Hi,

Have you made any progress in changing the architecture for Word 2010 given that Custom XML is being removed?

Thanks,

Tom

Coordinator
Oct 1, 2010 at 6:49 AM

No, no changes made yet.

As long has you have a copy of Word 2007 around, you can keep creating and maintaining your fleXdoc-templates. The generated documents don't contain custom XML tags, so there's no problem there. Therefore there's really no urgent need for upgrade.

It is a lot of work to redesign fleXdoc and since it's an open source project and I currently don't use it myself (not doing any document generation at the moment), it get pretty tough to keep motivated. :s.

Btw: there a way to have Word 2010 save documents with custom XML tags (by using a custom build addin). I may release such an addin in the near future. That way fleXdoc does not need to be redesigned yet.

Oct 2, 2010 at 12:28 AM
I'm looking to make something similar but it would need to be word 2010 compatible. I don't think it's viable to chase around copies of 2007 forever. 

Content controls could work but I need to be able to do if statements based on the XML so I can conditionally show text. Not sure how that would work with content controls. 

On 01/10/2010, at 4:49 PM, "robertk"<notifications@codeplex.com> wrote:

From: robertk

No, no changes made yet.

As long has you have a copy of Word 2007 around, you can keep creating and maintaining your fleXdoc-templates. The generated documents don't contain custom XML tags, so there's no problem there. Therefore there's really no urgent need for upgrade.

It is a lot of work to redesign fleXdoc and since it's an open source project and I currently don't use it myself (not doing any document generation at the moment), it get pretty tough to keep motivated. :s.

Btw: there a way to have Word 2010 save documents with custom XML tags (by using a custom build addin). I may release such an addin in the near future. That way fleXdoc does not need to be redesigned yet.

Oct 12, 2010 at 4:11 AM

@wildest, re conditional text.

Please see http://dev.plutext.org/svn/docx4j/trunk/docx4j/sample-docs/databinding/conventions.html for my proposal on this.

I'd be interested in any feedback.

cheers .. Jason

Nov 3, 2010 at 7:15 PM

 

Want to be a developer for fleXdoc? Contact me!

I want!

Apr 27, 2011 at 6:44 PM

Hi Robert,

You mentioned that there is a way to save Word 2010 document with custom XML tags using a build addin.  Can you elaborate on that?  How and what third party do I need?  My company upgraded office and now having problem with our document that use to work.   Appreciate your answer.  Thanks.

Coordinator
Apr 28, 2011 at 7:11 AM

Hello Nino.

I tried that approach some time ago. The idea was to let the addin obtain the document XML (flat-opc) from the Word objectmodel and save it itself. However, it turned out this flat-opc-XML that the objectmodel provides has already been stripped, so no custom XML tags there as well. Therefore this method doesn't work after all.

This means you need to keep an Office 2007-copy around for editing your templates. The output-format of fleXdoc (the generated document) is still OOXML thus still the native document format of Word 2010 as well. So this problem only exists for template-editors, not for endusers of the generated documents. This is also why I still use fleXdoc myself, also for new customers, since it's still the cheapest and most flexible solution around. Keeping an old copy of Word 2007 around is usually not too much of a problem.

Regards,
Robert

Jul 4, 2011 at 9:29 AM

Hello Robert,

just found this webpage of Microsofts adversary here:
http://www.i4i.com/x4w.htm

So it looks like as they want to make some additional money with the custom XML part now. ;-)

Anyway, $1.99 (per seat) is an acceptable price. I did not try it yet, but by using this "x4w" the problem here should be solved, right?

Best regards
Andreas

Coordinator
Jul 4, 2011 at 10:11 AM

Hello Andreas,

I just looked at it and it looks promising. However:

  • It's not a ready to use tool: it's a library that can be used to build your own tool
  • It supports opening Word-documents and is a work-a-round to prevent Word from stripping the custom XML tags. However, it does not seem to support saving Word documents, so modifying a template is still not possible. This seems to match my own findings when attempting to use a custom Word AddIn that saves the document itself (see my remark above your comment).
  • Maybe not so important, but do you really want to buy a tool from the company that forced MS to remove the custom XML-support in the first place? ;-)
Jul 4, 2011 at 12:02 PM
Edited Jul 5, 2011 at 7:58 AM

Hello Robert,

first thank you very much for your super-fast reply! 

robertk wrote:
  • It's not a ready to use tool: it's a library that can be used to build your own tool
  • It supports opening Word-documents and is a work-a-round to prevent Word from stripping the custom XML tags. However, it does not seem to support saving Word documents, so modifying a template is still not possible. This seems to match my own findings when attempting to use a custom Word AddIn that saves the document itself (see my remark above your comment).

I've tested the sample now and this seems to work very good so far:
after installing the sample I had a new Tab "x4wTab" in my Word 2010 ribbon bar. There are two buttons: "New" and "Open". When I open the "OrderTemplate.docx" file from the fleXdoc example with this open button I can see all custom XML tags. Then I changed something and saved it. After that I opened it again and my changes including all custom XML tags were still present. So saving documents seems to work without problems.

Maybe you could also give it a try.

robertk wrote:

  • Maybe not so important, but do you really want to buy a tool from the company that forced MS to remove the custom XML-support in the first place? ;-)

I absolutely agree with you and I also don't like this idea, but I really like to use your great fleXdoc tool for an upcoming customer project. But the problem is I cannot explain to my customer that I want to use a reporting solution where I already know it won't work together with Word 2010 and all future versions.

So either I find a way to make fleXdoc compatible with newer Word products or I have to search for a different tool. But as I really like fleXdoc, buying something from this company may be the lesser evil. ;-)

Best regards
Andreas

Coordinator
Jul 4, 2011 at 12:09 PM

C00l! So you used the default save-functionality from Word? I thought I tested that, but Word removed the custom XML tags during save as well...

Jul 4, 2011 at 12:56 PM
Edited Jul 4, 2011 at 1:01 PM

Hello Robert,

robertk wrote:

C00l! So you used the default save-functionality from Word? I thought I tested that, but Word removed the custom XML tags during save as well...

Yes, I just used the normal save button of Word.

I just have one problem now:
after I did the steps above (I just added "TEST" at the beginning of the document - no custom XML changed) I tried to run the fleXdoc service client agains the changed template. This resulted in following error message (translated from German): "Error: the required size to save the XML content exceeds the buffer contingent."

I just uploaded a ZIP file containing the original template from your example and the changed one here. Perhaps this helps to find out what's the problem:
http://www.ab-tools.com/temp/flexdoc1.zip

But I do get this error only if the checkbox "Validation" is checked. If I uncheck it, the build works perfectly and the Word document based on my changed template shows up! :-)

So obviously only the validation fails. Maybe you have an idea what's the reason for that and if that's important or not.

Best regards
Andreas

Coordinator
Jul 4, 2011 at 1:20 PM
abtools wrote:
Yes, I just used the normal save button of Word.

That's odd. I created a new template from within Word 2010, added some fleXdoc custom XML tags and saved it to disk. When viewing the template (the xml itself), the tags had been removed. So even though there's no custom save-button on the ribbon, i4i may have tweaked Word's save-functionality as well.

If the saved document is not valid, you may have run into a bug of the i4i-software. The exception raised by fleXdoc may have been bubbled up from the OpenXML SDK used internally. The OpenXML SDK tools also contain an OpenXML validator. Try that tool to determine for sure whether the produced document is valid or not.

Jul 4, 2011 at 1:36 PM

Hello Robert,

robertk wrote:

That's odd. I created a new template from within Word 2010, added some fleXdoc custom XML tags and saved it to disk. When viewing the template (the xml itself), the tags had been removed. So even though there's no custom save-button on the ribbon, i4i may have tweaked Word's save-functionality as well.

In the docu of x4w is says that it does following steps:
1. identifies all the custom XML tags in the document
2. strips them from the document
3. saves them in its memory along with information that unambiguously identifies where the XML tag was in the document
4. passes the document to Microsoft Word, which opens the document normally
5. returns the custom XML to its original location
6. releases the document

robertk wrote:

If the saved document is not valid, you may have run into a bug of the i4i-software. The exception raised by fleXdoc may have been bubbled up from the OpenXML SDK used internally. The OpenXML SDK tools also contain an OpenXML validator. Try that tool to determine for sure whether the produced document is valid or not.

I now used the "Open XML SDK 2.0 Productivity Tool for Microsoft Office" as suggested to validate the documents with following results:
- your original template: validates correctly agains Word 2007 and Word 2010 format.
- the changed template: validates correctly only agains Word 2010 format.

But it is OK if it validates correctly against Word 2010 format only in case only Word 2010 is used, isn't it?

Best regards
Andreas

Coordinator
Jul 4, 2011 at 1:46 PM

The steps you describe (from the i4i-site) describe the document load process only. That's why I thought it only contained functionality to OPEN a custom xml-tag containing document. However, I just did a quick test, but INDEED Word does not strip any custom XML tags during Save! This means I may be able to create my own Word Add In after all! :)

Check this option: File -> Options -> Advanced: it allows you to select the compatibility mode. You can set this to Word 2007. Probably the savest option, considering not all end-users of the produced document will possibly be using Office 2010 already.

Jul 4, 2011 at 2:02 PM

Hello Robert,

robertk wrote:

The steps you describe (from the i4i-site) describe the document load process only. That's why I thought it only contained functionality to OPEN a custom xml-tag containing document. However, I just did a quick test, but INDEED Word does not strip any custom XML tags during Save! This means I may be able to create my own Word Add In after all! :)

Yes, especially as the x4w DLL is a .NET DLL and therefore it is very easy to get the source code of it - and it seems not that they use much obfuscation. ;-)

robertk wrote:

Check this option: File -> Options -> Advanced: it allows you to select the compatibility mode. You can set this to Word 2007. Probably the savest option, considering not all end-users of the produced document will possibly be using Office 2010 already.

I checked that and the Word 2007 compatibility mode was set already. Obviously it still saves it in Word 2010 format...

Best regards
Andreas

Jul 4, 2011 at 4:41 PM

If you replicated the functionality of the x4w add in with custom xml, wouldn't you be in breach of the patent as well?

Coordinator
Jul 5, 2011 at 7:52 AM

I doubt that. The AddIn itself does not do anything that is described in the patent. Again, I'm not 100% sure it will be possible and I haven't reflected the x4w-code yet.

Jul 5, 2011 at 7:56 AM

Hello Robert,

great, maybe you could also solve this validation issue then - although it seems not to have an influence on the result itself: the document was generated perfectly based on my changed template when validation was disabled.

Please tell us about any news.

Best regards and thank you very much for your efforts
Andreas

Coordinator
Jul 6, 2011 at 9:53 AM
Edited Jul 6, 2011 at 11:08 AM

Can you send me your copy of the i4w-dll? I cannot reach their site right now.

Jul 6, 2011 at 11:29 AM

Hello Robert,

I did not find your e-mail address on this site here, therefore I've uploaded the evaluation ZIP on my site:
http://www.ab-tools.com/temp/x4w-eval.zip

You can also contact me by e-mail: a-breitschopp@ab-tools.com

Best regards
Andreas

Coordinator
Jul 6, 2011 at 11:48 AM

I just looked at their code: They replace all custom XML tags with bookmarks, load this new version of the document, and once loaded, they replace the bookmarks with their original custom XML tags. Nice idea. Although it does seem they only replace custom XML tags inside the main document part, not the header and footerparts, etc, so not a 100% solution.

Jul 6, 2011 at 12:01 PM

Hello Robert,

OK, but at least this seems to be a good starting point.

Best regards
Andreas

Coordinator
Jul 23, 2013 at 6:34 PM
Come check out the successor of fleXdoc: Docati!
It supports Word 2010 and 2013 as well and runs in the cloud.

I sure hope to welcome you as a Docati user as well! :-)

http://www.docati.com