I'm trying to get the value of one node in an xml doc as such:
XPathDocument xmlCont = new XPathDocument(Server.MapPath("assets/xml/" +
PageDisplay));
XPathNavigator ContentTitle = xmlCont.CreateNavigator();
ContentTitle.MoveToRoot();
ContentTitle.MoveToFirstChild();
ContentTitle.MoveNext();
PageTitle = ContentTitle.Value;
The xml looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<PageContent>
<h1>The Page Title</h1>
<image>
<path>image.jpg</path>
<id>xxx</id>
<alt>xxx</alt>
<width>xxx</width>
<height>xx</height>
</image>
...
</PageContent>
But PageTitle seems to have every value from every node of the whole xml
document in it. I've tried different things (NodeIterator, calling the
specific node name, etc) but I keep getting the same result. What have I
missed?
XPathDocument xmlCont = new XPathDocument(Server.MapPath("assets/xml/" +
PageDisplay));
XPathNavigator ContentTitle = xmlCont.CreateNavigator();
ContentTitle.MoveToRoot();
ContentTitle.MoveToFirstChild();
ContentTitle.MoveNext();
PageTitle = ContentTitle.Value;
The xml looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<PageContent>
<h1>The Page Title</h1>
<image>
<path>image.jpg</path>
<id>xxx</id>
<alt>xxx</alt>
<width>xxx</width>
<height>xx</height>
</image>
...
</PageContent>
But PageTitle seems to have every value from every node of the whole xml
document in it. I've tried different things (NodeIterator, calling the
specific node name, etc) but I keep getting the same result. What have I
missed?