Return-Path: Delivered-To: apmail-ws-tuscany-commits-archive@locus.apache.org Received: (qmail 86053 invoked from network); 6 Jul 2007 06:44:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Jul 2007 06:44:36 -0000 Received: (qmail 51516 invoked by uid 500); 6 Jul 2007 12:44:32 -0000 Delivered-To: apmail-ws-tuscany-commits-archive@ws.apache.org Received: (qmail 51494 invoked by uid 500); 6 Jul 2007 12:44:31 -0000 Mailing-List: contact tuscany-commits-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: tuscany-dev@ws.apache.org Delivered-To: mailing list tuscany-commits@ws.apache.org Received: (qmail 51485 invoked by uid 99); 6 Jul 2007 12:44:31 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2007 05:44:31 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2007 05:44:28 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id C97DD1A981A; Fri, 6 Jul 2007 05:44:07 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r553866 - in /incubator/tuscany/cpp/sdo/runtime/core: src/commonj/sdo/SDOSchemaSAX2Parser.cpp src/commonj/sdo/SDOXMLWriter.cpp src/commonj/sdo/SchemaInfo.cpp src/commonj/sdo/SchemaInfo.h test/jira1112expected.xml test/loadload-output.txt Date: Fri, 06 Jul 2007 12:44:07 -0000 To: tuscany-commits@ws.apache.org From: robbinspg@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070706124407.C97DD1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: robbinspg Date: Fri Jul 6 05:44:06 2007 New Revision: 553866 URL: http://svn.apache.org/viewvc?view=rev&rev=553866 Log: TUSCANY-1112 correct handling of element form (in HEAD) Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLWriter.cpp incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SchemaInfo.cpp incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SchemaInfo.h incubator/tuscany/cpp/sdo/runtime/core/test/jira1112expected.xml incubator/tuscany/cpp/sdo/runtime/core/test/loadload-output.txt Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp?view=diff&rev=553866&r1=553865&r2=553866 ============================================================================== --- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp (original) +++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp Fri Jul 6 05:44:06 2007 @@ -230,6 +230,14 @@ if (attributes[i].getName().equalsIgnoreCase("targetNamespace")) { schemaInfo.setTargetNamespaceURI(attributes[i].getValue()); + } + + if (attributes[i].getName().equalsIgnoreCase("elementFormDefault")) + { + if (attributes[i].getValue().equals("qualified")) + { + schemaInfo.setElementFormDefaultQualified(true); + } } } @@ -749,7 +757,23 @@ thisProperty.name, thisProperty.localname); - thisProperty.namespaceURI = schemaInfo.getTargetNamespaceURI(); + // Set the property's namespace if elementForm is "qualified" + bool elementFormQualified = schemaInfo.isElementFormDefaultQualified(); + SDOXMLString elementForm = attributes.getValue("form"); + if (!elementForm.isNull()) + { + elementFormQualified = false; + if (elementForm.equals("qualified")) + { + elementFormQualified = true; + } + } + + if (elementFormQualified + || currentType.name.equals("RootType")) + { + thisProperty.namespaceURI = schemaInfo.getTargetNamespaceURI(); + } setType(thisProperty, attributes, namespaces); Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLWriter.cpp URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLWriter.cpp?view=diff&rev=553866&r1=553865&r2=553866 ============================================================================== --- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLWriter.cpp (original) +++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLWriter.cpp Fri Jul 6 05:44:06 2007 @@ -739,10 +739,12 @@ // Write the startElement for non-root object SDOXMLString theName=elementName; + // If an elementURI is specified then the elementForm is "qualified" if (!elementURI.isNull() && !elementURI.equals("") && !elementURI.equals(s_commonjsdo) - && !elementURI.equals(tnsURI)) + //&& !elementURI.equals(tnsURI) + ) { // Locate the namespace prefix std::map::iterator it = namespaceMap.find(elementURI); @@ -1388,8 +1390,8 @@ else { // The property has been defined programatically so we will - // assume it is the namespace fo the parent DataObject - elementURI = typeImpl.getURI(); + // assume elementForm is "unqualified" + elementURI = ""; } } Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SchemaInfo.cpp URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SchemaInfo.cpp?view=diff&rev=553866&r1=553865&r2=553866 ============================================================================== --- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SchemaInfo.cpp (original) +++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SchemaInfo.cpp Fri Jul 6 05:44:06 2007 @@ -26,7 +26,8 @@ { SchemaInfo::SchemaInfo() - : targetNamespaceURI("") + : targetNamespaceURI(""), + elementFormDefaultQualified(false) { } Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SchemaInfo.h URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SchemaInfo.h?view=diff&rev=553866&r1=553865&r2=553866 ============================================================================== --- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SchemaInfo.h (original) +++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SchemaInfo.h Fri Jul 6 05:44:06 2007 @@ -49,9 +49,12 @@ SDO_SPI const SDOXMLString& getTargetNamespaceURI() const {return targetNamespaceURI;} SDO_SPI void setTargetNamespaceURI(const SDOXMLString& URI) {targetNamespaceURI = URI;} + SDO_SPI bool isElementFormDefaultQualified() {return elementFormDefaultQualified;} + SDO_SPI void setElementFormDefaultQualified(bool qualified) {elementFormDefaultQualified = qualified;} private: SAX2Namespaces schemaNamespaces; - SDOXMLString targetNamespaceURI; + SDOXMLString targetNamespaceURI; + bool elementFormDefaultQualified; }; } // End - namespace sdo Modified: incubator/tuscany/cpp/sdo/runtime/core/test/jira1112expected.xml URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/test/jira1112expected.xml?view=diff&rev=553866&r1=553865&r2=553866 ============================================================================== --- incubator/tuscany/cpp/sdo/runtime/core/test/jira1112expected.xml (original) +++ incubator/tuscany/cpp/sdo/runtime/core/test/jira1112expected.xml Fri Jul 6 05:44:06 2007 @@ -1,9 +1,9 @@ - - Will - Shakespeare - + + Will + Shakespeare + Modified: incubator/tuscany/cpp/sdo/runtime/core/test/loadload-output.txt URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/test/loadload-output.txt?view=diff&rev=553866&r1=553865&r2=553866 ============================================================================== --- incubator/tuscany/cpp/sdo/runtime/core/test/loadload-output.txt (original) +++ incubator/tuscany/cpp/sdo/runtime/core/test/loadload-output.txt Fri Jul 6 05:44:06 2007 @@ -1,2 +1,2 @@ -#/departments.0/employees.0/opendataobjectlist.0#/departments.0/employees.0/opendataobject#/departments.0/employees.045 +#/departments.0/employees.0/opendataobjectlist.0#/departments.0/employees.0/opendataobject#/departments.0/employees.045 --------------------------------------------------------------------- To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org For additional commands, e-mail: tuscany-commits-help@ws.apache.org