.net function does not append in a xml object
1 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
I am trying to create a powerpoint document in Matlab using openXML SDK 2.5. It is going well so far, but an office presentation require a "slideidlist" to be append (which is just to add sibling node in the xml). I do not understand why the function does nothing, no eror, no result.
Any of you have experienced that behaviour with .NET function?
Thank you,
%Declare
NET.addAssembly('C:\Program Files (x86)\Open XML SDK\V2.5\lib\DocumentFormat.OpenXml.dll')
NET.addAssembly('System.Xml')
NET.addAssembly('System.IO')
NET.addAssembly('System.Collections')
%Open doc (with 0 slide, just a master)
type=DocumentFormat.OpenXml.Packaging.PresentationDocument;
docP=type.Open('c:\local\test4.pptx',true);
% Add SlideIdList to empty doc
docP.PresentationPart.Presentation.SlideIdList=...
DocumentFormat.OpenXml.Presentation.SlideIdList;
slideId=DocumentFormat.OpenXml.Presentation.SlideId;
slideId.Id = DocumentFormat.OpenXml.UInt32Value('65487545654'); %any value
slideIdList=docP.PresentationPart.Presentation.SlideIdList;
%Try to append, but no error, not on the resulting XML either. Haschildren still 0
slideIdList.Append(slideId)
1 个评论
Adam Barber
2015-8-11
Hi Johan,
I was not able to get this to work either. I spent a bit of time looking at this page from Microsoft:
to see how the API is used there. I think it may be helpful to contact them to see how the API needs to be used to accomplish what you are doing.
Keep in mind that MATLAB has the following limitations when supporting .NET:
This does not seem to be violating any of the limitations, but its helpful to keep in mind when contacting Microsoft.
Best of luck,
-Adam
回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!