1 16 19 package org.apache.xalan.processor; 20 21 import org.apache.xalan.templates.NamespaceAlias; 22 import org.xml.sax.Attributes ; 23 24 38 class ProcessorNamespaceAlias extends XSLTElementProcessor 39 { 40 41 57 public void startElement( 58 StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) 59 throws org.xml.sax.SAXException 60 { 61 62 NamespaceAlias na = new NamespaceAlias(handler.nextUid()); 63 64 setPropertiesFromAttributes(handler, rawName, attributes, na); 65 String prefix = na.getStylesheetPrefix(); 66 if(prefix.equals("#default")) 67 { 68 prefix = ""; 69 na.setStylesheetPrefix(prefix); 70 } 71 String stylesheetNS = handler.getNamespaceForPrefix(prefix); 72 na.setStylesheetNamespace(stylesheetNS); 73 prefix = na.getResultPrefix(); 74 if(prefix.equals("#default")) 75 { 76 prefix = ""; 77 na.setResultPrefix(prefix); 78 } 79 String resultNS = handler.getNamespaceForPrefix(prefix); 80 na.setResultNamespace(resultNS); 81 handler.getStylesheet().setNamespaceAlias(na); 82 handler.getStylesheet().appendChild(na); 83 } 84 } 85 | Popular Tags |