Hallo
ich versuche ein kleines
XML auszuwerten, kriges einfach nicht auf die Reihe...
XML: (CurrentTrackMetadata)
Code:
<DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:
dc="http://purl.org/
dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">
<item>
<
dc:title>Elvin Sir Jones</
dc:title>
<upnp:artist>McCoy Tyner</upnp:artist>
<upnp:album>Trident</upnp:album>
<res duration="0:05:22" protocolInfo="http-get:*:audio/mpeg:*">http://192.168.1.100:9000/disk/DLNA-PNMP3-OP01-FLAGS01700000/music/O0$1$7I15333/Elvin%20Sir%20Jones.mp3</res>
</item>
</DIDL-Lite>
Script:
Code:
Procedure TAVTransportService.SplitTrackMetadata;
VAR ItemNode, Itemnode2 : IXMLNode;
XMLDoc:TXMLDocument;
i,j : integer;
begin
XMLDoc:=TXMLDocument.Create(nil);
XMLDoc.Active:=false;
XMLDoc.LoadFromXML(CurrentTrackMetadata);
XMLDoc.Active:=True;
//ItemNode := XMLDoc.DocumentElement.ParentNode; //Item Parent oder Document ???
ItemNode := xmlDoc.DocumentElement;
for I := 0 to ItemNode.ChildNodes.Count-1 do begin
Itemnode2 := ItemNode.ChildNodes[i];
if (ItemNode2.GetNodeName = 'upnp:album') and (itemNode2.Text > '') then begin
Playalbum := itemNode2.Text;
end;
if (ItemNode2.GetNodeName = 'upnp:artist') and (itemNode2.Text > '') then begin
Playartist := itemNode2.Text;
end;
end;
XMLDoc.Free;
end;
Bin am verzweifeln...