17 May 2012

Word 2010 Error: "Problem with the contents of the file"

Update 1: There is a solution that may work for some people from Microsoft (released 18/02/2013, nearly a year after this post). Download the Fix-it from this page and see if it repairs the file for you.
Update 2: Also there is a similar blog here which explains the same as I've done (also dated later but describes in a different way)

There is a bug in Word 2010 I've come across for the third time now to do with XML validation on documents when they are saved over a network.

You may have seen this before:


The file 113 Honey Lane brochure.docx cannot be opened because there are problems with the contents.
The XML data is invalid according to the schema.
Location: Part: /word/document.xml, Line: 2, Column: 0

Some online articles report this as a problem with the table of contents, however I've worked with documents that don't have a table of contents. Also I cannot see any Microsoft response to this issue and I hope to get their attention to get this fixed.

Word does have an 'Open & Repair' option, however this only tries to read text from the document, so this doesn't help us at all and leaves us stranded with a 99.99% valid XML document but unable to use it - that is one of the pitfalls of XML I guess. But really this is a bug that Microsoft needs to correct.

How to fix

1. Extract the DOCX file using an compression program (i.e. 7-zip) to a new folder.



2. The 'Location' on the error dialog is where the problem is. However as it says Line 2 Column 0, well, Column 0 is right when the main body opens - which means the actual XML problem could be anywhere. If we knew where it was, we would just need to go to Line 2, Column 286 or whatever, and correct the XML. However when it is like this, we need to validate the XML instead. I recommend Oxygen XML Editor:

http://www.oxygenxml.com/download_oxygenxml_editor.html
(30 day free trial licence sent over email address, 90MB download)

3. Open up Oxygen and open the word/document.xml file from the extracted folder.


4. Validate the XML.


5. Right at the bottom of the validation report are the important errors. Some errors are permittable.



The ones in red are the ones we need to fix. The ones in green are fine.

6. Fix the XML. CTRL+L can take you to the location in blue (Line 2, Column 365...) Here is one example of XML that needs to be fixed but in general the problems I've seen have involved incomplete tags and missing closing tags.


Here, the < mc:Fallback > tag doesn't have a closing tag. Also, there is no closing < /mc:AlternateContent > tag before the new < w:p >. Here is the corrected version. The first 4 validation errors from above, I actually couldn't fix, so I just removed the < mc:Fallback > block altogether (it is a fallback so it is not important anyway).




We can see that the same block is now validated to be OK (there is no longer a red dotted line under the tree leaf on the left). I had to add 2 closing elements and Oxygen actually autocompleted them as soon as I typed < / so I didn't need to type out the whole thing ;)

After saving and validating again we can see there are 2 more errors somewhere else in the document, again these just need some more closing tags.

