AGB  ·  Datenschutz  ·  Impressum  







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

XMLDocument xml lesen

Ein Thema von Pfaffe · begonnen am 22. Jul 2020 · letzter Beitrag vom 23. Jul 2020
 
Pfaffe

Registriert seit: 29. Jan 2009
297 Beiträge
 
Delphi 12 Athens
 
#1

XMLDocument xml lesen

  Alt 22. Jul 2020, 21:26
Folgende XML habe ich:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<masterdata exporttime="2020-07-22 10:55:57">
   <language shortcut="deu_DEU" target_language="nld_NLD">
      <dictionaries>
         <dictionary_entry id="16585" translation="1" dict_shortcut="" upperlower="DictionaryMetadataULNotUsed" singularplural="DictionaryMetadataSPNotUsed" inactive="0" is_formula="0">
            <dict_value>
               <p>das will ich haben</p>
            </dict_value>
usw.
So habe ich es probiert:
Delphi-Quellcode:
XMLDocument1.LoadFromFile(dateiname);
XMLDocument1.Active:= true;
LNodeElement1:= XMLDocument1.ChildNodes.FindNode('masterdata').ChildNodes.FindNode('language').ChildNodes.FindNode('dictionaries');
if LNodeElement1 <> nil then
  begin
    for i:= 0 to 10 do // LNodeElement1.ChildNodes.Count - 1 do
      begin
        LNodeElement2:= LNodeElement1.ChildNodes.Get(i);
        id:= LNodeElement2.Attributes['id'];
        LNodeElement3:= LNodeElement2.ChildNodes.FindNode('dict_value');
        dict_value:= LNodeElement3.???; // <---
        Memo1.Lines.Add(id + ': ' + dict_value);
      end;
  end;
XMLDocument1.Active:= false;
Wie komme ich an "das will ich haben"?
  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 21:59 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz