Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-3597

XMLwriter drops namespace for datatype properties

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Cpp-M2
    • None
    • C++ SDO
    • None
    • Patch Available

    Description

      When defining XSD and XML data as attached, the resulting XML is wrong if loaded and saved.
      For datatype properties with imported NS, the NS is lost if that NS is not used with at least one object property.
      Example (prop3):
      In:
      ==========
      <?xml version="1.0" encoding="UTF-8"?>
      <ns1:class1 xmlns:ns1="http://ns1" xmlns:ns2="http://ns2">
      <ns1:prop1>bla</ns1:prop1>
      <ns1:prop2>
      <ns2:prop3>blub</ns2:prop3>
      </ns1:prop2>
      </ns1:class1>
      ==========

      Out:
      ==========
      <?xml version="1.0" encoding="UTF-8"?>
      <class1 xsi:type="tns2:class1" xmlns:tns2="http://ns1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <tns2:prop1>bla</tns2:prop1>
      <tns2:prop2>
      <prop3>blub</prop3>
      </tns2:prop2>
      </class1>
      ==========

      Reason is, that the XMLWriter at the beginning collects all referenced NS by traversing through the entire SDO, but it skips
      datatype props.
      The fix has some performance (must compare also the NS of all datatype props) impact but I could not see a better way ...

      Attachments

        1. testprog.cpp
          0.8 kB
          Thomas Gentsch
        2. test.xml
          0.2 kB
          Thomas Gentsch
        3. SDOXMLWriter.cpp-PATCH
          1 kB
          Thomas Gentsch
        4. schema2.xsd
          0.4 kB
          Thomas Gentsch
        5. schema1.xsd
          0.9 kB
          Thomas Gentsch

        Activity

          People

            Unassigned Unassigned
            tge Thomas Gentsch
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: