Free Support Forum - aspose.com

"System.InvalidOperationException: Unexpected parent of the id attribute." when trying to manipulate word doc

Hi,

When I attempt to load and remove comments from the attached file, I get the following exception.

Any help you could give would be greatly appreciated!

Aspose.Words.FileCorruptedException: The document appears to be corrupted and cannot be loaded. —> System.InvalidOperationException: Unexpected parent of the id attribute.
at xf84318f571847613.x8f22b0507bb6c621.x984a74325be15ae5(XmlDocument x5510939d5b9dcd91, x40136e0b18d3d4d5 x1dc2f2327607c9b8, String x7e81152f4b5e4c64)
at xf84318f571847613.x8f22b0507bb6c621.x4d79c72fc0d767df(XmlDocument x5510939d5b9dcd91)
at xf84318f571847613.x8f22b0507bb6c621.xffe8719b6d87d067()
at xf84318f571847613.x8f22b0507bb6c621.x9c4d396732496cb5(Boolean x97e9ca64b26f19c5)
at xf84318f571847613.x8f22b0507bb6c621.x8809397b7abf7718(WrapType x1b33630b689cfddb)
at xf84318f571847613.x8f22b0507bb6c621.xd41ddc432f1bf535(x11e1346c12ead315 xe134235b3526fa75)
at x79490184cecf12a1.x11e1346c12ead315.x5ec6421d09860bef(xeedad81aaed42a76 x789564759d365819)
at x1495530f35d79681.x90c7969a84762ddd.x46414487ffde0726(xdfce7f4f687956d7 xe134235b3526fa75, xeedad81aaed42a76 x789564759d365819)
at x1495530f35d79681.x90c7969a84762ddd.x19f61333b2e4b4ee(xdfce7f4f687956d7 xe134235b3526fa75, xeedad81aaed42a76 x789564759d365819)
at x1495530f35d79681.x90c7969a84762ddd.x90f88ef6f3bea229(xdfce7f4f687956d7 xe134235b3526fa75, xeedad81aaed42a76 x789564759d365819)
at x1495530f35d79681.x90c7969a84762ddd.x44ea761ba7ed7dbe(xdfce7f4f687956d7 xe134235b3526fa75, xeedad81aaed42a76 x789564759d365819)
at x1495530f35d79681.x90c7969a84762ddd.x19f61333b2e4b4ee(xdfce7f4f687956d7 xe134235b3526fa75, xeedad81aaed42a76 x789564759d365819)
at x1495530f35d79681.x90c7969a84762ddd.x06b0e25aa6ad68a9(xdfce7f4f687956d7 xe134235b3526fa75)
at x79490184cecf12a1.x5ab4843b5e9c9f8d.x152cbadbfa8061b1(xdfce7f4f687956d7 xe134235b3526fa75)
at x79490184cecf12a1.xf32efa9aef6963ce.x06b0e25aa6ad68a9(xdfce7f4f687956d7 xe134235b3526fa75)
at x79490184cecf12a1.xce4dd62ad1252b05.x152cbadbfa8061b1(xdfce7f4f687956d7 xe134235b3526fa75)
at x79490184cecf12a1.x11e1346c12ead315.x2dc551ee28d58aab(DocumentBase x6beba47238e0ade6)
at x79490184cecf12a1.xa52ef41af20225f0.x748a2047fcb706ad()
at x79490184cecf12a1.xa52ef41af20225f0.DoRead()
at x79490184cecf12a1.x11e1346c12ead315.x06b0e25aa6ad68a9()
at x79490184cecf12a1.xae13d15563a3a703.x06b0e25aa6ad68a9()
at Aspose.Words.Document.x5d4db34d48fb3129(Stream xcf18e5243f8d5fd3, LoadOptions x27aceb70372bde46)
— End of inner exception stack trace —
at Aspose.Words.Document.x5d4db34d48fb3129(Stream xcf18e5243f8d5fd3, LoadOptions x27aceb70372bde46)
at Aspose.Words.Document.x5d95f5f98c940295(Stream xcf18e5243f8d5fd3, LoadOptions x27aceb70372bde46)

Hi Paul,


Thanks for your inquiry. I have tested the scenario and have not found any exception while using latest version of Aspose.Words for .NET. Please use the latest version of Aspose.Words for .NET. I have not found any comments in attached document.


<span style=“font-family:“Courier New”;
color:green;mso-ansi-language:PL;mso-no-proof:yes”>// The document that the
content will be appended to.<o:p></o:p>

Document doc = new Document(MyDir + "Veeco+Rental+Agreement+(1).docx");

// Collect all comments in the document

NodeCollection comments = doc.GetChildNodes(NodeType.Comment, true);

// Remove all comments.

comments.Clear();

doc.Save(MyDir + "AsposeOut.docx");

Please let us know if you have any more queries.

Hi,


I have a similar problem with the attached document.
Can you help me?

var docx = new Document(fn);

System.InvalidOperationException: Unexpected parent of the id attribute.
w xf84318f571847613.x8f22b0507bb6c621.x984a74325be15ae5(XmlDocument x5510939d5b9dcd91, x40136e0b18d3d4d5 x1dc2f2327607c9b8, String x7e81152f4b5e4c64)
w xf84318f571847613.x8f22b0507bb6c621.x4d79c72fc0d767df(XmlDocument x5510939d5b9dcd91)
w xf84318f571847613.x8f22b0507bb6c621.xffe8719b6d87d067()
w xf84318f571847613.x8f22b0507bb6c621.x9c4d396732496cb5(Boolean x97e9ca64b26f19c5)
w xf84318f571847613.x8f22b0507bb6c621.x8809397b7abf7718(WrapType x1b33630b689cfddb)
w xf84318f571847613.x8f22b0507bb6c621.xd41ddc432f1bf535(x11e1346c12ead315 xe134235b3526fa75)
w x79490184cecf12a1.x11e1346c12ead315.x5ec6421d09860bef(xeedad81aaed42a76 x789564759d365819)
w x1495530f35d79681.x90c7969a84762ddd.x07932593320d7b76(xdfce7f4f687956d7 xe134235b3526fa75, xeedad81aaed42a76 x789564759d365819)
w x1495530f35d79681.x90c7969a84762ddd.x46414487ffde0726(xdfce7f4f687956d7 xe134235b3526fa75, xeedad81aaed42a76 x789564759d365819)
w x1495530f35d79681.x90c7969a84762ddd.x19f61333b2e4b4ee(xdfce7f4f687956d7 xe134235b3526fa75, xeedad81aaed42a76 x789564759d365819)
w x1495530f35d79681.x90c7969a84762ddd.x90f88ef6f3bea229(xdfce7f4f687956d7 xe134235b3526fa75, xeedad81aaed42a76 x789564759d365819)
w x1495530f35d79681.x90c7969a84762ddd.x44ea761ba7ed7dbe(xdfce7f4f687956d7 xe134235b3526fa75, xeedad81aaed42a76 x789564759d365819)
w x1495530f35d79681.x90c7969a84762ddd.x19f61333b2e4b4ee(xdfce7f4f687956d7 xe134235b3526fa75, xeedad81aaed42a76 x789564759d365819)
w x1495530f35d79681.x90c7969a84762ddd.x06b0e25aa6ad68a9(xdfce7f4f687956d7 xe134235b3526fa75)
w x79490184cecf12a1.x5ab4843b5e9c9f8d.x152cbadbfa8061b1(xdfce7f4f687956d7 xe134235b3526fa75)
w x79490184cecf12a1.xf32efa9aef6963ce.x06b0e25aa6ad68a9(xdfce7f4f687956d7 xe134235b3526fa75)
w x79490184cecf12a1.xce4dd62ad1252b05.x152cbadbfa8061b1(xdfce7f4f687956d7 xe134235b3526fa75)
w x1495530f35d79681.x9306bb5271b301f2.x06b0e25aa6ad68a9(xdfce7f4f687956d7 xe134235b3526fa75)
w x79490184cecf12a1.x81e625161048fd10.x152cbadbfa8061b1(xdfce7f4f687956d7 xe134235b3526fa75, xedb0eb766e25e0c9 x0d9383c33dfa78ca)
w x79490184cecf12a1.x81e625161048fd10.x6a5b9e9e63b563c8(xdfce7f4f687956d7 xe134235b3526fa75, xedb0eb766e25e0c9 x0d9383c33dfa78ca)
w x79490184cecf12a1.x81e625161048fd10.x06b0e25aa6ad68a9(xdfce7f4f687956d7 xe134235b3526fa75, xedb0eb766e25e0c9 xe193ceb565ecaa0a)
w x79490184cecf12a1.x22063a019e9be4a2.x152cbadbfa8061b1(xdfce7f4f687956d7 xe134235b3526fa75, xedb0eb766e25e0c9 xe193ceb565ecaa0a)
w x79490184cecf12a1.x22063a019e9be4a2.x6a5b9e9e63b563c8(xdfce7f4f687956d7 xe134235b3526fa75, xedb0eb766e25e0c9 xe193ceb565ecaa0a)
w x79490184cecf12a1.x22063a019e9be4a2.x06b0e25aa6ad68a9(xdfce7f4f687956d7 xe134235b3526fa75)
w x79490184cecf12a1.xce4dd62ad1252b05.x152cbadbfa8061b1(xdfce7f4f687956d7 xe134235b3526fa75)
w x79490184cecf12a1.x11e1346c12ead315.x2dc551ee28d58aab(DocumentBase x6beba47238e0ade6)
w x79490184cecf12a1.xa52ef41af20225f0.x748a2047fcb706ad()
w x79490184cecf12a1.xa52ef41af20225f0.DoRead()
w x79490184cecf12a1.x11e1346c12ead315.x06b0e25aa6ad68a9()
w x79490184cecf12a1.xae13d15563a3a703.x748a2047fcb706ad()
w x79490184cecf12a1.xae13d15563a3a703.x06b0e25aa6ad68a9()
w Aspose.Words.Document.x5d4db34d48fb3129(Stream xcf18e5243f8d5fd3, LoadOptions x27aceb70372bde46)
— Koniec śladu stosu wyjątków wewnętrznych —
w Aspose.Words.Document.x5d4db34d48fb3129(Stream xcf18e5243f8d5fd3, LoadOptions x27aceb70372bde46)
w Aspose.Words.Document.x5d95f5f98c940295(Stream xcf18e5243f8d5fd3, LoadOptions x27aceb70372bde46)
w Aspose.Words.Document…ctor(String fileName, LoadOptions loadOptions)
w Aspose.Words.Document…ctor(String fileName)
Hi Ryszard,

Thanks for your inquiry. I have managed to reproduce the same issue at my side. I have logged this issue as WORDSNET-7151 in our issue tracking system. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-7151) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.