Borrar filtros
Borrar filtros

.net function does not append in a xml object

2 visualizaciones (últimos 30 días)
Johan
Johan el 7 de Ag. de 2015
Comentada: Adam Barber el 11 de Ag. de 2015
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 comentario
Adam Barber
Adam Barber el 11 de Ag. de 2015
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

Iniciar sesión para comentar.

Respuestas (0)

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by