You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ro...@apache.org on 2006/12/01 21:13:42 UTC
svn commit: r481370 - in /incubator/tuscany/cpp/sdo/runtime/core:
src/commonj/sdo/SDOXMLWriter.cpp test/main.cpp test/sdotest.h
test/sdotest2.cpp test/tuscany963.out.xml.txt test/tuscany963.xml
test/tuscany963.xsd
Author: robbinspg
Date: Fri Dec 1 12:13:41 2006
New Revision: 481370
URL: http://svn.apache.org/viewvc?view=rev&rev=481370
Log:
TUSCANY-963 Do not write attributes as elements in a sequence
Added:
incubator/tuscany/cpp/sdo/runtime/core/test/tuscany963.out.xml.txt (with props)
incubator/tuscany/cpp/sdo/runtime/core/test/tuscany963.xml (with props)
incubator/tuscany/cpp/sdo/runtime/core/test/tuscany963.xsd (with props)
Modified:
incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLWriter.cpp
incubator/tuscany/cpp/sdo/runtime/core/test/main.cpp
incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.h
incubator/tuscany/cpp/sdo/runtime/core/test/sdotest2.cpp
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=481370&r1=481369&r2=481370
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLWriter.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLWriter.cpp Fri Dec 1 12:13:41 2006
@@ -1057,6 +1057,14 @@
SDOXMLString seqPropName = seqProp.getName();
const Type& seqPropType = seqProp.getType();
+ // Do not write attributes as members of the sequence
+ XSDPropertyInfo* pi = getPropertyInfo(seqPropType, seqProp);
+ PropertyDefinitionImpl propdef;
+ if (!pi || (pi->getPropertyDefinition().isElement))
+ {
+ continue;
+ }
+
if (seqPropType.isDataObjectType())
{
DataObjectPtr doValue;
Modified: incubator/tuscany/cpp/sdo/runtime/core/test/main.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/test/main.cpp?view=diff&rev=481370&r1=481369&r2=481370
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/test/main.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/test/main.cpp Fri Dec 1 12:13:41 2006
@@ -176,6 +176,7 @@
TEST ( sdotest::testXPath() );
TEST ( sdotest::cdatatest() );
+ TEST ( sdotest::tuscany963() );
cout << "Total tests:" << totaltests << " Tests passed:" << testspassed << endl;
return testspassed - totaltests;
Modified: incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.h?view=diff&rev=481370&r1=481369&r2=481370
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.h (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.h Fri Dec 1 12:13:41 2006
@@ -199,4 +199,5 @@
static int b45933();
static int testXPath();
static int cdatatest();
+ static int tuscany963();
};
Modified: incubator/tuscany/cpp/sdo/runtime/core/test/sdotest2.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/test/sdotest2.cpp?view=diff&rev=481370&r1=481369&r2=481370
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/test/sdotest2.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/test/sdotest2.cpp Fri Dec 1 12:13:41 2006
@@ -1486,3 +1486,27 @@
return 0;
}
}
+int sdotest::tuscany963()
+{
+
+
+ try {
+ DataFactoryPtr mdg = DataFactory::getDataFactory();
+
+ XSDHelperPtr xsh = HelperProvider::getXSDHelper(mdg);
+ xsh->defineFile("tuscany963.xsd");
+ XMLHelperPtr myXMLHelper = HelperProvider::getXMLHelper(mdg);
+ XMLDocumentPtr myXMLDocument = myXMLHelper->loadFile("tuscany963.xml");
+ myXMLHelper->save(myXMLDocument, "tuscany963.out.xml");
+
+
+ return comparefiles("tuscany963.out.xml" ,"tuscany963.out.xml.txt");
+
+
+ }
+ catch (SDORuntimeException e)
+ {
+ cout << "Exception in tuscany963" << e << endl;
+ return 0;
+ }
+}
Added: incubator/tuscany/cpp/sdo/runtime/core/test/tuscany963.out.xml.txt
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/test/tuscany963.out.xml.txt?view=auto&rev=481370
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/test/tuscany963.out.xml.txt (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/test/tuscany963.out.xml.txt Fri Dec 1 12:13:41 2006
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<content xmlns="http://www.w3.org/2005/Atom" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.w3.org/2005/Atom" base="blah" lang="blah2"/>
Propchange: incubator/tuscany/cpp/sdo/runtime/core/test/tuscany963.out.xml.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/tuscany/cpp/sdo/runtime/core/test/tuscany963.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/test/tuscany963.xml?view=auto&rev=481370
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/test/tuscany963.xml (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/test/tuscany963.xml Fri Dec 1 12:13:41 2006
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<content xmlns="http://www.w3.org/2005/Atom" xmlns:tns="http://www.w3.org/2005/Atom"
+xml:base="blah" xml:lang="blah2" />
Propchange: incubator/tuscany/cpp/sdo/runtime/core/test/tuscany963.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sdo/runtime/core/test/tuscany963.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sdo/runtime/core/test/tuscany963.xsd
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/test/tuscany963.xsd?view=auto&rev=481370
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/test/tuscany963.xsd (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/test/tuscany963.xsd Fri Dec 1 12:13:41 2006
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<xs:schema targetNamespace="http://www.w3.org/2005/Atom"
+xmlns="http://www.w3.org/2005/Atom" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd" />
+<xs:import namespace="http://www.w3.org/1999/xhtml" schemaLocation="xhtml1-strict.xsd" />
+
+<xs:element name="content" type="contentType" minOccurs="0" />
+
+<xs:complexType name="contentType" mixed="true" >
+<xs:sequence>
+<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+</xs:sequence>
+<xs:attribute name="type" type="xs:string" default="text" />
+<xs:attribute name="src" type="xs:string" /> <!-- uriType -->
+<xs:attributeGroup ref="commonAttributes"/>
+</xs:complexType>
+
+<xs:attributeGroup name="commonAttributes">
+<xs:attribute ref="xml:base" />
+<xs:attribute ref="xml:lang" />
+<xs:anyAttribute/>
+</xs:attributeGroup>
+
+</xs:schema>
\ No newline at end of file
Propchange: incubator/tuscany/cpp/sdo/runtime/core/test/tuscany963.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sdo/runtime/core/test/tuscany963.xsd
------------------------------------------------------------------------------
svn:keywords = Rev Date
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org