|
|
Choosing A Webhost: |
svn commit: r514615 - in /lenya/trunk/src/java/org/apache/lenya: cms/cocoon: msg#00002cms.lenya.cvs
Author: andreas Date: Mon Mar 5 01:15:10 2007 New Revision: 514615 URL: http://svn.apache.org/viewvc?view=rev&rev=514615 Log: Don't require namespace prefix in NamespaceHelper. This is correct according to DOM level 2. Modified: lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source/AggregatingSource.java lenya/trunk/src/java/org/apache/lenya/xml/NamespaceHelper.java Modified: lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source/AggregatingSource.java URL: http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source/AggregatingSource.java?view=diff&rev=514615&r1=514614&r2=514615 ============================================================================== --- lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source/AggregatingSource.java (original) +++ lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source/AggregatingSource.java Mon Mar 5 01:15:10 2007 @@ -56,7 +56,7 @@ String prefix = docElement.getPrefix(); String localName = docElement.getLocalName(); - if (namespaceUri == null || prefix == null) { + if (namespaceUri == null) { this.dom = DocumentHelper.createDocument(null, localName, null); } else { NamespaceHelper helper = new NamespaceHelper(namespaceUri, prefix, Modified: lenya/trunk/src/java/org/apache/lenya/xml/NamespaceHelper.java URL: http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/xml/NamespaceHelper.java?view=diff&rev=514615&r1=514614&r2=514615 ============================================================================== --- lenya/trunk/src/java/org/apache/lenya/xml/NamespaceHelper.java (original) +++ lenya/trunk/src/java/org/apache/lenya/xml/NamespaceHelper.java Mon Mar 5 01:15:10 2007 @@ -42,7 +42,7 @@ /** * Creates a new instance of NamespaceHelper using an existing document. The - * document is not affected. If you omit the prefix, the default namespace + * document is not affected. If the prefix is <code>null</code>, the default namespace * is used. * @param _document The document. * @param _namespaceUri The namespace URI. @@ -51,7 +51,6 @@ public NamespaceHelper(String _namespaceUri, String _prefix, Document _document) { Assert.notNull("namespace URI", _namespaceUri); - Assert.notNull("prefix", _prefix); Assert.notNull("DOM", _document); this.namespaceUri = _namespaceUri; @@ -63,7 +62,7 @@ * <p> * Creates a new instance of NamespaceHelper. A new document is created * using a document element in the given namespace with the given prefix. If - * you omit the prefix, the default namespace is used. + * the prefix is null, the default namespace is used. * </p> * <p> * NamespaceHelper("http://www.w3.org/2000/svg", "svg", "svg"):<br/> @@ -113,7 +112,7 @@ * @return The qualified name, i.e. prefix:localName. */ public static String getQualifiedName(String prefix, String localName) { - if (prefix.equals("")) { + if (prefix == null || prefix.equals("")) { return localName; } return prefix + ":" + localName;
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |