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/05 15:16:38 UTC
svn commit: r482667 -
/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLWriter.cpp
Author: robbinspg
Date: Tue Dec 5 06:16:37 2006
New Revision: 482667
URL: http://svn.apache.org/viewvc?view=rev&rev=482667
Log:
TUSCANY-963 Do not write attributes as elements in a sequence
Modified:
incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLWriter.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=482667&r1=482666&r2=482667
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLWriter.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLWriter.cpp Tue Dec 5 06:16:37 2006
@@ -1065,6 +1065,14 @@
SDOXMLString seqPropName = seqProp.getName();
const Type& seqPropType = seqProp.getType();
+ // Do not write attributes as members of the sequence
+ XSDPropertyInfo* pi = getPropertyInfo(dataObjectType, seqProp);
+ PropertyDefinitionImpl propdef;
+ if (pi && !(pi->getPropertyDefinition().isElement))
+ {
+ continue;
+ }
+
if (seqPropType.isDataObjectType())
{
DataObjectPtr doValue;
@@ -1096,6 +1104,10 @@
else
{
// Sequence member is a primitive
+ // Only write a primitive as an element if defined by the schema or if it's
+ // many-valued.
+ if (!pi && !seqProp.isMany()) continue;
+
/* Use our wrapper function just in case the element has CDATA in it */
writeXMLElement(writer,
seqPropName,
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org