Changeset 1585 for trunk/docx4j/src/main/java
- Timestamp:
- 07/03/11 08:47:39 (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docx4j/src/main/java/org/docx4j/XmlUtils.java
r1579 r1585 81 81 private static Logger log = Logger.getLogger(XmlUtils.class); 82 82 83 // See http://www.edankert.com/jaxpimplementations.html for 84 // a helpful list. 83 85 84 86 public static String TRANSFORMER_FACTORY_ORIGINAL; … … 864 866 for( Node n : xpath(node, xpathExpr) ) { 865 867 Object o = binder.getJAXBNode(n); 866 if (o==null) 867 System.out.println("no association"); 868 else resultList.add(o); 868 if (o==null) { 869 log.warn("no object association for xpath result!"); 870 } else { 871 if (o instanceof javax.xml.bind.JAXBElement) { 872 log.warn("added " + JAXBElementDebug((JAXBElement)o) ); 873 } else { 874 log.warn("added " + o.getClass().getName() ); 875 } 876 resultList.add(o); 877 } 869 878 } 870 879 return resultList; … … 882 891 883 892 public static List<Node> xpath(Node node, String xpathExpression, NamespaceContext nsContext) { 893 894 // log.info("Using XPathFactory: " + XPathFactory.DEFAULT_PROPERTY_NAME + ": " 895 // + System.getProperty(XPathFactory.DEFAULT_PROPERTY_NAME)); 896 // System.setProperty(XPathFactory.DEFAULT_PROPERTY_NAME, 897 // "org.apache.xpath.jaxp.XPathFactoryImpl"); 898 884 899 // create XPath 885 900 XPathFactory xpf = XPathFactory.newInstance(); … … 891 906 List<Node> result = new ArrayList<Node>(); 892 907 NodeList nl = (NodeList) xpath.evaluate(xpathExpression, node, XPathConstants.NODESET); 893 for( int i=0; i<nl.getLength(); i++ ) 908 log.warn("evaluate returned " + nl.getLength() ); 909 for( int i=0; i<nl.getLength(); i++ ) { 894 910 result.add(nl.item(i)); 911 } 895 912 return result; 896 913 } catch (XPathExpressionException e) {
Note: See TracChangeset
for help on using the changeset viewer.
