I have an xml file tagged with namespaces:
for example, ce:section, ce:para
i just trying to collect the 'ce:floats' xml nodes by using the following code:
//Defining the Namespace in the array of arrays of 2 strings
Dim NmSpArr(,) As String = {{“sb”, “https://www.elsevier.com/xml/common/struct-bib/dtd”}, {“cl”, “https://xml.cengage-learning.com/cendoc-core”}, {“ce”, “https://www.elsevier.com/xml/common/dtd”}, {“aid”, “https://ns.adobe.com/AdobeInDesign/4.0/”}, {“aid5”, “https://ns.adobe.com/AdobeInDesign/5.0/”}, {“xmlns:xsi”, “https://www.w3.org/2001/XMLSchema-instance”}, {“xmlns:mml”, “https://www.w3.org/1998/Math/MathML”}, {“xmlns:xlink”, “https://www.w3.org/1999/xlink”}}
//Trying to collect the 'ce:floats'
Dim obj As InDesign.Objects = IndDoc.XMLElements(1).EvaluateXPathExpression(“//ce:floats”, NmSpArr)
ID CS4
Vb.net
Above code always returning 0 as count. It seems there is problem with the xml namespaces definition.
It is working for the xml which doesn't have namespaces. For example, book; author; price.
When it comes to namespaces only it is not working. For example, ce:book; ce:author; ce:price
Any help?