AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

xml file erstellen

Ein Thema von khh · begonnen am 22. Jun 2015 · letzter Beitrag vom 24. Jun 2015
 
khh

Registriert seit: 18. Apr 2008
Ort: Südbaden
1.903 Beiträge
 
FreePascal / Lazarus
 
#9

AW: xml file erstellen

  Alt 22. Jun 2015, 17:59
alsooo

mit TXMLDocument habe ich jetzt eine Datei erzeugt.

so
Delphi-Quellcode:
  pfad := 'C:\temp2\test2.xml';
    Doc := TXMLDocument.Create;
    Doc.XMLVersion:= '1.0';
    WriteXMLFile(Doc, pfad);
bekomme ich eine Zeile in das File:
<?xml version="1.0" encoding="UTF-8"?> immerhin etwas


aber wie bekomme ich meine Excelstruktur:

Delphi-Quellcode:
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40">
  <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
    <Author>ich</Author>
    <LastAuthor>ich</LastAuthor>
    <Created>2012-02-01T12:31:29Z</Created>
    <Version>15.00</Version>
  </DocumentProperties>
  <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
    <AllowPNG />
  </OfficeDocumentSettings>
  <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
    <WindowHeight>12435</WindowHeight>
    <WindowWidth>28800</WindowWidth>
    <WindowTopX>0</WindowTopX>
    <WindowTopY>0</WindowTopY>
    <ProtectStructure>False</ProtectStructure>
    <ProtectWindows>False</ProtectWindows>
  </ExcelWorkbook>
  <Styles>
...

...
....
Die Beispiele die ich gefunden habe, erzeugen mir so was:
Delphi-Quellcode:
<?xml version="1.0"?>
<Root>
  <Element id="1">
    <Item1 Attr1="1" Attr2="1">Item1Value is 1</Item1>
    <Item2 Attr1="1" Attr2="1">Item2Value is 1</Item2>
  </Element>
  <Element id="2">
    <Item1 Attr1="2" Attr2="2">Item1Value is 2</Item1>
    <Item2 Attr1="2" Attr2="2">Item2Value is 2</Item2>
  </Element>
  <Element id="3">
    <Item1 Attr1="3" Attr2="3">Item1Value is 3</Item1>
    <Item2 Attr1="3" Attr2="3">Item2Value is 3</Item2>
  </Element>
</Root>
das sieht zwar schon mal wie ein xml-File aus, aber noch lange nicht so, wie ich meine (Excel-) Datei haben möchte. Gibt es irgendwo brauchbare Beispiele ?

Ich danke euch
Karl-Heinz
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:24 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz