![]() |
HasAttributes liefert False, obwohl Attribut vorhanden
Folgende XML:
XML-Code:
Und kein Code:
<?xml version="1.0" encoding="UTF-8"?>
<businessRelationship id="1"> <businessSupplier id="1">
Code:
Warum liefert if (_nav.HasAttributes) false, obwohl ein Attribut vorhanden ist?
public void Load(string BRFile)
{ _xmlFile = BRFile; try { _pathDocument = new XPathDocument(_xmlFile); XPathNavigator _nav = _pathDocument.CreateNavigator(); if (_nav.SelectSingleNode("businessRelationship") != null) { if (_nav.HasAttributes) { } } _bsi = new BusinessSupplierItem(_pathDocument); _bsi.GetDetails(); } catch (Exception e) { throw (e); } } |
Re: HasAttributes liefert False, obwohl Attribut vorhanden
Dass SelectSingleNode null zurück gibt, wenn der Knoten nicht vorhanden ist, hast du ja erkannt. Was aber bekommst du zurück, wenn der Knoten vorhanden ist :zwinker: ?
[edit]Knoten <-> Konten, wirklich nicht einfach... [/edit] |
Re: HasAttributes liefert False, obwohl Attribut vorhanden
Ich glaube, ich weiß, was ich falsch mache. danke für den Hinweis.
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:37 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-2025 by Thomas Breitkreuz