Source code: com/flexstor/flexdbserver/services/asset/XMLfilter.java
1 /*
2 * XMLfilter.java
3 *
4 * Copyright $Date: 2003/08/11 02:22:28 $ FLEXSTOR.net Inc.
5 *
6 * This work is licensed for use and distribution under license terms found at
7 * http://www.flexstor.org/license.html
8 *
9 */
10
11 package com.flexstor.flexdbserver.services.asset;
12
13 import org.w3c.dom.Node;
14 import org.w3c.dom.traversal.NodeFilter;
15
16 /**
17 *
18 * @author bparks
19 * @version initial
20 */
21 public class XMLfilter implements NodeFilter {
22
23 public short acceptNode( Node n ) {
24 // If this is a TEXT_NODE, we will check it for size and possibly skip it.
25 if ( n.getNodeType() == Node.TEXT_NODE ) {
26 if ( n.getNodeValue().trim().equals("") ) {
27 return FILTER_SKIP;
28 }
29 }
30 return FILTER_ACCEPT;
31 }
32
33 }