mrglavas    2005/02/10 11:11:34

  Modified:    java/src/org/apache/xml/serialize XMLSerializer.java
  Log:
  Fixing JIRA Bug #1043:
  http://issues.apache.org/jira/browse/XERCESJ-1043
  
  Looking up a namespace URI from a NamespaceContext requires that we pass in 
the interned
  String from the SymbolTable as the prefix. We were failing to do that when 
checking for unbound
  prefixes. Should be fixed now.
  
  Revision  Changes    Path
  1.63      +5 -1      
xml-xerces/java/src/org/apache/xml/serialize/XMLSerializer.java
  
  Index: XMLSerializer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/java/src/org/apache/xml/serialize/XMLSerializer.java,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- XMLSerializer.java        14 May 2004 19:37:53 -0000      1.62
  +++ XMLSerializer.java        10 Feb 2005 19:11:34 -0000      1.63
  @@ -1413,6 +1413,8 @@
                            //If a NamespaceURI is not declared for the current
                            //node's prefix, raise a fatal error.
                            String prefix = child.getPrefix();
  +                prefix = (prefix == null || 
  +                        prefix.length() == 0) ? XMLSymbols.EMPTY_STRING : 
fSymbolTable.addSymbol(prefix);
                            if (fNSBinder.getURI(prefix) == null && prefix != 
null) {
                                        fatalError("The replacement text of the 
entity node '" 
                                                                + 
node.getNodeName()  
  @@ -1429,6 +1431,8 @@
                                        for (int i = 0; i< attrs.getLength(); 
i++ ) {
                                                
                                            String attrPrefix = 
attrs.item(i).getPrefix();
  +                        attrPrefix = (attrPrefix == null || 
  +                                attrPrefix.length() == 0) ? 
XMLSymbols.EMPTY_STRING : fSymbolTable.addSymbol(attrPrefix);
                                            if (fNSBinder.getURI(attrPrefix) == 
null && attrPrefix != null) {
                                                        fatalError("The 
replacement text of the entity node '" 
                                                                                
+ node.getNodeName()  
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to