.net function does not append in a xml object
조회 수: 4 (최근 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개)
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Compiler SDK에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!