src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2SAX.java
changeset 47359 e1a6c0168741
parent 47216 71c04702a3d5
child 48409 5ab69533994b
equal deleted inserted replaced
47358:d07d5f7cab35 47359:e1a6c0168741
     1 /*
     1 /*
     2  * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
       
     3  * @LastModified: Oct 2017
     3  */
     4  */
     4 /*
     5 /*
     5  * Licensed to the Apache Software Foundation (ASF) under one or more
     6  * Licensed to the Apache Software Foundation (ASF) under one or more
     6  * contributor license agreements.  See the NOTICE file distributed with
     7  * contributor license agreements.  See the NOTICE file distributed with
     7  * this work for additional information regarding copyright ownership.
     8  * this work for additional information regarding copyright ownership.
    23 import com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl;
    24 import com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl;
    24 import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
    25 import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
    25 import java.io.IOException;
    26 import java.io.IOException;
    26 import java.util.ArrayList;
    27 import java.util.ArrayList;
    27 import java.util.HashMap;
    28 import java.util.HashMap;
       
    29 import java.util.List;
    28 import java.util.Map;
    30 import java.util.Map;
    29 import java.util.Stack;
    31 import java.util.Stack;
    30 import org.w3c.dom.NamedNodeMap;
    32 import org.w3c.dom.NamedNodeMap;
    31 import org.w3c.dom.Node;
    33 import org.w3c.dom.Node;
    32 import org.xml.sax.ContentHandler;
    34 import org.xml.sax.ContentHandler;
   101                     pushed = false;
   103                     pushed = false;
   102                 }
   104                 }
   103             }
   105             }
   104         } else {
   106         } else {
   105             _sax.startPrefixMapping(prefix, uri);
   107             _sax.startPrefixMapping(prefix, uri);
   106             _nsPrefixes.put(prefix, uriStack = new Stack());
   108             _nsPrefixes.put(prefix, uriStack = new Stack<>());
   107             uriStack.push(uri);
   109             uriStack.push(uri);
   108         }
   110         }
   109         return pushed;
   111         return pushed;
   110     }
   112     }
   111 
   113 
   192             }
   194             }
   193             _sax.endDocument();
   195             _sax.endDocument();
   194             break;
   196             break;
   195         case Node.ELEMENT_NODE:
   197         case Node.ELEMENT_NODE:
   196             String prefix;
   198             String prefix;
   197             ArrayList<String> pushedPrefixes = new ArrayList<>();
   199             List<String> pushedPrefixes = new ArrayList<>();
   198             final AttributesImpl attrs = new AttributesImpl();
   200             final AttributesImpl attrs = new AttributesImpl();
   199             final NamedNodeMap map = node.getAttributes();
   201             final NamedNodeMap map = node.getAttributes();
   200             final int length = map.getLength();
   202             final int length = map.getLength();
   201 
   203 
   202             // Process all namespace declarations
   204             // Process all namespace declarations