From: Wolfgang M. M. <wol...@us...> - 2004-08-08 19:03:34
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv796/src/org/exist/xquery Modified Files: XQuery.java ElementConstructor.java Log Message: Fixed wrong handling of default namespaces, introduced by my previous changes. Index: XQuery.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/XQuery.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** XQuery.java 7 Aug 2004 16:28:02 -0000 1.3 --- XQuery.java 8 Aug 2004 19:03:26 -0000 1.4 *************** *** 84,88 **** AST ast = parser.getAST(); ! LOG.debug("Generated AST: " + ast.toStringTree()); PathExpr expr = new PathExpr(context); treeParser.xpath(ast, expr); --- 84,88 ---- AST ast = parser.getAST(); ! // LOG.debug("Generated AST: " + ast.toStringTree()); PathExpr expr = new PathExpr(context); treeParser.xpath(ast, expr); Index: ElementConstructor.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/ElementConstructor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ElementConstructor.java 7 Aug 2004 16:28:02 -0000 1.6 --- ElementConstructor.java 8 Aug 2004 19:03:26 -0000 1.7 *************** *** 64,68 **** public void addAttribute(AttributeConstructor attr) { if(attr.isNamespaceDeclaration()) { ! addNamespaceDecl(QName.extractLocalName(attr.getQName()), attr.getLiteralValue()); } else if(attributes == null) { attributes = new AttributeConstructor[1]; --- 64,71 ---- public void addAttribute(AttributeConstructor attr) { if(attr.isNamespaceDeclaration()) { ! if(attr.getQName().equals("xmlns")) ! addNamespaceDecl("", attr.getLiteralValue()); ! else ! addNamespaceDecl(QName.extractLocalName(attr.getQName()), attr.getLiteralValue()); } else if(attributes == null) { attributes = new AttributeConstructor[1]; *************** *** 77,80 **** --- 80,84 ---- public void addNamespaceDecl(String prefix, String uri) { + System.out.println(prefix + "=" + uri); if(namespaceDecls == null) { namespaceDecls = new QName[1]; *************** *** 127,131 **** constructor = (AttributeConstructor)attributes[i]; attrValues = constructor.eval(contextSequence, contextItem); ! attrQName = QName.parse(context, constructor.getQName()); attrs.addAttribute(attrQName.getNamespaceURI(), attrQName.getLocalName(), attrQName.toString(), "CDATA", attrValues.getStringValue()); --- 131,135 ---- constructor = (AttributeConstructor)attributes[i]; attrValues = constructor.eval(contextSequence, contextItem); ! attrQName = QName.parse(context, constructor.getQName(), ""); attrs.addAttribute(attrQName.getNamespaceURI(), attrQName.getLocalName(), attrQName.toString(), "CDATA", attrValues.getStringValue()); |