|
|
XML processing instruction / DTD mit xmlwrite |
|
haraldStefan |
Gast
|
 |
Beiträge: ---
|
 |
|
 |
Anmeldedatum: ---
|
 |
|
 |
Wohnort: ---
|
 |
|
 |
Version: ---
|
 |
|
|
 |
|
Verfasst am: 05.05.2010, 10:24
Titel: XML processing instruction / DTD mit xmlwrite
|
 |
Hi,
für meine XML-Datei habe ich ein kleines Stylesheet geschrieben, welches mir den Inhalt der Datei schön darstellt.
Das Problem ist aber, dass mich xmlwrite() einfach nicht die Zeilen <!DOCTYPE myRoot SYSTEM "foo.dtd"> und <?xml-stylesheet href="style.css" type="text/css"?> einfügen lässt.
Minimalbeispiel:
liefert
Wie kann ich zwischen erster und zweiter Zeile etwas reinschreiben? Aussehen soll das ganze dann:
Folgende hab ich schon probiert, aber das geht leider nicht:
Hat jemand eine Idee?
|
|
|
|
|
haraldStefan |
Gast
|
 |
Beiträge: ---
|
 |
|
 |
Anmeldedatum: ---
|
 |
|
 |
Wohnort: ---
|
 |
|
 |
Version: ---
|
 |
|
|
 |
|
Verfasst am: 05.05.2010, 22:41
Titel: Berlin
|
 |
*pushing* hat wirklich keiner eine Idee?
Gruß
|
|
|
jacky9876 |
Gast
|
 |
Beiträge: ---
|
 |
|
 |
Anmeldedatum: ---
|
 |
|
 |
Wohnort: ---
|
 |
|
 |
Version: ---
|
 |
|
|
 |
|
Verfasst am: 15.11.2012, 12:58
Titel: matlab insert style sheet information
|
 |
|
 |
|
function saveToXml
% Create a XML document.
docNode = com.mathworks.xml.XMLUtils.createDocument('myRoot');
%proc = docNode.createProcessingInstruction('instruction');
%docNode.insertBefore(proc, docNode.getFirstChild());
%docNode.appendChild(docNode.createComment('this is a comment'));
%docNode.PROCESSING_INSTRUCTION = 'xml-stylesheet type="a" href="foo"';
docRootNode = docNode.getDocumentElement;
style = docNode.createProcessingInstruction('xml-stylesheet', 'type=text/xsl href=plausibility.xsl');
docNode.insertBefore(style, docRootNode);
% save aTest
tmp = docNode.createElement('aTest');
tmp.setAttribute('size', '1');
tmp.appendChild(docNode.createTextNode('content'));
docRootNode.appendChild(tmp);
%docNode.appendChild(docNode.createComment('Automatically generated by structural analysis toolbox.'));
% Save the XML document.
%xmlFileName = uiputfile(sprintf('%s.xml', 'systemDescription'), 'Save XML file as');
xmlwrite('foo.xml',docNode);
edit('foo.xml');
end %function
|
|
|
|
|
Einstellungen und Berechtigungen
|
|
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
|
|
Impressum
| Nutzungsbedingungen
| Datenschutz
| FAQ
| RSS
Hosted by:
Copyright © 2007 - 2025
goMatlab.de | Dies ist keine offizielle Website der Firma The Mathworks
MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.
|
|