You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ed...@apache.org on 2006/05/16 13:05:19 UTC
svn commit: r406906 - in /incubator/tuscany/cpp/sdo: projects/tuscany_sdo/
projects/tuscany_sdo/sdo_axiom/ runtime/core/sdo_axiom/
runtime/core/src/commonj/sdo/
Author: edslattery
Date: Tue May 16 04:05:12 2006
New Revision: 406906
URL: http://svn.apache.org/viewcvs?rev=406906&view=rev
Log:
changes for axis 0.91 plus change to make include work with php
Modified:
incubator/tuscany/cpp/sdo/projects/tuscany_sdo/sdo_axiom/sdo_axiom.dsp
incubator/tuscany/cpp/sdo/projects/tuscany_sdo/tuscany_sdo.ncb
incubator/tuscany/cpp/sdo/projects/tuscany_sdo/tuscany_sdo.opt
incubator/tuscany/cpp/sdo/runtime/core/sdo_axiom/sdo_axiom.cpp
incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp
incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.h
Modified: incubator/tuscany/cpp/sdo/projects/tuscany_sdo/sdo_axiom/sdo_axiom.dsp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/projects/tuscany_sdo/sdo_axiom/sdo_axiom.dsp?rev=406906&r1=406905&r2=406906&view=diff
==============================================================================
--- incubator/tuscany/cpp/sdo/projects/tuscany_sdo/sdo_axiom/sdo_axiom.dsp (original)
+++ incubator/tuscany/cpp/sdo/projects/tuscany_sdo/sdo_axiom/sdo_axiom.dsp Tue May 16 04:05:12 2006
@@ -79,10 +79,10 @@
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 axis2c_parser.lib axis2c_util.lib axis2c_om.lib tuscany_sdo.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"Debug/tuscany_sdo_axiom.dll" /pdbtype:sept /libpath:"..\..\..\lib" /libpath:"$(AXIS2C_HOME)\lib"
+# ADD LINK32 axis2_parser.lib axis2_util.lib axis2_om.lib tuscany_sdo.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"Debug/tuscany_sdo_axiom.dll" /pdbtype:sept /libpath:"..\..\..\lib" /libpath:"$(AXIS2C_HOME)\lib"
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Debug\tuscany_sdo_axiom.dll ..\..\..\bin copy Debug\tuscany_sdo_axiom.pdb ..\..\..\bin copy Debug\tuscany_sdo_axiom.lib ..\..\..\lib copy ..\..\..\runtime\core\sdo_axiom\sdo_axiom.h ..\..\..\include\ copy ..\..\..\runtime\core\sdo_axiom\sdo_axiom_export.h ..\..\..\include\
+PostBuild_Cmds=copy Debug\tuscany_sdo_axiom.dll ..\..\..\bin copy Debug\tuscany_sdo_axiom.pdb ..\..\..\bin copy Debug\tuscany_sdo_axiom.lib ..\..\..\lib copy ..\..\..\runtime\core\sdo_axiom\sdo_axiom.h ..\..\..\include\ copy ..\..\..\runtime\core\sdo_axiom\sdo_axiom_export.h ..\..\..\include\
# End Special Build Tool
!ENDIF
Modified: incubator/tuscany/cpp/sdo/projects/tuscany_sdo/tuscany_sdo.ncb
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/projects/tuscany_sdo/tuscany_sdo.ncb?rev=406906&r1=406905&r2=406906&view=diff
==============================================================================
Binary files - no diff available.
Modified: incubator/tuscany/cpp/sdo/projects/tuscany_sdo/tuscany_sdo.opt
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/projects/tuscany_sdo/tuscany_sdo.opt?rev=406906&r1=406905&r2=406906&view=diff
==============================================================================
Binary files - no diff available.
Modified: incubator/tuscany/cpp/sdo/runtime/core/sdo_axiom/sdo_axiom.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/sdo_axiom/sdo_axiom.cpp?rev=406906&r1=406905&r2=406906&view=diff
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/sdo_axiom/sdo_axiom.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/sdo_axiom/sdo_axiom.cpp Tue May 16 04:05:12 2006
@@ -116,10 +116,15 @@
// if (str) cout << str << endl;
axis2_xml_reader_t * reader =
- axis2_xml_reader_create_for_buffer(&the_env,
- (const axis2_char_t *)str,
+ // axis2_xml_reader_create_for_buffer(&the_env,
+ // (const axis2_char_t *)str,
+ // strlen(str),
+ // (const axis2_char_t *)"UTF-8");
+ axis2_xml_reader_create_for_memory(&the_env,
+ (void*)str,
strlen(str),
- (const axis2_char_t *)"UTF-8");
+ (const axis2_char_t *)"UTF-8",
+ AXIS2_XML_PARSER_TYPE_BUFFER);
if (!reader)
{
@@ -191,7 +196,8 @@
XMLHelperPtr helper = HelperProvider::getXMLHelper(factory);
axis2_xml_writer_t* writer = axis2_xml_writer_create_for_memory(
- &the_env, NULL, AXIS2_TRUE, 0);
+ &the_env, NULL, AXIS2_TRUE, 0,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
axis2_om_output_t* output = axis2_om_output_create(&the_env, writer);
@@ -205,7 +211,7 @@
AXIS2_OM_NODE_SERIALIZE(root_node, &the_env, output);
- axis2_char_t* buffer = AXIS2_XML_WRITER_GET_XML(writer, &the_env);
+ axis2_char_t* buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(writer, &the_env);
XMLDocumentPtr theXMLDocument = helper->load(buffer);
@@ -227,7 +233,8 @@
}
axis2_xml_writer_t* writer = axis2_xml_writer_create_for_memory(
- &the_env, NULL, AXIS2_TRUE, 0);
+ &the_env, NULL, AXIS2_TRUE, 0,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
axis2_om_output_t* output = axis2_om_output_create(&the_env, writer);
@@ -243,7 +250,7 @@
AXIS2_OM_NODE_SERIALIZE(root_node, &the_env, output);
- axis2_char_t* buffer = AXIS2_XML_WRITER_GET_XML(writer, &the_env);
+ axis2_char_t* buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(writer, &the_env);
printf("Output XML:n %s ", buffer);
Modified: 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=406906&r1=406905&r2=406906&view=diff
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp Tue May 16 04:05:12 2006
@@ -16,7 +16,7 @@
*/
/* $Rev$ $Date: 2006/04/18 12:33:33 $ */
-
+#include "libxml/uri.h"
#include "commonj/sdo/SDOSchemaSAX2Parser.h"
#include "commonj/sdo/XSDPropertyInfo.h"
#include "commonj/sdo/XSDTypeInfo.h"
@@ -499,7 +499,70 @@
}
-
+ // ============================================================================
+ // used by startInclude to try to locate the file
+ // ============================================================================
+
+ int SDOSchemaSAX2Parser::startSecondaryParse(
+ SDOSchemaSAX2Parser& schemaParser,
+ SDOXMLString& schemaLocation)
+ {
+ int i,j,k;
+ SDOXMLString sl = getCurrentFile();
+
+ i = sl.lastIndexOf('/');
+ j = sl.lastIndexOf('\\');
+ if ((j > i) || (i < 0))i=j;
+ if (i>=0)
+ {
+ sl = sl.substring(0,i+1) + schemaLocation;
+ try {
+ if (-1 != schemaParser.parse((const char *)sl))
+ return 1;
+ }
+ catch (SDORuntimeException e)
+ {
+ }
+ k = schemaLocation.lastIndexOf('/');
+ j = schemaLocation.lastIndexOf('\\');
+ if ((j > k) || (k < 0))k=j;
+ if (k>=0)
+ {
+ sl = sl.substring(0,i+1) + schemaLocation.substring(0,k+1);
+ try {
+ if (-1 != schemaParser.parse((const char *)sl))
+ return 1;
+ }
+ catch (SDORuntimeException e)
+ {
+ }
+ }
+ }
+ try {
+ if (-1 != schemaParser.parse((const char *)schemaLocation))
+ return 1;
+ }
+ catch (SDORuntimeException e)
+ {
+ }
+ k = schemaLocation.lastIndexOf('/');
+ j = schemaLocation.lastIndexOf('\\');
+ if ((j > k) || (k < 0))k=j;
+ if (k>=0)
+ {
+ sl = schemaLocation.substring(0,k+1);
+ try {
+ if (-1 != schemaParser.parse((const char *)sl))
+ return 1;
+ }
+ catch (SDORuntimeException e)
+ {
+ }
+ }
+ return 0;
+ }
+
+
// ============================================================================
// startInclude
// ============================================================================
@@ -520,56 +583,10 @@
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)
+ if (startSecondaryParse(schemaParser,schemaLocation) == 0)
{
- // finally give up - its not in the current path, or
- // in the path specified
+ //
+ // we were not able to start the parse
return;
}
Modified: 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=406906&r1=406905&r2=406906&view=diff
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.h (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.h Tue May 16 04:05:12 2006
@@ -114,6 +114,9 @@
const SDOXMLString& URI
);
+ virtual int startSecondaryParse(
+ SDOSchemaSAX2Parser& schemaParser,
+ SDOXMLString& schemaLocation);
virtual void startInclude(
const SDOXMLString& localname,