tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edslatt...@apache.org
Subject svn commit: r366158 [13/25] - in /incubator/tuscany/cpp/sdo: ./ bin/ dependencies/ include/ include/commonj/ include/commonj/sdo/ lib/ projects/ projects/tuscany_sdo/ projects/tuscany_sdo/sdo_runtime/ projects/tuscany_sdo/sdo_samples/ projects/tuscany_...
Date Thu, 05 Jan 2006 10:58:55 GMT
Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp Thu Jan  5 02:55:00 2006
@@ -0,0 +1,1059 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#include "commonj/sdo/SDOSchemaSAX2Parser.h"
+#include "commonj/sdo/XSDPropertyInfo.h"
+#include "commonj/sdo/XSDTypeInfo.h"
+#include "commonj/sdo/SDORuntimeException.h"
+#include "commonj/sdo/Logging.h"
+
+namespace commonj
+{
+    namespace sdo
+    {
+        
+        SDOSchemaSAX2Parser::SDOSchemaSAX2Parser(SchemaInfo& schemaInf,
+            ParserErrorSetter* insetter)
+            : schemaInfo(schemaInf) ,SAX2Parser(insetter)
+        {
+            bInSchema = false;
+        }
+        
+        SDOSchemaSAX2Parser::~SDOSchemaSAX2Parser()
+        {
+        }
+        
+        
+
+        // ============================================================================
+        // startElementNS
+        // ============================================================================
+        void SDOSchemaSAX2Parser::startElementNs(
+            const SDOXMLString& localname,
+            const SDOXMLString& prefix,
+            const SDOXMLString& URI,
+            const SAX2Namespaces& namespaces,
+            const SAX2Attributes& attributes)
+        {
+            LOGINFO_1( INFO,"SchemaParser:startElementNs:%s",(const char*)localname);
+
+            if (URI.equalsIgnoreCase("http://www.w3.org/2001/XMLSchema"))
+            {
+
+                ///////////////////////////////////////////////////////////////////////
+                // Handle schema
+                // Set the URI from the targetNamespace of the xsd:schema element
+                // Remember namespace mappings
+                // Create the root Type
+                ///////////////////////////////////////////////////////////////////////
+
+
+                if (localname.equalsIgnoreCase("schema"))
+                {
+                    bInSchema = true;
+                    // Handle namespace definitions
+                    schemaInfo.getSchemaNamespaces().merge(namespaces);
+                    
+                    // Handle attributes
+                    for (int i=0; i < attributes.size(); i++)
+                    {
+                        if (attributes[i].getName().equalsIgnoreCase("targetNamespace"))
+                        {
+                            schemaInfo.setTargetNamespaceURI(attributes[i].getValue());
+                        }                        
+                    }
+                    
+                    currentType.uri = schemaInfo.getTargetNamespaceURI();
+                    currentType.name = "RootType";
+                    currentType.localname="RootType";
+                    
+                } // end schema handling
+
+                // Handle <import> of other schema
+                else if (localname.equalsIgnoreCase("import"))
+                {
+                    // TODO - import and include treated equally for now - need to
+                    // separate out the namespace info for import 
+                    startInclude(localname, prefix, URI, namespaces, attributes);
+                }
+
+                // Handle <include> of other schema
+                else if (localname.equalsIgnoreCase("include"))
+                {
+                    startInclude(localname, prefix, URI, namespaces, attributes);
+                }
+                
+                ///////////////////////////////////////////////////////////////////////
+                // Handle elements and attributes
+                // These become Properties of the current Type
+                // ?? Any special handling of global elements???
+                ///////////////////////////////////////////////////////////////////////
+                else if (localname.equalsIgnoreCase("element"))
+                {
+                    startElement(localname, prefix, URI, namespaces, attributes);
+                }
+                else if (localname.equalsIgnoreCase("attribute"))
+                {
+                    startAttribute(localname, prefix, URI, namespaces, attributes);
+                }
+                else if (localname.equalsIgnoreCase("any")
+                        || localname.equalsIgnoreCase("anyAttribute"))
+                {
+                    // the type containing this is to be created as open
+                    currentType.isOpen = true;
+                }
+                
+                
+                ///////////////////////////////////////////////////////////////////////
+                // Handle complexType
+                // These become new types
+                ///////////////////////////////////////////////////////////////////////
+                else if (localname.equalsIgnoreCase("complexType"))
+                {
+                    startComplexType(localname, prefix, URI, namespaces, attributes);
+                } // end complexType handling
+                
+                else if (localname.equalsIgnoreCase("choice") 
+                    || localname.equalsIgnoreCase("sequence")
+                    || localname.equalsIgnoreCase("all"))
+                {
+                    startGroup(localname, prefix, URI, namespaces, attributes);
+                } // end Group handling
+                
+                ///////////////////////////////////////////////////////////////////////
+                // Handle simpleType
+                // These become new types
+                ///////////////////////////////////////////////////////////////////////
+                else if (localname.equalsIgnoreCase("simpleType"))
+                {
+                    startSimpleType(localname, prefix, URI, namespaces, attributes);
+                } // end complexType handling
+                
+                else if (localname.equalsIgnoreCase("restriction"))
+                {
+                    startRestriction(localname, prefix, URI, namespaces, attributes);
+                }
+                
+                else if (localname.equalsIgnoreCase("extension"))
+                {
+                    startExtension(localname, prefix, URI, namespaces, attributes);
+                }
+            }
+            else // not in schema - check for any extra namespaces
+            {
+                schemaInfo.getSchemaNamespaces().merge(namespaces);
+            }
+            
+        }            
+        
+        
+        // ============================================================================
+        // endElementNs
+        // ============================================================================            
+        void SDOSchemaSAX2Parser::endElementNs(
+            const SDOXMLString& localname,
+            const SDOXMLString& prefix,
+            const SDOXMLString& URI)
+        {
+            LOGINFO_1( INFO,"SchemaParser:endElementNs:%s",(const char*)localname);
+
+            if (URI.equalsIgnoreCase("http://www.w3.org/2001/XMLSchema"))
+            {
+                if (localname.equalsIgnoreCase("schema"))
+                {
+                    bInSchema = false;
+                }
+
+                ///////////////////////////////////////////////////////////////////////
+                // Handle complexType
+                // Pop the Type off our stack
+                ///////////////////////////////////////////////////////////////////////
+                if (localname.equalsIgnoreCase("complexType"))
+                {
+                    defineType();
+                } // end complexType handling
+                else if (localname.equalsIgnoreCase("simpleType"))
+                {
+                    defineType();
+                }
+                
+                else if (localname.equalsIgnoreCase("schema"))
+                {
+                    defineType();
+                } // end complexType handling
+                
+                else if (localname.equalsIgnoreCase("element")
+                    || localname.equalsIgnoreCase("attribute"))
+                {
+                    // PropertyDefinition should now be complete
+                    defineProperty();
+                }
+                else if (localname.equalsIgnoreCase("choice") 
+                    || localname.equalsIgnoreCase("sequence")
+                    || localname.equalsIgnoreCase("all"))
+                {
+                    currentType.isMany = false;
+                }
+                
+            }
+        }
+        
+        
+        // ============================================================================
+        // startInclude
+        // ============================================================================
+        void SDOSchemaSAX2Parser::startInclude(
+            const SDOXMLString& localname,
+            const SDOXMLString& prefix,
+            const SDOXMLString& URI,
+            const SAX2Namespaces& namespaces,
+            const SAX2Attributes& attributes)
+        {        
+            LOGINFO_1( INFO,"SchemaParser:startInclude:%s",(const char*)localname);
+
+            if (!bInSchema) return;
+
+            SDOXMLString schemaLocation = attributes.getValue("schemaLocation");
+            if (!schemaLocation.isNull())
+            {
+                SchemaInfo schemaInf;
+                SDOSchemaSAX2Parser schemaParser(schemaInf, (ParserErrorSetter*)setter);
+
+                try 
+                {
+                    SDOXMLString sl = getCurrentFile();
+                    FILE *f;
+                    bool bprocessed = false;
+
+                    if (!sl.isNull()) 
+                    {
+                        int i = sl.lastIndexOf('/');
+                        if (i < 0)i = sl.lastIndexOf('\\');
+                        if (i >= 0)
+                        {
+                            sl = sl.substring(0,i+1) + schemaLocation;
+                            // first attempt, relative path plus the location
+                            f = fopen(sl,"r+");
+                            if (f != NULL)
+                            {
+                                fclose(f);
+                                schemaParser.parse(sl);
+                                bprocessed = true;
+                            }
+                            else // didnt find the file  
+                            {
+                                int j = schemaLocation.lastIndexOf('/');
+                                if (j < 0)j = schemaLocation.lastIndexOf('\\');
+                                if (j >= 0) 
+                                {
+                                    sl = sl.substring(0,i+1) + 
+                                     schemaLocation.substring(0,j+1);
+                                    f = fopen(sl,"r+");
+                                    if (f != NULL)
+                                    {
+                                        fclose(f);
+                                        schemaParser.parse(sl);
+                                        bprocessed = true;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    if (!bprocessed)
+                    {
+                        schemaParser.parse(schemaLocation);
+                    }
+                }
+
+                catch (SDOFileNotFoundException e)
+                {
+                    // finally give up - its not in the current path, or
+                    // in the path specified
+                    return;
+                }
+
+
+                TypeDefinitions& typedefs = schemaParser.getTypeDefinitions();
+                XMLDAS_TypeDefs types = typedefs.types;
+                XMLDAS_TypeDefs::iterator iter;
+                for (iter=types.begin(); iter != types.end(); iter++)
+                {    
+                    if ((*iter).second.name.equals("RootType")
+                        && currentType.name.equals("RootType")
+                        &&  (*iter).second.uri.equals(currentType.uri))
+                    {
+                        // This must be true for an import/include to be
+                        // legally positioned
+
+                        XMLDAS_TypeDefs::iterator find = typeDefinitions.types.find(
+                                (*iter).first);
+
+                        std::list<PropertyDefinition>::iterator propit;
+                        std::list<PropertyDefinition>::iterator currpropit;
+                        bool found;
+
+                        for (propit = (*iter).second.properties.begin() ; 
+                             propit != (*iter).second.properties.end(); ++ propit)
+                        {
+                                found = false;
+                             // do not merge properties whose names clash
+                             for ( currpropit = currentType.properties.begin();
+                                   currpropit != currentType.properties.end();
+                                   ++currpropit)
+                             {
+                                 if ((*currpropit).name.equals((*propit).name))
+                                 {
+                                     found = true;
+                                     break;
+                                 }
+                             }
+                             if (!found) 
+                             {
+                                currentType.properties.insert(
+                                     currentType.properties.end(),*propit);
+                             }
+                        }
+                    }
+                    else 
+                    {
+                        typeDefinitions.types.insert(*iter);
+                    }
+                }
+            }                
+        }
+
+        
+        // ============================================================================
+        // startElement
+        // ============================================================================
+        void SDOSchemaSAX2Parser::startElement(
+            const SDOXMLString& localname,
+            const SDOXMLString& prefix,
+            const SDOXMLString& URI,
+            const SAX2Namespaces& namespaces,
+            const SAX2Attributes& attributes)
+        {
+
+            if (!bInSchema) return;
+
+            PropertyDefinition thisProperty;
+
+            LOGINFO_1( INFO,"SchemaParser:startElement:%s",(const char*)localname);
+
+            thisProperty.isElement =  true;
+            
+            setName(attributes,
+                thisProperty.name,
+                thisProperty.localname);
+
+            
+            setType(thisProperty, attributes, namespaces);
+            
+            SDOXMLString maxOccurs = attributes.getValue("maxOccurs");
+            if (!maxOccurs.isNull())
+            {
+                if (!maxOccurs.equalsIgnoreCase("1"))
+                {
+                    thisProperty.isMany = true;
+                }
+            }
+
+            // find aliases
+            thisProperty.aliases = attributes.getValue("aliasName");
+            
+            // mark this as a substitution group.
+            // TODO - what about properties which have already been set into the tree,
+            // and might have a substitution?
+
+            SDOXMLString substituteName = attributes.getValue("substitutionGroup");
+            if (! substituteName.isNull())
+            {
+                XMLQName qname = resolveTypeName(
+                substituteName,
+                namespaces,
+                thisProperty.substituteUri,
+                thisProperty.substituteName);
+                thisProperty.isSubstitute=true;
+            }
+
+            // count the number of elements in the group
+            if (currentType.isMany)
+            {
+                currentType.groupElementCount++;
+            }
+            
+            setCurrentProperty(thisProperty);    
+            
+        }
+        
+        // ============================================================================
+        // startAttribute
+        // ============================================================================
+        void SDOSchemaSAX2Parser::startAttribute(
+            const SDOXMLString& localname,
+            const SDOXMLString& prefix,
+            const SDOXMLString& URI,
+            const SAX2Namespaces& namespaces,
+            const SAX2Attributes& attributes)
+        {
+
+            LOGINFO_1( INFO,"SchemaParser:startAttribute:%s",(const char*)localname);
+
+            if (!bInSchema) return;
+
+            PropertyDefinition thisProperty;
+            
+            thisProperty.isElement =  false;
+            
+            setName(attributes,
+                thisProperty.name,
+                thisProperty.localname);
+            
+            setType(thisProperty, attributes, namespaces);
+            
+            setCurrentProperty(thisProperty);                    
+        }
+        
+        // ============================================================================
+        // startComplexType
+        // ============================================================================
+        void SDOSchemaSAX2Parser::startComplexType(
+            const SDOXMLString& localname,
+            const SDOXMLString& prefix,
+            const SDOXMLString& URI,
+            const SAX2Namespaces& namespaces,
+            const SAX2Attributes& attributes)
+        {
+            LOGINFO_1( INFO,"SchemaParser:startComplexType:%s",(const char*)localname);
+
+            if (!bInSchema) return;
+
+            TypeDefinition thisType; // set defaults
+            thisType.uri=schemaInfo.getTargetNamespaceURI();
+            
+            setTypeName(thisType, attributes,namespaces);
+
+
+            
+            for (int i=0; i < attributes.size(); i++)
+            {
+                // If sdo:sequence="true" or mixed="true" it is sequenced
+                if ( (attributes[i].getUri().equalsIgnoreCase("commonj.sdo/xml")
+                    && attributes[i].getName().equalsIgnoreCase("sequence"))
+                    || attributes[i].getName().equalsIgnoreCase("mixed"))
+                {    
+                    if (attributes[i].getValue().equals("true"))
+                    {
+                        thisType.isSequenced = true;
+                    }
+                }
+                // If abstract="true" it is abstract
+                else if (attributes[i].getName().equalsIgnoreCase("abstract"))
+                {    
+                    if (attributes[i].getValue().equals("true"))
+                    {
+                        thisType.isAbstract = true;
+                    }
+                }
+                else if (attributes[i].getName().equalsIgnoreCase("aliasName"))
+                {
+                    thisType.aliases = attributes[i].getValue();
+                }
+            }
+            
+            setCurrentType(thisType);                
+        }
+        
+        // ============================================================================
+        // startSimpleType
+        // ============================================================================
+        void SDOSchemaSAX2Parser::startSimpleType(
+            const SDOXMLString& localname,
+            const SDOXMLString& prefix,
+            const SDOXMLString& URI,
+            const SAX2Namespaces& namespaces,
+            const SAX2Attributes& attributes)
+        {
+            LOGINFO_1( INFO,"SchemaParser:startSimpleType:%s",(const char*)localname);
+
+            if (!bInSchema) return;
+
+            TypeDefinition thisType; // set defaults
+            thisType.uri=schemaInfo.getTargetNamespaceURI();
+            thisType.dataType = true;
+            
+            for (int i=0; i < attributes.size(); i++)
+            {
+                // If abstract="true" it is abstract
+                if (attributes[i].getName().equalsIgnoreCase("abstract"))
+                {    
+                    if (attributes[i].getValue().equals("true"))
+                    {
+                        thisType.isAbstract = true;
+                    }
+                }
+                else if (attributes[i].getName().equalsIgnoreCase("aliasName"))
+                {
+                    thisType.aliases = attributes[i].getValue();
+                }
+            }
+            setTypeName(thisType, attributes,namespaces);
+
+            // see if the type is going to be abstract...
+
+            
+            setCurrentType(thisType);                
+        }
+        
+        // ============================================================================
+        // startRestriction
+        // ============================================================================
+        void SDOSchemaSAX2Parser::startRestriction(
+            const SDOXMLString& localname,
+            const SDOXMLString& prefix,
+            const SDOXMLString& URI,
+            const SAX2Namespaces& namespaces,
+            const SAX2Attributes& attributes)
+        {
+            LOGINFO_1( INFO,"SchemaParser:startRestriction:%s",(const char*)localname);
+
+            if (!bInSchema) return;
+
+            SDOXMLString base = attributes.getValue("base");
+            if (!base.isNull())
+            {
+                // Resolve typename to uri:name
+                XMLQName qname = resolveTypeName(
+                    base,
+                    namespaces,
+                    currentType.parentTypeUri,
+                    currentType.parentTypeName);
+
+
+                if(qname.getLocalName().equals("QName"))
+                {
+                    currentType.isQName = true;
+                }                    
+            }
+        }
+        
+        // ============================================================================
+        // startExtension
+        // ============================================================================
+        void SDOSchemaSAX2Parser::startExtension(
+            const SDOXMLString& localname,
+            const SDOXMLString& prefix,
+            const SDOXMLString& URI,
+            const SAX2Namespaces& namespaces,
+            const SAX2Attributes& attributes)
+        {
+            LOGINFO_1( INFO,"SchemaParser:startExtension:%s",(const char*)localname);
+
+            if (!bInSchema) return;
+
+            SDOXMLString base = attributes.getValue("base");
+            if (!base.isNull())
+            {
+                SDOXMLString typeUri;
+                SDOXMLString typeName;
+                // Resolve typename to uri:name
+                XMLQName qname = resolveTypeName(
+                    base,
+                    namespaces,
+                    typeUri,
+                    typeName);
+                
+                // If extending a simple type (an SDO DataType) we create a 
+                // Property named "value" of this type rather than set the
+                // simple type as a base
+                
+                // ?? Does this only apply within a <simpleContent> tag??
+                if (typeUri.equalsIgnoreCase(Type::SDOTypeNamespaceURI))
+                {
+                    // here the type needs to be flagged so that 
+                    // we know to serialize this property as an element with
+                    // just the contents <element>abc</element> rather than
+                    // value=abc
+
+
+                    PropertyDefinition thisProperty;
+                    thisProperty.name = "value";
+                    thisProperty.localname = "value";
+                    thisProperty.typeUri = typeUri; 
+                    thisProperty.typeName = typeName; 
+                    thisProperty.fullTypeName = base; 
+                    thisProperty.isContainment = false;
+                    thisProperty.isElement=true;
+
+                    currentType.isExtendedPrimitive= true;
+                                            
+                    if(qname.getLocalName().equals("QName"))
+                    {
+                        thisProperty.isQName = true;
+                    }                    
+
+                    setCurrentProperty(thisProperty);
+                    defineProperty();
+                } 
+                else
+                {
+                    currentType.parentTypeUri = typeUri;
+                    currentType.parentTypeName = typeName;
+                }
+            }
+        }
+        
+        // ============================================================================
+        // startGroup
+        // ============================================================================
+        void SDOSchemaSAX2Parser::startGroup(
+            const SDOXMLString& localname,
+            const SDOXMLString& prefix,
+            const SDOXMLString& URI,
+            const SAX2Namespaces& namespaces,
+            const SAX2Attributes& attributes)
+        {
+            LOGINFO_1( INFO,"SchemaParser:startGroup:%s",(const char*)localname);
+
+            if (!bInSchema) return;
+
+            SDOXMLString maxOccurs = attributes.getValue("maxOccurs");
+            if (!maxOccurs.isNull())
+            {
+                if (!maxOccurs.equalsIgnoreCase("1"))
+                {
+                    currentType.isMany = true;
+                }
+            }
+        }
+        
+        // ============================================================================
+        // setCurrentType
+        // ============================================================================
+        void SDOSchemaSAX2Parser::setCurrentType(const TypeDefinition& type)
+        {                
+            typeStack.push(currentType);
+            currentType = type;
+        }
+        
+        // ============================================================================
+        // defineType
+        // ============================================================================
+        void SDOSchemaSAX2Parser::defineType()
+        {    
+            // Set this Type as sequenced of more than one element in a group definition
+            if (currentType.groupElementCount > 1)
+            {
+                currentType.isSequenced = true;
+            }
+            
+            SDOXMLString typeQname = TypeDefinitions::getTypeQName(currentType.uri, currentType.localname);
+            typeDefinitions.types[typeQname] = currentType;
+            
+            if (currentProperty.typeName.isNull())
+            {
+                // Set the type name to the name of this type
+                currentProperty.typeUri = currentType.uri;
+                currentProperty.typeName = currentType.localname;
+            }
+            
+            if (typeStack.size() != 0)
+            {
+                currentType = typeStack.top();                
+                typeStack.pop();
+            }
+            else
+            {
+                currentType = TypeDefinition();
+            }
+        }
+        
+        // ============================================================================
+        // setCurrentProperty
+        // ============================================================================
+        void SDOSchemaSAX2Parser::setCurrentProperty(const PropertyDefinition& prop)
+        {                
+            propertyStack.push(currentProperty);
+            currentProperty = prop;
+        }
+        
+        // ============================================================================
+        // defineProperty
+        // ============================================================================
+        void SDOSchemaSAX2Parser::defineProperty()
+        {    
+
+            if (currentProperty.typeName.isNull())
+            {
+                // Set the type of this property to default (sdo:String)
+                currentProperty.typeUri = Type::SDOTypeNamespaceURI;
+                currentProperty.typeName = "String";
+            }
+
+            if (currentProperty.localname.isNull())
+                currentProperty.localname = currentProperty.typeName;
+
+            // Set isMany if property isMany OR if containing type isMany
+            // NOTE: The above comment is as per the SDO2.0 spec however this does not
+            // work when serializing a sequence containing a single-valued property and
+            // then deserializing.
+            // currentProperty.isMany = currentProperty.isMany || currentType.isMany;
+            
+            
+            currentType.properties.insert(currentType.properties.end(), currentProperty);
+            if (propertyStack.size() != 0)
+            {
+                currentProperty = propertyStack.top();                
+                propertyStack.pop();
+            }
+            else
+                currentProperty = PropertyDefinition();
+
+        }
+        
+        // ============================================================================
+        // setDefault
+        // ============================================================================
+        void SDOSchemaSAX2Parser::setDefault(
+            PropertyDefinition& thisProperty,
+            const SAX2Attributes& attributes)
+        {
+            thisProperty.defaultValue = attributes.getValue("fixed");
+            if (!thisProperty.defaultValue.isNull())
+            {
+                thisProperty.isReadOnly = true;
+            }
+            else
+            {
+                thisProperty.defaultValue = attributes.getValue("default");
+            }
+        }
+
+        // ============================================================================
+        // setName
+        // ============================================================================
+        void SDOSchemaSAX2Parser::setName(
+            const SAX2Attributes& attributes,
+            SDOXMLString& sdoname,
+            SDOXMLString& localname)
+        {
+            for (int i=0; i < attributes.size(); i++)
+            {
+                // Handle sdo: annotations
+                if (attributes[i].getUri().equalsIgnoreCase("commonj.sdo/xml"))
+                {
+                    // sdo:name overrides the property name
+                    if (attributes[i].getName().equalsIgnoreCase("name"))
+                    {
+                        sdoname = attributes[i].getValue();
+                    }
+                }
+                else
+                {
+                    
+                    if (attributes[i].getName().equalsIgnoreCase("name"))
+                    {
+                        localname  = attributes[i].getValue();
+                        // If name is already set it must have been an 
+                        // override using sdo:name
+                        if (sdoname.isNull())
+                        {
+                            sdoname  = localname;
+                        }
+                    }
+                }
+            }
+
+        }
+        
+        // ============================================================================
+        // setType
+        // ============================================================================
+        void SDOSchemaSAX2Parser::setType(
+            PropertyDefinition& property,
+            const SAX2Attributes& attributes,
+            const SAX2Namespaces& namespaces)
+        {
+            property.fullLocalTypeName = attributes.getValue("type");
+            if (!property.fullLocalTypeName.isNull())
+            {
+                XMLQName qname(property.fullLocalTypeName,schemaInfo.getSchemaNamespaces(), namespaces);
+                if (qname.getLocalName().equals("IDREF")
+                    || qname.getLocalName().equals("IDREFS"))
+                {
+                    property.fullTypeName = attributes.getValue("commonj.sdo/xml","propertyType");
+                    
+                    property.isIDREF = true;
+                    property.isContainment = false;
+                    
+                    if (qname.getLocalName().equals("IDREFS"))
+                    {
+                        property.isMany = true;
+                    }
+                }
+                else if (qname.getLocalName().equals("anyURI"))
+                {
+                    property.fullTypeName = attributes.getValue("commonj.sdo/xml","propertyType");
+                }
+                else if (qname.getLocalName().equals("ID"))
+                {
+                    property.isID = true;
+                    currentType.IDPropertyName = property.name;
+                }
+
+                else
+                {
+                    property.fullTypeName = attributes.getValue("commonj.sdo/xml","dataType");
+                }
+            }
+            
+            else 
+            {
+                property.fullLocalTypeName = attributes.getValue("ref");
+                if (!property.fullLocalTypeName.isNull())
+                {
+                    property.isReference = true;
+                }
+            }
+            
+            if (property.fullTypeName.isNull())
+            {
+                property.fullTypeName = property.fullLocalTypeName;
+            }
+            
+            if (!property.fullTypeName.isNull())
+            {
+                // Resolve typename to uri:name
+                XMLQName qname = resolveTypeName(
+                    property.fullTypeName,
+                    namespaces,
+                    property.typeUri,
+                    property.typeName);
+
+                if(qname.getLocalName().equals("QName"))
+                {
+                    property.isQName = true;
+                }                    
+            }
+            
+        }
+        
+        // ============================================================================
+        // setTypeName
+        // ============================================================================
+        void SDOSchemaSAX2Parser::setTypeName(
+            TypeDefinition& type,
+            const SAX2Attributes& attributes,
+            const SAX2Namespaces& namespaces)
+        {
+            std::map<SDOXMLString,SDOXMLString>::iterator it;
+            setName(attributes, type.name, type.localname);
+            // If localname is not set it is anonymous so use the enclosing element name
+
+
+            if (type.localname.isNull())
+            {
+                type.localname = currentProperty.name;
+            }
+            else
+            {
+                // check for an overriding url in the name
+                int i;
+                if ((i = type.localname.firstIndexOf(':')) > 0)
+                {
+                    XMLQName qname(type.localname, 
+                    schemaInfo.getSchemaNamespaces(),
+                    namespaces);
+                    type.uri = qname.getURI();
+                    type.localname = qname.getLocalName();
+                }
+            }
+            
+            // Set SDO name if not specified
+            if (type.name .isNull())
+            {
+                type.name  = type.localname ;
+            }
+            else
+            {
+                // check for an overriding url in the name
+                int i;
+                if ((i = type.name.firstIndexOf(':')) > 0)
+                {
+                    XMLQName qname(type.name, 
+                    schemaInfo.getSchemaNamespaces(),
+                    namespaces);
+                    type.uri = qname.getURI();
+                    type.name = qname.getLocalName();
+                }
+            }
+        }
+        
+        std::istream& operator>>(std::istream& input, SDOSchemaSAX2Parser& parser)
+        {
+            parser.stream(input);
+            
+            return input;
+        }
+        
+        std::istringstream& operator>>(std::istringstream& input, SDOSchemaSAX2Parser& parser)
+        {
+            parser.stream(input);
+            
+            return input;
+        }
+
+        // ============================================================================
+        // resolveTypeName
+        // ============================================================================
+        XMLQName SDOSchemaSAX2Parser::resolveTypeName(
+            const SDOXMLString& fullTypeName,
+            const SAX2Namespaces& namespaces,
+            SDOXMLString& uri,
+            SDOXMLString& name) 
+        {
+            XMLQName qname(fullTypeName, 
+                schemaInfo.getSchemaNamespaces(),
+                namespaces);
+
+            uri = qname.getURI();
+            name = qname.getLocalName();
+
+            ///////////////////////////////////////////////////////////////////////
+            // Map the xsd types to SDO Types
+            ///////////////////////////////////////////////////////////////////////
+            if (qname.getURI().equalsIgnoreCase("http://www.w3.org/2001/XMLSchema"))
+            {
+                uri = Type::SDOTypeNamespaceURI;
+                if (qname.getLocalName().equalsIgnoreCase("string"))
+                {
+                    name = "String";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("anyType"))
+                {
+                    name = "DataObject";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("int"))
+                {
+                    name = "Integer";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("integer"))
+                {
+                    name = "Integer";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("negativeInteger"))
+                {
+                    name = "Integer";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("nonNegativeInteger"))
+                {
+                    name = "Integer";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("positiveInteger"))
+                {
+                    name = "Integer";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("nonPositiveInteger"))
+                {
+                    name = "Integer";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("unsignedLong"))
+                {
+                    name = "Integer";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("unsignedShort"))
+                {
+                    name = "Integer";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("unsignedInt"))
+                {
+                    name = "Long";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("long"))
+                {
+                    name = "Long";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("double"))
+                {
+                    name = "Double";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("short"))
+                {
+                    name = "Short";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("unsignedByte"))
+                {
+                    name = "Short";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("float"))
+                {
+                    name = "Float";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("boolean"))
+                {
+                    name = "Boolean";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("byte"))
+                {
+                    name = "Byte";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("base64Binary"))
+                {
+                    name = "Bytes";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("hexBinary"))
+                {
+                    name = "Bytes";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("anyURI"))
+                {
+                    name = "URI";
+                }
+                else if (qname.getLocalName().equalsIgnoreCase("QName"))
+                {
+                    name = "URI";
+                }
+                else
+                {
+                    // Default unknown xs: types to string??
+                    name = "String";
+                }
+            }
+            
+            // Temporary hack: ChangeSummaryType is ChangeSummary in core
+            else if (qname.getURI().equalsIgnoreCase(Type::SDOTypeNamespaceURI))
+            {
+                if (qname.getLocalName().equalsIgnoreCase("ChangeSummaryType"))
+                {
+                    name = "ChangeSummary";
+                }
+                
+            }
+            else if (qname.getURI().isNull())
+            {
+                uri = schemaInfo.getTargetNamespaceURI();
+            }
+
+            return qname;
+        }
+        
+    } // End - namespace sdo
+    
+} // End - namespace commonj
+

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.h?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.h (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.h Thu Jan  5 02:55:00 2006
@@ -0,0 +1,181 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#ifndef _SDOSCHEMASAX2PARSER_H_
+#define _SDOSCHEMASAX2PARSER_H_
+
+#include "commonj/sdo/disable_warn.h"
+
+#include "commonj/sdo/SAX2Parser.h"
+#include "commonj/sdo/SchemaInfo.h"
+#include "stack"
+#include "commonj/sdo/TypeDefinitions.h"
+#include "commonj/sdo/XMLQName.h"
+#include "commonj/sdo/ParserErrorSetter.h"
+
+namespace commonj
+{
+    namespace sdo
+    {
+        
+/**
+ * SDOSAX2Parser implements SAX2Parser.
+ * This class gets called back by the libxml library, and
+ * deals with the creation of metadata objects from XSD.
+ */
+        
+        class SDOSchemaSAX2Parser : public SAX2Parser
+        {
+            
+        public:
+            
+            SDOSchemaSAX2Parser(SchemaInfo& schemaInfo,
+                ParserErrorSetter* insetter);
+            
+            virtual ~SDOSchemaSAX2Parser();
+
+        
+            virtual void startElementNs(
+                const SDOXMLString& localname,
+                const SDOXMLString& prefix,
+                const SDOXMLString& URI,
+                const SAX2Namespaces& namespaces,
+                const SAX2Attributes& attributes);            
+            
+            virtual void endElementNs(
+                const SDOXMLString& localname,
+                const SDOXMLString& prefix,
+                const SDOXMLString& URI);
+            
+            const SDOXMLString& getTargetNamespaceURI() const {return schemaInfo.getTargetNamespaceURI();}
+            
+            TypeDefinitions& getTypeDefinitions() {return typeDefinitions;}
+            
+            friend std::istream& operator>>(std::istream& input, SDOSchemaSAX2Parser& parser);
+            friend std::istringstream& operator>>(std::istringstream& input, SDOSchemaSAX2Parser& parser);
+
+
+        private:
+
+            const char* currentFile;
+            bool bInSchema; // only parse when within a schema
+
+        
+            virtual void startInclude(
+                const SDOXMLString& localname,
+                const SDOXMLString& prefix,
+                const SDOXMLString& URI,
+                const SAX2Namespaces& namespaces,
+                const SAX2Attributes& attributes);            
+
+            virtual void startElement(
+                const SDOXMLString& localname,
+                const SDOXMLString& prefix,
+                const SDOXMLString& URI,
+                const SAX2Namespaces& namespaces,
+                const SAX2Attributes& attributes);            
+            
+            virtual void startAttribute(
+                const SDOXMLString& localname,
+                const SDOXMLString& prefix,
+                const SDOXMLString& URI,
+                const SAX2Namespaces& namespaces,
+                const SAX2Attributes& attributes);            
+            
+            virtual void startComplexType(
+                const SDOXMLString& localname,
+                const SDOXMLString& prefix,
+                const SDOXMLString& URI,
+                const SAX2Namespaces& namespaces,
+                const SAX2Attributes& attributes);            
+            
+            virtual void startSimpleType(
+                const SDOXMLString& localname,
+                const SDOXMLString& prefix,
+                const SDOXMLString& URI,
+                const SAX2Namespaces& namespaces,
+                const SAX2Attributes& attributes);            
+            
+            virtual void startRestriction(
+                const SDOXMLString& localname,
+                const SDOXMLString& prefix,
+                const SDOXMLString& URI,
+                const SAX2Namespaces& namespaces,
+                const SAX2Attributes& attributes);            
+            
+            virtual void startExtension(
+                const SDOXMLString& localname,
+                const SDOXMLString& prefix,
+                const SDOXMLString& URI,
+                const SAX2Namespaces& namespaces,
+                const SAX2Attributes& attributes);            
+            
+            virtual void startGroup(
+                const SDOXMLString& localname,
+                const SDOXMLString& prefix,
+                const SDOXMLString& URI,
+                const SAX2Namespaces& namespaces,
+                const SAX2Attributes& attributes);            
+            
+            XMLQName resolveTypeName(
+                const SDOXMLString& fullTypeName,
+                const SAX2Namespaces& namespaces,
+                SDOXMLString& uri,
+                SDOXMLString& name);
+            
+            void setName(
+                const SAX2Attributes& attributes,
+                SDOXMLString& sdoname,
+                SDOXMLString& localname
+                );
+            
+            void setType(
+                PropertyDefinition& property,
+                const SAX2Attributes& attributes,
+                const SAX2Namespaces& namespaces);
+            
+            void setTypeName(
+                TypeDefinition& type,
+                const SAX2Attributes& attributes,
+                const SAX2Namespaces& namespaces);
+            
+            void setDefault(
+                PropertyDefinition& thisProperty,
+                const SAX2Attributes& attributes);
+            
+            
+            SchemaInfo& schemaInfo;
+            
+            
+            PropertyDefinition currentProperty;
+            std::stack<PropertyDefinition>    propertyStack;
+            void             setCurrentProperty(const PropertyDefinition& property);
+            void             defineProperty();
+            
+            TypeDefinition   currentType;
+            std::stack<TypeDefinition>    typeStack;
+            void             setCurrentType(const TypeDefinition& type);
+            void             defineType();
+            
+            TypeDefinitions typeDefinitions;
+            
+        };
+    } // End - namespace sdo
+} // End - namespace commonj
+#endif //_SDOSCHEMASAX2PARSER_H_

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOUtils.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOUtils.cpp?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOUtils.cpp (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOUtils.cpp Thu Jan  5 02:55:00 2006
@@ -0,0 +1,142 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#include "commonj/sdo/SDOUtils.h"
+
+using namespace std;
+
+//
+// Utility methods to print a DataObject tree
+//
+
+namespace commonj {
+    namespace sdo {
+
+
+
+//////////////////////////////////////////////////////////////////////////
+// Print Tabs
+//////////////////////////////////////////////////////////////////////////
+
+        void SDOUtils::printTabs(unsigned int incr)
+        {
+            for (int ind=0; ind < incr; ind++)
+            {
+                cout << "  ";
+            }
+        }
+
+//////////////////////////////////////////////////////////////////////////
+// Print a DatObject tree
+//////////////////////////////////////////////////////////////////////////
+
+        void SDOUtils::printDataObject(DataObjectPtr dataObject)
+        {
+            printDataObject(dataObject,0);
+        }
+
+
+        void SDOUtils::printDataObject(DataObjectPtr dataObject,
+            unsigned int incr)
+        {
+    
+            cout << ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start of DO" 
+                 << endl;
+    
+            if (!dataObject)return;
+
+            const Type& dataObjectType = dataObject->getType();
+            printTabs(incr);
+            cout << "DataObject type: " 
+                 << dataObjectType.getURI() 
+                 << "#" << dataObjectType.getName() << endl;
+    
+            incr++;
+    
+            //////////////////////////////////////////////////////////////
+            // Iterate over all the properties
+            //////////////////////////////////////////////////////////////
+            PropertyList pl = dataObject->getInstanceProperties();
+            for (int i = 0; i < pl.size(); i++)
+            {
+                printTabs(incr);
+                cout << "Property: " << pl[i].getName() << endl;
+        
+                const Type& propertyType = pl[i].getType();
+        
+                printTabs(incr);
+
+                cout << "Property Type: " 
+                     << propertyType.getURI() 
+                     << "#" << propertyType.getName() << endl;
+        
+                if (dataObject->isSet(pl[i]))
+                {
+            
+                    ///////////////////////////////////////////////////////////
+                    // For a many-valued property get the list of values
+                    ///////////////////////////////////////////////////////////
+                    if (pl[i].isMany())
+                    {
+                        incr++;
+                        DataObjectList& dol = dataObject->getList(pl[i]);
+                        for (int j = 0; j <dol.size(); j++)
+                        {
+                            printTabs(incr);
+                            cout << "Value " << j <<endl;
+                            incr++;
+                            printDataObject(dol[j],incr);
+                            incr--;
+                            cout << endl;
+                        }
+                        incr--;
+                    } // end IsMany
+        
+                    //////////////////////////////////////////////////////////////////////
+                    // For a primitive data type print the value
+                    //////////////////////////////////////////////////////////////////////
+                    else if (propertyType.isDataType())
+                    {
+                        printTabs(incr);
+                        cout<< "Property Value: " 
+                            << dataObject->getCString(pl[i]) <<endl ; 
+                    }
+            
+                    //////////////////////////////////////////////////////////////////////
+                    // For a dataobject print the do
+                    //////////////////////////////////////////////////////////////////////
+                    else
+                    {
+                        incr++;
+                        printDataObject(dataObject->getDataObject(pl[i]),incr);
+                        incr--;
+                    }
+                }
+                else
+                {
+                    printTabs(incr);
+                    cout << "Property Value: not set" <<endl ; 
+                }
+        
+            }
+            incr--;
+            cout << "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end of do" << endl;
+        }
+    };
+};

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOUtils.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOUtils.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOUtils.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOUtils.h?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOUtils.h (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOUtils.h Thu Jan  5 02:55:00 2006
@@ -0,0 +1,51 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#ifndef _SDOUTILS_H_
+#define _SDOUTILS_H_
+
+#include "commonj/sdo/DataObject.h"
+
+namespace commonj
+{
+    namespace sdo
+    {
+        
+
+    /**
+     * SDOUtils will provide utility functions.
+     * The class currently holds a method to print data objects.
+     */
+
+    class SDOUtils
+        {
+            
+        public:
+            
+            static SDO_API void printDataObject(DataObjectPtr d);                
+            
+        private:
+            static void printDataObject(DataObjectPtr d, unsigned int incr);                
+            static void printTabs(unsigned int incr);
+        };
+    } // End - namespace sdo
+} // End - namespace commonj
+
+
+#endif //_SDOUTILS_H_

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOUtils.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOUtils.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLBufferWriter.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLBufferWriter.cpp?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLBufferWriter.cpp (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLBufferWriter.cpp Thu Jan  5 02:55:00 2006
@@ -0,0 +1,55 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#include "commonj/sdo/SDOXMLBufferWriter.h"
+#include "commonj/sdo/SDORuntimeException.h"
+
+namespace commonj
+{
+    namespace sdo
+    {
+        
+        
+        
+        
+        SDOXMLBufferWriter::SDOXMLBufferWriter(DataFactoryPtr dataFactory)
+            : SDOXMLWriter(dataFactory)
+        {
+            buf = xmlBufferCreate();
+            if (buf == NULL)
+            {
+                SDO_THROW_EXCEPTION("SDOXMLBufferWriter", SDOXMLParserException, "xmlBufferCreate failed");
+            }
+            setWriter(xmlNewTextWriterMemory(buf, 0));                
+        }
+        
+        SDOXMLBufferWriter::~SDOXMLBufferWriter()
+        {    
+            freeWriter();
+            xmlBufferFree(buf);
+        }
+        
+        SDOXMLString SDOXMLBufferWriter::getBuffer()
+        {
+            freeWriter();
+            return buf->content;
+        }            
+    } // End - namespace sdo
+} // End - namespace commonj
+

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLBufferWriter.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLBufferWriter.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLBufferWriter.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLBufferWriter.h?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLBufferWriter.h (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLBufferWriter.h Thu Jan  5 02:55:00 2006
@@ -0,0 +1,51 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#ifndef _SDOXMLBUFFERWRITER_H_
+#define _SDOXMLBUFFERWRITER_H_
+
+#include "commonj/sdo/disable_warn.h"
+
+#include "commonj/sdo/SDOXMLWriter.h"
+
+namespace commonj
+{
+    namespace sdo
+    {
+        
+/** 
+ * SDOXMLBufferWriter extends SDOXMLWriter and writes a buffer.
+ */
+        class SDOXMLBufferWriter : public SDOXMLWriter
+        {
+            
+        public:
+            
+            SDOXMLBufferWriter(DataFactoryPtr dataFactory = NULL);                
+            virtual ~SDOXMLBufferWriter();
+            
+            SDOXMLString getBuffer();
+        private:
+            xmlBufferPtr buf;
+        };
+    } // End - namespace sdo
+} // End - namespace commonj
+
+
+#endif //_SDOXMLBUFFERWRITER_H_

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLBufferWriter.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLBufferWriter.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLFileWriter.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLFileWriter.cpp?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLFileWriter.cpp (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLFileWriter.cpp Thu Jan  5 02:55:00 2006
@@ -0,0 +1,44 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#include "commonj/sdo/SDOXMLFileWriter.h"
+
+namespace commonj
+{
+    namespace sdo
+    {
+        
+        
+        
+        
+        SDOXMLFileWriter::SDOXMLFileWriter(const char* xmlFile, DataFactoryPtr dataFactory)
+            : SDOXMLWriter(dataFactory)
+        {
+            setWriter(xmlNewTextWriterFilename(xmlFile, 0));
+        }
+        
+        SDOXMLFileWriter::~SDOXMLFileWriter()
+        {
+        
+        }
+        
+        
+    } // End - namespace sdo
+} // End - namespace commonj
+

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLFileWriter.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLFileWriter.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLFileWriter.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLFileWriter.h?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLFileWriter.h (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLFileWriter.h Thu Jan  5 02:55:00 2006
@@ -0,0 +1,52 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#ifndef _SDOXMLFILEWRITER_H_
+#define _SDOXMLFILEWRITER_H_
+
+#include "commonj/sdo/disable_warn.h"
+
+#include "commonj/sdo/SDOXMLWriter.h"
+
+
+
+namespace commonj
+{
+    namespace sdo
+    {
+        
+/** 
+ * SDOXMLFileWriter extends SDOXMLWriter and writes a file.
+ */
+        class SDOXMLFileWriter : public SDOXMLWriter
+        {
+            
+        public:
+            
+            SDOXMLFileWriter(const char* xmlFile, DataFactoryPtr dataFactory = NULL);
+            
+            virtual ~SDOXMLFileWriter();
+    
+            
+        };
+    } // End - namespace sdo
+} // End - namespace commonj
+
+
+#endif //_SDOXMLFILEWRITER_H_

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLFileWriter.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLFileWriter.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLStreamWriter.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLStreamWriter.cpp?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLStreamWriter.cpp (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLStreamWriter.cpp Thu Jan  5 02:55:00 2006
@@ -0,0 +1,50 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#include "commonj/sdo/SDOXMLStreamWriter.h"
+#include <sstream>
+
+namespace commonj
+{
+    namespace sdo
+    {
+        
+        
+        
+        
+        SDOXMLStreamWriter::SDOXMLStreamWriter(std::ostream& outXML, DataFactoryPtr dataFactory)
+            : SDOXMLBufferWriter(dataFactory), outXmlStream(outXML)
+        {
+        }
+        
+        SDOXMLStreamWriter::~SDOXMLStreamWriter()
+        {    
+        }
+        
+        int SDOXMLStreamWriter::write(XMLDocumentPtr doc)
+        {
+            int rc = SDOXMLBufferWriter::write(doc);
+
+            // Now stream the buffer
+            outXmlStream << getBuffer();
+            return rc;
+        }            
+    } // End - namespace sdo
+} // End - namespace commonj
+

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLStreamWriter.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLStreamWriter.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLStreamWriter.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLStreamWriter.h?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLStreamWriter.h (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLStreamWriter.h Thu Jan  5 02:55:00 2006
@@ -0,0 +1,54 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#ifndef _SDOXMLSTREAMWRITER_H_
+#define _SDOXMLSTREAMWRITER_H_
+
+#include "commonj/sdo/disable_warn.h"
+
+#include "commonj/sdo/SDOXMLBufferWriter.h"
+#include <iostream>
+
+
+namespace commonj
+{
+    namespace sdo
+    {
+        
+/** 
+ * SDOXMLStreamWriter extends SDOXMLWriter and writes a stream.
+ */
+        class SDOXMLStreamWriter : public SDOXMLBufferWriter
+        {
+            
+        public:
+            
+            SDOXMLStreamWriter(std::ostream& outXML, DataFactoryPtr dataFactory = NULL);                
+            virtual ~SDOXMLStreamWriter();
+            
+            int write(XMLDocumentPtr doc);
+        private:
+            std::ostream& outXmlStream;
+            
+        };
+    } // End - namespace sdo
+} // End - namespace commonj
+
+
+#endif //_SDOXMLSTREAMWRITER_H_

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLStreamWriter.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLStreamWriter.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLString.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLString.cpp?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLString.cpp (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLString.cpp Thu Jan  5 02:55:00 2006
@@ -0,0 +1,221 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#include "commonj/sdo/SDOXMLString.h"
+#include <iostream>
+#include "libxml/globals.h"
+
+namespace commonj
+{
+    namespace sdo
+    {
+        
+        SDOXMLString::SDOXMLString()
+            : xmlForm(0)
+        {
+        }
+        
+        SDOXMLString::SDOXMLString(const xmlChar* xmlString)
+        {
+            xmlForm = xmlStrdup(xmlString);
+        }
+        
+        SDOXMLString::SDOXMLString(const char* localString)
+        {
+            xmlForm = xmlCharStrdup(localString);
+        }
+        
+        SDOXMLString::SDOXMLString(const SDOXMLString& str)
+        {
+            xmlForm = xmlStrdup(str.xmlForm);
+        }
+        
+        SDOXMLString::SDOXMLString(const xmlChar* str, int start, int len)
+        {
+            xmlForm = xmlStrsub(str, start, len);
+        }
+        
+        SDOXMLString& SDOXMLString::operator=(const SDOXMLString& str)
+        {
+            if (this != &str)
+            {
+                release();
+                xmlForm = xmlStrdup(str.xmlForm);
+            }
+            return *this;
+        }
+
+        SDOXMLString SDOXMLString::operator+(const SDOXMLString& str) const
+        {
+            xmlChar* newString = xmlStrncatNew(xmlForm, str.xmlForm, xmlStrlen(str.xmlForm));
+            SDOXMLString retString(newString);
+            if (newString)
+                xmlFree(newString);
+            return retString;
+        }
+
+        SDOXMLString& SDOXMLString::operator+=(const SDOXMLString& str)
+        {
+            xmlForm = xmlStrncat(xmlForm, str.xmlForm, xmlStrlen(str.xmlForm));
+            return *this;
+        }
+        
+        SDOXMLString::~SDOXMLString()
+        {
+            release();
+        }
+        
+        void SDOXMLString::release()
+        {
+            if (xmlForm)
+                xmlFree((void*)xmlForm);
+        }
+        
+        bool SDOXMLString::operator< (const SDOXMLString& str) const
+        {
+            if (xmlStrcmp(xmlForm, str.xmlForm) <0)
+                return true;
+            else
+                return false;
+        }
+        
+        bool SDOXMLString::operator==(const SDOXMLString& str) const
+        {
+            if (xmlStrEqual(xmlForm, str.xmlForm))
+                return true;
+            else
+                return false;
+        }
+
+        bool SDOXMLString::equals(const SDOXMLString& str) const
+        {
+            return equals(str.xmlForm);
+        }
+        
+        bool SDOXMLString::equals(const char* localString) const
+        {
+            return equals(SDOXMLString(localString));
+        }
+        
+
+        bool SDOXMLString::equals(const xmlChar* xmlString) const
+        {
+            if (xmlStrEqual(xmlForm, xmlString))
+                return true;
+            else
+                return false;
+        }
+        
+        bool SDOXMLString::equalsIgnoreCase(const SDOXMLString& str) const
+        {
+            return equalsIgnoreCase(str.xmlForm);
+        }
+        
+        bool SDOXMLString::equalsIgnoreCase(const char* localString) const
+        {
+            return equalsIgnoreCase(SDOXMLString(localString));
+        }
+        
+
+        bool SDOXMLString::equalsIgnoreCase(const xmlChar* xmlString) const
+        {
+            if (xmlStrcasecmp(xmlForm, xmlString) == 0)
+                return true;
+            else
+                return false;
+        }
+        
+        
+        std::ostream& operator<<(std::ostream& output, const SDOXMLString& str)
+        {
+            if (str.xmlForm)
+                output << str.xmlForm;
+            return output;
+        }
+        
+        bool SDOXMLString::isNull() const
+        {
+            if (xmlForm)
+                return false;
+            else
+                return true;
+        }
+
+        SDOXMLString SDOXMLString::toLower(unsigned int start, unsigned int length)
+        {
+            char* newString = new char[strlen(*this)+1];
+            strcpy(newString, *this);
+            for (int i = start; (i<=(strlen(newString)) && i < length); i++)
+            {
+                newString[i] = tolower(newString[i]);
+            }
+            SDOXMLString retString(newString);
+            delete newString;
+            return retString;
+        }
+
+        int SDOXMLString::firstIndexOf(const char ch) const
+        {
+            const xmlChar* loc = xmlStrchr(xmlForm, ch);
+            if (loc == 0)
+            {
+                return -1;
+            }
+            
+            return int(loc-xmlForm);
+        }
+        
+        int SDOXMLString::lastIndexOf(const char ch) const
+        {
+            const xmlChar* index = 0;
+            const xmlChar* loc = xmlStrchr(xmlForm, ch);
+            while (loc !=0)
+            {
+                index = loc;
+                loc = xmlStrchr(loc+1, ch);
+            }
+            
+            if (index == 0)
+                return -1;
+
+            return int(index-xmlForm);
+        }
+        
+        SDOXMLString SDOXMLString::substring(int start, int length) const
+        {
+            if (length >0)
+            {
+                return xmlStrsub(xmlForm, start, length);
+            }
+            else
+                return SDOXMLString();
+        }
+        
+        SDOXMLString SDOXMLString::substring(int start) const
+        {
+            
+            return xmlStrsub(xmlForm, start, xmlStrlen(xmlForm) - start);
+        }
+        
+        
+    } // End - namespace sdo
+} // End - namespace commonj
+
+
+

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLString.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLString.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLString.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLString.h?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLString.h (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLString.h Thu Jan  5 02:55:00 2006
@@ -0,0 +1,91 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#include "commonj/sdo/disable_warn.h"
+
+#ifndef _SDOXMLString_H_
+#define _SDOXMLString_H_
+#include "commonj/sdo/export.h"
+
+#include <libxml/xmlstring.h>
+#include <iostream>
+
+namespace commonj
+{
+    namespace sdo
+    {
+    /** 
+    * SDOXMLString - utility class for string handling.
+    * Keeps the string handling local to one place, so we can 
+    * replace it with a more NLS friendly version later.
+    * Many places within the core should use this too instead
+    * of allocated char* buffers. (DataObject etc...)
+    */
+            
+        class SDOXMLString
+        {
+        public:
+            SDO_SPI SDOXMLString();
+            SDO_SPI SDOXMLString(const xmlChar* xmlString);
+            SDO_SPI SDOXMLString(const char* localString);
+            SDO_SPI SDOXMLString(const SDOXMLString& str);    
+            SDO_SPI SDOXMLString(const xmlChar* str, int start, int len);    
+            SDO_SPI virtual ~SDOXMLString();
+            
+            SDO_SPI SDOXMLString& operator=(const SDOXMLString& str);
+            SDO_SPI SDOXMLString operator+(const SDOXMLString& str) const;
+            SDO_SPI SDOXMLString& operator+=(const SDOXMLString& str);
+            
+    
+            SDO_SPI bool operator== (const SDOXMLString& str) const;
+            SDO_SPI bool equals(const xmlChar* xmlString) const;
+            SDO_SPI bool equals(const char* localString) const;
+            SDO_SPI bool equals(const SDOXMLString& str) const;
+            SDO_SPI bool equalsIgnoreCase(const xmlChar* xmlString) const;
+            SDO_SPI bool equalsIgnoreCase(const char* localString) const;
+            SDO_SPI bool equalsIgnoreCase(const SDOXMLString& str) const;
+
+            SDO_SPI bool operator< (const SDOXMLString& str) const;
+            
+            SDO_SPI operator const char*() const {return (const char*) xmlForm;}
+            SDO_SPI operator const xmlChar*() const {return xmlForm;}
+            
+            SDO_SPI friend std::ostream& operator<<(std::ostream& output, const SDOXMLString& str);
+            
+            SDO_SPI bool isNull() const;
+
+            SDO_SPI SDOXMLString toLower(
+                unsigned int start = 0, 
+                unsigned int length = 0);
+
+
+            SDO_SPI int firstIndexOf(const char ch) const;
+            SDO_SPI int lastIndexOf(const char ch) const;
+            SDO_SPI SDOXMLString substring(int start, int length) const;
+            SDO_SPI SDOXMLString substring(int start) const;
+        private :
+            xmlChar* xmlForm;
+            void release();                
+        };
+    } // End - namespace sdo
+} // End - namespace commonj
+
+
+
+#endif // _SDOXMLString_H_

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLString.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLString.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date



Mime
View raw message