empty xpath evaluations on add-on deployment
Posted: Fri Jul 10, 2015 5:15 pm
Hi,
I have developed a plugin and framework I want to push as add-ons on our website.
The plugin works perfectly on my mac, in debug mode in eclipse and in direct mode after compiling the jar.
I use a laptop on which I have downloaded a trial version of oxygen author to check the add-on deployment.
The deployment itself is ok but I have a strange problem :
xpath evaluations find nodes on my development machine (in debug mode in eclipse as in direct mode) and return an empty set on the laptop.
I have checked on the laptop the xml file (an xml schema actually) is found, it is readable, it is not empty.
I can access it with getElementsByTagName, I have added a message to display the count of nodes found by xpath evaluate and by getElementsByTagName, it is allways (0, 677) on the laptop and (34, 677) on my pc.
Here is what I do :
I have no error message or warning of any kind.
I have checked the java versions, the problem is the same in java 1.6 or in java 1.8.
What else can I check ?
Best regards,
Lionel
I have developed a plugin and framework I want to push as add-ons on our website.
The plugin works perfectly on my mac, in debug mode in eclipse and in direct mode after compiling the jar.
I use a laptop on which I have downloaded a trial version of oxygen author to check the add-on deployment.
The deployment itself is ok but I have a strange problem :
xpath evaluations find nodes on my development machine (in debug mode in eclipse as in direct mode) and return an empty set on the laptop.
I have checked on the laptop the xml file (an xml schema actually) is found, it is readable, it is not empty.
I can access it with getElementsByTagName, I have added a message to display the count of nodes found by xpath evaluate and by getElementsByTagName, it is allways (0, 677) on the laptop and (34, 677) on my pc.
Here is what I do :
Code: Select all
String xpathstring = "//xs:enumeration[@value='no']"; // can be any xpath
String xsdSchemaUri = frameworkPath.concat(ROUTARD_URL.XSD_SCHEMA);;
DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder;
XPathExpression expr;
XPath xpath = XPathFactory.newInstance().newXPath();
Document xmlfile;
try {
builder = domFactory.newDocumentBuilder();
xmlfile = builder.parse(xsdSchemaUri);
} catch (ParserConfigurationException e) {
...
}
try {
expr = xpath.compile(xpathstring);
NodeList nodesTEST = xmlfile.getElementsByTagName("xs:element");
NodeList nodes = (NodeList) expr
.evaluate(xmlfile, XPathConstants.NODESET);
pluginWorkspaceAccess.showErrorMessage(xsdSchemaUri + "\n"
+ Integer.toString(nodes.getLength()) + "\n"
+ Integer.toString(nodesTEST.getLength()));
...
}
I have checked the java versions, the problem is the same in java 1.6 or in java 1.8.
What else can I check ?
Best regards,
Lionel