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

Element coming out in the wrong namespace

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • C++-SCA-Next
    • None
    • C++ SDO
    • None
    • WinXP

    Description

      We have a schema file that defines an atom feed. It specified elementFormDefault="qualified" so that lower level elements should be in the target namespace. I will attach the schema as a separate file. With a very simple php test case as follows:

      $xmldas = SDO_DAS_XML::create('Atom1.0.xsd');
      $document = $xmldas->createDocument('http://www.w3.org/2005/Atom','entry');
      $entry = $document->getRootDataObject();
      $author = $entry->createDataObject('author');
      $author->name[] = "Caroline Maynard";
      print $xmldas->saveString($document,2);

      we get
      <?xml version="1.0" encoding="UTF-8"?>
      <tns:entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.w3.org/2005/Atom">
      <tns:author>
      <name>Caroline Maynard</name>
      </tns:author>
      </tns:entry>

      whereas we should see the <name> element in the tns namespace.

      I have checked this with XERCES: the xml that we are generating will not validate, whereas if I alter it to have <name> in the tns namespace it will.

      Attachments

        1. Atom1.0.xsd
          9 kB
          Matthew Peters

        Activity

          People

            Unassigned Unassigned
            matthew.f.peters Matthew Peters
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: