How can I get node from Bxml file.

J

JuneTheSecond

I can not get xmlNode from visio xml file.
Dim sPath As String =/VisioDocument/Pages/Page/Shapes/Shape
Dim node As XmlNode = xmlDoc.SelectNodes(sPath).Item(0)
SelectNodes method returns always nothing.
How can I get xml node?
xmlDoc is vdx file made from Visio drawing
that has just one simple rectangle.

I've got correct xml node in other simple xml
example for xml beginners.
Thanks for any idea.
 
J

JuneTheSecond

Sorry, I've got node defining prefix.
Something like this.
Dim nsmgr As XmlNamespaceManager = New XmlNamespaceManager(xmlDoc.NameTable)
nsmgr.AddNamespace("pf", "http://schemas.microsoft.com/visio/2003/core")
Dim sPath = /pf:VisioDocument/pf:pages/pf:page/pf:Shapes/pf:Shape
Dim nodelist As XmlNodeList = xmlDoc.SelectNodes(sPath.Text, nsmgr)
Dim node As XmlNode = xmlDoc.SelectNodes(sPath.Text, nsmgr).Item(txIndex.Text)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top