You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by ed...@apache.org on 2004/12/23 17:23:57 UTC

svn commit: r123205 - /lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/XlinkCollection.java

Author: edith
Date: Thu Dec 23 08:23:56 2004
New Revision: 123205

URL: http://svn.apache.org/viewcvs?view=rev&rev=123205
Log:
set the xlink namespace even if the document already exist, because the namespace areelse removed
Modified:
   lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/XlinkCollection.java

Modified: lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/XlinkCollection.java
Url: http://svn.apache.org/viewcvs/lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/XlinkCollection.java?view=diff&rev=123205&p1=lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/XlinkCollection.java&r1=123204&p2=lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/XlinkCollection.java&r2=123205
==============================================================================
--- lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/XlinkCollection.java	(original)
+++ lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/XlinkCollection.java	Thu Dec 23 08:23:56 2004
@@ -31,7 +31,7 @@
  * Implementation of a Collection. In the collection are xlink inserted.
  * @author <a href="mailto:edith@apache.org">Edith Chevrier </a>
  * @author <a href="mailto:andreas@apache.org">Andreas Hartmann </a>
- * @version $Id: XlinkCollection.java,v 1.7 2004/07/10 23:13:35 andreas Exp $
+ * @version $Id$
  */
 public class XlinkCollection extends CollectionImpl {
 
@@ -100,15 +100,14 @@
      */
     protected NamespaceHelper getNamespaceHelper() throws DocumentException,
             ParserConfigurationException, SAXException, IOException {
+
         NamespaceHelper helper = super.getNamespaceHelper();
-        if (!exists()) {
-            Element collectionElement = helper.getDocument().getDocumentElement();
-            String namespaceDeclaration = collectionElement.getAttributeNS(
+        Element collectionElement = helper.getDocument().getDocumentElement();
+        String namespaceDeclaration = collectionElement.getAttributeNS(
                     "http://www.w3.org/2000/xmlns/", "xlink");
-            if (namespaceDeclaration == null || !namespaceDeclaration.equals(XLink.XLINK_NAMESPACE)) {
-                collectionElement.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink",
-                        XLink.XLINK_NAMESPACE);
-            }
+        if (namespaceDeclaration == null || !namespaceDeclaration.equals(XLink.XLINK_NAMESPACE)) {
+            collectionElement.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink",
+                    XLink.XLINK_NAMESPACE);
         }
         return helper;
     }

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org