Cottleston Pie

Fernando Felman’s thoughts on software development

Using XPath with Namespaces » Fetch URI from Xml Node

Fetch URI from Xml Node

// load the xml document with the sample InfoPath content
XmlDocument doc = new XmlDocument();
doc.LoadXml(xmlContent);

// the ‘my’ prefix is defined in the root element,
// so get it from there
XmlNode root = doc.DocumentElement;
string infoPathNsUri = root.GetNamespaceOfPrefix(“my”);
string infoPathNsPrefix = “infoPath”; // will be used in the xpath

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.