помогите нубу (xml)
От: vvv848165@ya.ru  
Дата: 30.07.19 06:12
Оценка:
не работает ни System.Xml.XPath ни System.Xml.Linq (елементы не находит)

<?xml version="1.0"?>
<root xmlns="urn:schemas-upnp-org:device-1-0" xmlns:microsoft="urn:schemas-microsoft-com:WMPDMR-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<device>
<deviceType>urn:schemas-upnp-org:device:MediaRenderer:1&lt;/deviceType&gt;
<friendlyName>?????????????????????????? (VVVA-106 : Windows Media Player)</friendlyName>
<modelNumber>12</modelNumber>
<modelName>Windows Media Player</modelName>
<modelDescription>Windows Media Player Renderer</modelDescription>
<manufacturer>Microsoft Corporation</manufacturer>
<manufacturerURL>https://www.microsoft.com</manufacturerURL>
<modelURL>https://go.microsoft.com/fwlink/?LinkId=105927&lt;/modelURL&gt;
<serialNumber>{A5E280C7-32C5-4980-9E02-F486600FAAE8}</serialNumber>
<UDN>uuid:1e0f97cf-4dda-4dea-b669-c9fe9d002536</UDN>
<dlna:X_DLNADOC xmlns:dlna="urn:schemas-dlna-org:device-1-0">DMR-1.50</dlna:X_DLNADOC>
<microsoft:magicPacketSendSupported>1</microsoft:magicPacketSendSupported>
<iconList>
<icon>
<mimetype>image/png</mimetype>
<width>48</width>
<height>48</height>
<depth>24</depth>
<url>/upnphost/udhisapi.dll?content=uuid:47cb2695-de68-4ab9-b6bd-c8a8a1f6ffe7</url>
</icon>
<icon>
<mimetype>image/png</mimetype>
<width>120</width>
<height>120</height>
<depth>24</depth>
<url>/upnphost/udhisapi.dll?content=uuid:9ea2cb39-0c99-4020-9f6d-6363bba4a187</url>
</icon>
<icon>
<mimetype>image/jpeg</mimetype>
<width>48</width>
<height>48</height>
<depth>24</depth>
<url>/upnphost/udhisapi.dll?content=uuid:7c024ca6-ab04-42a2-9427-a5bab169b1f5</url>
</icon>
<icon>
<mimetype>image/jpeg</mimetype>
<width>120</width>
<height>120</height>
<depth>24</depth>
<url>/upnphost/udhisapi.dll?content=uuid:be3adb6c-644d-4ccc-b93e-f64f4c6683d6</url>
</icon>
</iconList>
<serviceList>
<service>
<serviceType>urn:schemas-upnp-org:service:RenderingControl:1&lt;/serviceType&gt;
<serviceId>urn:upnp-org:serviceId:RenderingControl&lt;/serviceId&gt;
<controlURL>/upnphost/udhisapi.dll?control=uuid:1e0f97cf-4dda-4dea-b669-c9fe9d002536+urn:upnp-org:serviceId:RenderingControl&lt;/controlURL&gt;
<eventSubURL>/upnphost/udhisapi.dll?event=uuid:1e0f97cf-4dda-4dea-b669-c9fe9d002536+urn:upnp-org:serviceId:RenderingControl&lt;/eventSubURL&gt;
<SCPDURL>/upnphost/udhisapi.dll?content=uuid:dd87d5a3-3199-436a-aa9f-32de62dc8174</SCPDURL>
</service>
<service>
<serviceType>urn:schemas-upnp-org:service:AVTransport:1&lt;/serviceType&gt;
<serviceId>urn:upnp-org:serviceId:AVTransport&lt;/serviceId&gt;
<controlURL>/upnphost/udhisapi.dll?control=uuid:1e0f97cf-4dda-4dea-b669-c9fe9d002536+urn:upnp-org:serviceId:AVTransport&lt;/controlURL&gt;
<eventSubURL>/upnphost/udhisapi.dll?event=uuid:1e0f97cf-4dda-4dea-b669-c9fe9d002536+urn:upnp-org:serviceId:AVTransport&lt;/eventSubURL&gt;
<SCPDURL>/upnphost/udhisapi.dll?content=uuid:9cb31b41-5ded-4e41-bd6f-badbc7e0bf61</SCPDURL>
</service>
<service>
<serviceType>urn:schemas-upnp-org:service:ConnectionManager:1&lt;/serviceType&gt;
<serviceId>urn:upnp-org:serviceId:ConnectionManager&lt;/serviceId&gt;
<controlURL>/upnphost/udhisapi.dll?control=uuid:1e0f97cf-4dda-4dea-b669-c9fe9d002536+urn:upnp-org:serviceId:ConnectionManager&lt;/controlURL&gt;
<eventSubURL>/upnphost/udhisapi.dll?event=uuid:1e0f97cf-4dda-4dea-b669-c9fe9d002536+urn:upnp-org:serviceId:ConnectionManager&lt;/eventSubURL&gt;
<SCPDURL>/upnphost/udhisapi.dll?content=uuid:d037d01f-7197-4b97-b437-0a6c9b547a2e</SCPDURL>
</service>
</serviceList>
</device>
</root>


        WebRequest wr=WebRequest.Create(list_serv[i].Location_destUrl);
                Stream XmlData=wr.GetResponse().GetResponseStream();//xml в ASCII ПРИВЕДЁН ВЫШЕ
                XDocument doc = XDocument.Load(XmlData);
                XElement nodeRoot = doc.Element("device");// всегда возвращает null чтобы не подставил  вместо "device"
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.