7. When it validates so there are no more major errors (not to do with namespaces/context), just zip up all the files again in the extracted folder (must be using the ZIP format, other parameters don't matter) and rename to docx. Now open it in Word and the error is gone.


Online articles


http://answers.microsoft.com/en-us/office/forum/office_2010-word/word-2010-document-will-not-open-illegal-xml/0d6d05df-d201-4537-a154-7b2a3df4e32a?msgId=c4b8dd1b-2fe4-4245-aa39-d6df9ed6cbe7

http://help.wugnet.com/office/Word-2007-XML-error-message-ftopict1173860.html

http://help.wugnet.com/office/open-docx-file-content-error-ftopict1081932.html

http://www.pcreview.co.uk/forums/office-open-xml-file-docx-cannot-opened-t3714016.html

15 May 2011

Birthdays

Someone text me, "thanks for making my birthday special".
I thought, that's the whole point! Our birthdays are special and so is how we celebrate them.

So I wanted to reflect on how important age is to us:


  • Age defines laws, what we can and cannot do. This means we use age to determine if doing something is socially or ethically acceptable based on our known behaviour when we are younger while the brain is learning, adapting, becoming aware
  • It defines maturity, intelligence, wisdom, intellect. Our minds change with age
  • How many times we have passed around the sun starting from the same place in the orbit of the Earth around the sun
  • Our physical appearance changes, we lose energy, vibrance, the ability to self-repair. Ears however continue to grow with age
  • Genetic diseases are more likely to become apparent. We become more vulnerable because of joints.
  • Our brains lose the ability to modify easily, especially with reality shift
  • Our desires change when looking for partners

30 April 2011

Epiphany: Problem-solving

I wanted to highlight the key points and feelings I can remember that have helped me to reach an epiphany and solve my problems. Different things work for different people and for me it helps to write everything down.

An easy way to get over things with are bothering you (anxiety) is to 'invent' a reason. This is called Cognitive dissonance.

As for ways to help you get over your problems:

  • Writing them down - helps me a lot when insomnia kicks in
  • Being around other people/friends
  • Listening to music/watching a film/reading a book
  • Drinking (although this isn't really solving them just postponing them)
  • Sleeping
Some things that have helped me realise the best idea to 'invent' and how I should approach situations:




31 March 2011

HTC Wildfire on 3 - Review

Pros


  • Android - awesome operating system with a lot of features
  • 30,000+ apps on the Android App Market
  • Small, compact, lightweight
  • Decent screen resolution, improved font display with the 2.2 update
  • Reasonable 5MP camera, very bright flash. Doesn't take the best pictures but are good enough for a small phone like this
  • HTC Sync software is easy enough to use
  • Nice Facebook integration to your contacts (sometimes requires manual updates)
  • The apps do a lot of talking here, there are countless things you can do with it, some coming pre-installed
  • External volume controls when locked
  • Easy-to-use interface and options
  • Support for up to 32GB SD
  • Has lived through a few accidental drops and no harm seems to be done
  • 2.2 update includes ability to install apps on your SD card


Cons


  • Seemingly slow compared to other HTC models - because of the 512MHz processor and 500MB RAM instead of the 1GB for both in other HTC models
  • Slowness affects: opening apps, navigating, browsing the internet, deleting messages (may take about 2 or 3 minutes to delete 50+ messages)
  • 3 Network coverage is very bad in some areas, customer service is not very good, they are very slow at getting HTC to release software updates for Android, some call cut outs which I never had on Tesco
  • Requires charging quite regularly if you're using it - power is mainly drained by the display and the Wifi
  • Landscape message typing is a little buggy with using backspace, and you can't select the text where the character count is
  • Method of returning to an underlying screen is not very clear, usually have to press Menu and cancel the menu to escape from typing mode
  • Cannot block specific numbers (limited by Android)
  • No Internet Connection Sharing (tethering your phone to your computer)
  • Some apps run slowly and you will probably want a Task Manger (e.g. TaskKill) to manage your running applications so you don't run out of memory
  • On a couple of occasions I haven't been able to unlock my phone while it is ringing

28 February 2011

Table comparison of fast food nutritional information

I wrote this blog as I wanted to reveal what the calories and other values are for different fast foods - and more precisely to compare what they are like against competing chains.

Sources come from the websites of the companies themselves.
I have chosen particular flavours/types based on which ones appear in more than one restaurant.
Values have been rounded down where beyond 1 decimal place.
I haven't included drinks because these technically should be the same wherever you go as they are third-party ;)
Also these are individual items rather than meals for this reason.

Any suggestions of entries to add - please feel free to request!
I may also add a price column to compare.


Item
Energy (Calories) (kcal)
Protein (g)
Carbohydrates (g)
Fat (g)
Fibre (g)
Salt (g)



Total
Of which sugars
Total
Of which saturated fats


Beef Burger








McDonalds Big Mac
490
28
41
8
24
10
4
2.1
Quarter Pounder with Cheese
490
31
37
10
25
13
3
2.2
Burger King Whopper
634
29
48
10
35
9
2
0.9
With Cheese
721
34
49
11
42
14
2
1.3
Burger King Double Whopper
876
50
49
10
53
17
3
0.9
Hambugers








McDonalds Hamburger
250
14
30
6
8
3
2
1.2
Burger King Hamburger
275
14
31
6
9
3
1
0.5
Chicken Burger








McChicken Sandwich
385
16
44
7
16
2
4
1.6
Burger King Chicken Royale
606
23
53
6
32
5
3
1.3
KFC Fillet Burger
460
28.9
46.3
5.3
18
4.1
1.1
2.8
Chicken Nuggets








McDonalds Chicken McNuggets (9 Pieces)
375
20
30
1
21
3
2
0.9
Burger King Chicken Bites (x14)
317
18
28
0
15
4
1
0.5
KFC Popcorn Chicken – Large
426
29.5
24.7
0.9
23.8
2.2
1.3
3.2
Fish








McDonalds Filet-o-Fish
350
15
36
6
16
3
2
1.7
Burger King Ocean Catch
495
17
43
4
27
5
2
0.9
Fries








McDonald’s French Fries Large
460
5
60
1
23
2
6
0.9
Burger King Large
381
4
54
2
18
6
5
0.5
KFC Fries – Large
379
5.2
52.5
1.7
18.9
3.1
<0.1
0.2
Breakfast








McDonalds Bacon & Egg McMuffin
340
20
26
2
17
6
2
1.4
Burger King Bacon & Egg Butty/Bap with Heinz Ketchup
362
18
35
8
17
6
2
0.9
Subway Bacon & Egg
337
17
35
1.5
13.6
4.5
2.3
0.7
Subs








Subway Meatball Mariana
511
27
55
16.1
20.9
8.7
6.2
1.3
Dominos Meatball Sub
541
25.1
67.4
6.9
22.8
10.1
8.3
3.5
Wraps








McDonalds Ranch Snack Wrap
340
15
30
2
18
7
2
2
Burger King Texican Wrap
541
13
59
7
27
5
5
1.2
KFC Toasted Twister
510
23.2
50.1
2.8
24.2
6.1
1.2
2.9
Ice Cream








Burger King Mint Choc Swirl
269
6
37
33
11
8
1
0.2
McDonalds Dairy Milk McFlurry
340
6
49
45
13
9
1
0.3
Pizzas








Dominos Cheese & Tomato Large Regular Crust (10 Slices) *
1830
97
239
30
54
25
17
2.8
Pizza Hut Margherita Large Italian (10 Slices) *
1540
75
196
20
58
28
X
9

* For the pizzas these have been calculated based on the values for 1 slice and multiplied, so they may be slightly inaccurate: details for a whole pizza were not available from the websites.