You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2021/12/23 17:56:19 UTC

svn commit: r1896323 - in /xmlbeans/trunk/src/test: java/scomp/xmlbeans583/ java/scomp/xmlbeans583/detailed/ resources/xbean/scomp/xmlbeans-583/

Author: fanningpj
Date: Thu Dec 23 17:56:19 2021
New Revision: 1896323

URL: http://svn.apache.org/viewvc?rev=1896323&view=rev
Log:
[XMLBEANS-583] try to not emit multiple namespace entries with the same prefix on the same element

Added:
    xmlbeans/trunk/src/test/java/scomp/xmlbeans583/
    xmlbeans/trunk/src/test/java/scomp/xmlbeans583/detailed/
    xmlbeans/trunk/src/test/java/scomp/xmlbeans583/detailed/Xmlbeans583Test.java
    xmlbeans/trunk/src/test/resources/xbean/scomp/xmlbeans-583/
    xmlbeans/trunk/src/test/resources/xbean/scomp/xmlbeans-583/xmltostringtest1xsd.xsd
    xmlbeans/trunk/src/test/resources/xbean/scomp/xmlbeans-583/xmltostringtest2xsd.xsd
    xmlbeans/trunk/src/test/resources/xbean/scomp/xmlbeans-583/xmltostringtest3xsd.xsd

Added: xmlbeans/trunk/src/test/java/scomp/xmlbeans583/detailed/Xmlbeans583Test.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/scomp/xmlbeans583/detailed/Xmlbeans583Test.java?rev=1896323&view=auto
==============================================================================
--- xmlbeans/trunk/src/test/java/scomp/xmlbeans583/detailed/Xmlbeans583Test.java (added)
+++ xmlbeans/trunk/src/test/java/scomp/xmlbeans583/detailed/Xmlbeans583Test.java Thu Dec 23 17:56:19 2021
@@ -0,0 +1,26 @@
+package scomp.xmlbeans583.detailed;
+
+import org.junit.Test;
+import scomp.common.BaseCase;
+import xsd.xmlToStringTest1Xsd.Ns1T1;
+import xsd.xmlToStringTest2Xsd.Ns2E1Document;
+import xsd.xmlToStringTest3Xsd.Ns3E1Document;
+
+import static org.junit.Assert.assertNotNull;
+
+public class Xmlbeans583Test extends BaseCase {
+    @Test
+    public void testXmlToString() throws Throwable {
+        final Ns2E1Document ns2e1Doc = Ns2E1Document.Factory.newInstance();
+        ns2e1Doc.addNewNs2E1().addNewNs2T1E1().setNs1T1E1("Ns1T1E1");
+
+        final Ns3E1Document ns3e1Doc = Ns3E1Document.Factory.newInstance();
+        ns3e1Doc.addNewNs3E1().setNs3T1E1(Ns1T1.Factory.parse(ns2e1Doc.getNs2E1().getNs2T1E1().toString()));
+
+        final Ns3E1Document pNs3e1Doc = Ns3E1Document.Factory.parse(ns3e1Doc.toString());
+        final Ns2E1Document pNs2e1Doc = Ns2E1Document.Factory.newInstance();
+        pNs2e1Doc.addNewNs2E1().setNs2T1E1(pNs3e1Doc.getNs3E1().getNs3T1E1());
+
+        assertNotNull(Ns2E1Document.Factory.parse(pNs2e1Doc.toString()));
+    }
+}

Added: xmlbeans/trunk/src/test/resources/xbean/scomp/xmlbeans-583/xmltostringtest1xsd.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/resources/xbean/scomp/xmlbeans-583/xmltostringtest1xsd.xsd?rev=1896323&view=auto
==============================================================================
--- xmlbeans/trunk/src/test/resources/xbean/scomp/xmlbeans-583/xmltostringtest1xsd.xsd (added)
+++ xmlbeans/trunk/src/test/resources/xbean/scomp/xmlbeans-583/xmltostringtest1xsd.xsd Thu Dec 23 17:56:19 2021
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified" targetNamespace="XmlToStringTest1Xsd.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:this="XmlToStringTest1Xsd.xsd">
+  <xs:complexType name="Ns1T1">
+    <xs:sequence>
+      <xs:element name="Ns1T1E1" type="xs:string"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>
\ No newline at end of file

Added: xmlbeans/trunk/src/test/resources/xbean/scomp/xmlbeans-583/xmltostringtest2xsd.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/resources/xbean/scomp/xmlbeans-583/xmltostringtest2xsd.xsd?rev=1896323&view=auto
==============================================================================
--- xmlbeans/trunk/src/test/resources/xbean/scomp/xmlbeans-583/xmltostringtest2xsd.xsd (added)
+++ xmlbeans/trunk/src/test/resources/xbean/scomp/xmlbeans-583/xmltostringtest2xsd.xsd Thu Dec 23 17:56:19 2021
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified" targetNamespace="XmlToStringTest2Xsd.xsd" xmlns:ns1="XmlToStringTest1Xsd.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:this="XmlToStringTest2Xsd.xsd">
+  <xs:import namespace="XmlToStringTest1Xsd.xsd" schemaLocation="xmltostringtest1xsd.xsd"/>
+  <xs:complexType name="Ns2T1">
+    <xs:sequence>
+      <xs:element name="Ns2T1E1" type="ns1:Ns1T1"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="Ns2E1" type="this:Ns2T1"/>
+</xs:schema>
\ No newline at end of file

Added: xmlbeans/trunk/src/test/resources/xbean/scomp/xmlbeans-583/xmltostringtest3xsd.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/resources/xbean/scomp/xmlbeans-583/xmltostringtest3xsd.xsd?rev=1896323&view=auto
==============================================================================
--- xmlbeans/trunk/src/test/resources/xbean/scomp/xmlbeans-583/xmltostringtest3xsd.xsd (added)
+++ xmlbeans/trunk/src/test/resources/xbean/scomp/xmlbeans-583/xmltostringtest3xsd.xsd Thu Dec 23 17:56:19 2021
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema targetNamespace="XmlToStringTest3Xsd.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:this="XmlToStringTest3Xsd.xsd" xmlns:ns1="XmlToStringTest1Xsd.xsd">
+  <xs:import namespace="XmlToStringTest1Xsd.xsd" schemaLocation="xmltostringtest1xsd.xsd"/>
+  <xs:complexType name="Ns3T1">
+    <xs:sequence>
+      <xs:element name="Ns3T1E1" type="ns1:Ns1T1"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="Ns3E1" type="this:Ns3T1"/>
+</xs:schema>
\ No newline at end of file



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