gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] branch master updated: fix #5990


From: gnunet
Subject: [libeufin] branch master updated: fix #5990
Date: Thu, 19 Dec 2019 15:59:15 +0100

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new c6fba24  fix #5990
c6fba24 is described below

commit c6fba2461569e999c3cda20f6186db750621420e
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu Dec 19 15:58:59 2019 +0100

    fix #5990
---
 .idea/runConfigurations/test_nexus.xml | 21 +++++++++++++++++++++
 util/src/main/kotlin/XMLUtil.kt        | 12 +++++++++++-
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/.idea/runConfigurations/test_nexus.xml 
b/.idea/runConfigurations/test_nexus.xml
new file mode 100644
index 0000000..5b3bcf6
--- /dev/null
+++ b/.idea/runConfigurations/test_nexus.xml
@@ -0,0 +1,21 @@
+<component name="ProjectRunConfigurationManager">
+    <configuration default="false" name="test-nexus" 
type="GradleRunConfiguration" factoryName="Gradle">
+        <ExternalSystemSettings>
+            <option name="executionName" />
+            <option name="externalProjectPath" value="$PROJECT_DIR$/nexus" />
+            <option name="externalSystemIdString" value="GRADLE" />
+            <option name="scriptParameters" value="" />
+            <option name="taskDescriptions">
+                <list />
+            </option>
+            <option name="taskNames">
+                <list>
+                    <option value="test" />
+                </list>
+            </option>
+            <option name="vmOptions" value="" />
+        </ExternalSystemSettings>
+        <GradleScriptDebugEnabled>true</GradleScriptDebugEnabled>
+        <method v="2" />
+    </configuration>
+</component>
\ No newline at end of file
diff --git a/util/src/main/kotlin/XMLUtil.kt b/util/src/main/kotlin/XMLUtil.kt
index b871108..20e7c05 100644
--- a/util/src/main/kotlin/XMLUtil.kt
+++ b/util/src/main/kotlin/XMLUtil.kt
@@ -20,6 +20,7 @@
 package tech.libeufin.util
 
 import com.sun.org.apache.xerces.internal.dom.DOMInputImpl
+import com.sun.xml.bind.marshaller.NamespacePrefixMapper
 import org.w3c.dom.Document
 import org.w3c.dom.Node
 import org.w3c.dom.NodeList
@@ -57,6 +58,14 @@ import javax.xml.xpath.XPath
 import javax.xml.xpath.XPathConstants
 import javax.xml.xpath.XPathFactory
 
+class DefaultNamespaces : NamespacePrefixMapper() {
+    override fun getPreferredPrefix(namespaceUri: String?, suggestion: 
String?, requirePrefix: Boolean): String? {
+        if (namespaceUri == "http://www.w3.org/2000/09/xmldsig#";) return "ds"
+        return null
+    }
+}
+
+
 /**
  * Helpers for dealing with XML in EBICS.
  */
@@ -89,7 +98,6 @@ class XMLUtil private constructor() {
             return NodeSetData { nodeList.iterator() }
         }
     }
-
     /**
      * Validator for EBICS messages.
      */
@@ -198,6 +206,7 @@ class XMLUtil private constructor() {
             val jc = JAXBContext.newInstance(T::class.java)
             val m = jc.createMarshaller()
             m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true)
+            m.setProperty("com.sun.xml.bind.namespacePrefixMapper", 
DefaultNamespaces())
             m.marshal(obj, sw)
             return sw.toString()
         }
@@ -209,6 +218,7 @@ class XMLUtil private constructor() {
             val jc = JAXBContext.newInstance(T::class.java)
             val m = jc.createMarshaller()
             m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true)
+            m.setProperty("com.sun.xml.bind.namespacePrefixMapper", 
DefaultNamespaces())
             m.marshal(obj, doc)
             return doc
         }

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]