cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ondrej Scecina <...@force.sk>
Subject StaxUtils
Date Mon, 14 Mar 2011 17:13:30 GMT
Hi

Sorry for this post, but I don't know where to report a bug. Maybe someone
already did this before. Code is simple.

public final class StaxUtils {

    public static void readDocElements(Document doc, Node parent,
                                       XMLStreamReader reader, boolean repairing, boolean
recordLoc, 
                                       boolean isThreshold)
        throws XMLStreamException {
        Stack<Node> stack = new Stack<Node>();
        int event = reader.getEventType();
        int elementCount = 0;
        while (reader.hasNext()) {
            switch (event) {
            case XMLStreamConstants.START_ELEMENT: {
                elementCount++;
                Element e = doc.createElementNS(reader.getNamespaceURI(), reader.getLocalName());
-               if (reader.getPrefix()) {
+               if (reader.getPrefix() != null && reader.getPrefix().length() >
0) {
                    e.setPrefix(reader.getPrefix());
                }       

Mime
View raw message