Einzelnen Beitrag anzeigen

Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#1

HasAttributes liefert False, obwohl Attribut vorhanden

  Alt 2. Jun 2008, 11:24
Folgende XML:
XML-Code:
<?xml version="1.0" encoding="UTF-8"?>
<businessRelationship id="1">
    <businessSupplier id="1">
Und kein Code:
Code:
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);
            }
        }
Warum liefert if (_nav.HasAttributes) false, obwohl ein Attribut vorhanden ist?
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat