# axiom_xml_writer.h

Go to the documentation of this file.

    00001
    00002 /*
    00003  *   Copyright 2004,2005 The Apache Software Foundation.
    00004  *
    00005  *   Licensed under the Apache License, Version 2.0 (the "License");
    00006  *   you may not use this file except in compliance with the License.
    00007  *   You may obtain a copy of the License at
    00008  *
    00009  *       http://www.apache.org/licenses/LICENSE-2.0
    00010  *
    00011  *   Unless required by applicable law or agreed to in writing, software
    00012  *   distributed under the License is distributed on an "AS IS" BASIS,
    00013  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00014  *   See the License for the specific language governing permissions and
    00015  *   limitations under the License.
    00016  *
    00017  */
    00018
    00019 #ifndef AXIOM_XML_WRITER_H
    00020 #define AXIOM_XML_WRITER_H
    00021
    00027 #include <axutil_env.h>
    00028 #include <axiom_defines.h>
    00029
    00030 #ifdef __cplusplus
    00031 extern "C"
    00032 {
    00033 #endif
    00034
    00035     typedef struct axiom_xml_writer_ops axiom_xml_writer_ops_t;
    00036     typedef struct axiom_xml_writer axiom_xml_writer_t;
    00037
    00049     struct axiom_xml_writer_ops
    00050     {
    00051
    00060         void(
    00061             AXIS2_CALL
    00062             * free)(
    00063                 axiom_xml_writer_t * writer,
    00064                 const axutil_env_t * env);
    00065
    00075         axis2_status_t(
    00076             AXIS2_CALL
    00077             * write_start_element)(
    00078                 axiom_xml_writer_t * writer,
    00079                 const axutil_env_t * env,
    00080                 axis2_char_t * localname);
    00081
    00091         axis2_status_t(
    00092             AXIS2_CALL
    00093             * end_start_element)(
    00094                 axiom_xml_writer_t * writer,
    00095                 const axutil_env_t * env);
    00096
    00107         axis2_status_t(
    00108             AXIS2_CALL
    00109             * write_start_element_with_namespace)(
    00110                 axiom_xml_writer_t * writer,
    00111                 const axutil_env_t * env,
    00112                 axis2_char_t * localname,
    00113                 axis2_char_t * namespace_uri);
    00114
    00125         axis2_status_t(
    00126             AXIS2_CALL
    00127             * write_start_element_with_namespace_prefix)(
    00128                 axiom_xml_writer_t * writer,
    00129                 const axutil_env_t * env,
    00130                 axis2_char_t * localname,
    00131                 axis2_char_t * namespace_uri,
    00132                 axis2_char_t * prefix);
    00133
    00142         axis2_status_t(
    00143             AXIS2_CALL
    00144             * write_empty_element)(
    00145                 axiom_xml_writer_t * writer,
    00146                 const axutil_env_t * env,
    00147                 axis2_char_t * localname);
    00148
    00159         axis2_status_t(
    00160             AXIS2_CALL
    00161             * write_empty_element_with_namespace)(
    00162                 axiom_xml_writer_t * writer,
    00163                 const axutil_env_t * env,
    00164                 axis2_char_t * localname,
    00165                 axis2_char_t * namespace_uri);
    00166
    00177         axis2_status_t(
    00178             AXIS2_CALL
    00179             * write_empty_element_with_namespace_prefix)(
    00180                 axiom_xml_writer_t * writer,
    00181                 const axutil_env_t * env,
    00182                 axis2_char_t * localname,
    00183                 axis2_char_t * namespace_uri,
    00184                 axis2_char_t * prefix);
    00185
    00193         axis2_status_t(
    00194             AXIS2_CALL
    00195             * write_end_element)(
    00196                 axiom_xml_writer_t * writer,
    00197                 const axutil_env_t * env);
    00198
    00206         axis2_status_t(
    00207             AXIS2_CALL
    00208             * write_end_document)(
    00209                 axiom_xml_writer_t * writer,
    00210                 const axutil_env_t * env);
    00211
    00221         axis2_status_t(
    00222             AXIS2_CALL
    00223             * write_attribute)(
    00224                 axiom_xml_writer_t * writer,
    00225                 const axutil_env_t * env,
    00226                 axis2_char_t * localname,
    00227                 axis2_char_t * value);
    00228
    00238         axis2_status_t(
    00239             AXIS2_CALL
    00240             * write_attribute_with_namespace)(
    00241                 axiom_xml_writer_t * writer,
    00242                 const axutil_env_t * env,
    00243                 axis2_char_t * localname,
    00244                 axis2_char_t * value,
    00245                 axis2_char_t * namespace_uri);
    00246
    00255         axis2_status_t(
    00256             AXIS2_CALL
    00257             * write_attribute_with_namespace_prefix)(
    00258                 axiom_xml_writer_t * writer,
    00259                 const axutil_env_t * env,
    00260                 axis2_char_t * localname,
    00261                 axis2_char_t * value,
    00262                 axis2_char_t * namespace_uri,
    00263                 axis2_char_t * prefix);
    00264
    00274         axis2_status_t(
    00275             AXIS2_CALL
    00276             * write_namespace)(
    00277                 axiom_xml_writer_t * writer,
    00278                 const axutil_env_t * env,
    00279                 axis2_char_t * prefix,
    00280                 axis2_char_t * namespace_uri);
    00281
    00290         axis2_status_t(
    00291             AXIS2_CALL
    00292             * write_default_namespace)(
    00293                 axiom_xml_writer_t * writer,
    00294                 const axutil_env_t * env,
    00295                 axis2_char_t * namespace_uri);
    00296
    00305         axis2_status_t(
    00306             AXIS2_CALL
    00307             * write_comment)(
    00308                 axiom_xml_writer_t * writer,
    00309                 const axutil_env_t * env,
    00310                 axis2_char_t * value);
    00311
    00320         axis2_status_t(
    00321             AXIS2_CALL
    00322             * write_processing_instruction)(
    00323                 axiom_xml_writer_t * writer,
    00324                 const axutil_env_t * env,
    00325                 axis2_char_t * target);
    00326
    00336         axis2_status_t(
    00337             AXIS2_CALL
    00338             * write_processing_instruction_data)(
    00339                 axiom_xml_writer_t * writer,
    00340                 const axutil_env_t * env,
    00341                 axis2_char_t * target,
    00342                 axis2_char_t * data);
    00343
    00351         axis2_status_t(
    00352             AXIS2_CALL
    00353             * write_cdata)(
    00354                 axiom_xml_writer_t * writer,
    00355                 const axutil_env_t * env,
    00356                 axis2_char_t * data);
    00357
    00365         axis2_status_t(
    00366             AXIS2_CALL
    00367             * write_dtd)(
    00368                 axiom_xml_writer_t * writer,
    00369                 const axutil_env_t * env,
    00370                 axis2_char_t * dtd);
    00371
    00379         axis2_status_t(
    00380             AXIS2_CALL
    00381             * write_entity_ref)(
    00382                 axiom_xml_writer_t * writer,
    00383                 const axutil_env_t * env,
    00384                 axis2_char_t * name);
    00385
    00392         axis2_status_t(
    00393             AXIS2_CALL
    00394             * write_start_document)(
    00395                 axiom_xml_writer_t * writer,
    00396                 const axutil_env_t * env);
    00397
    00405         axis2_status_t(
    00406             AXIS2_CALL
    00407             * write_start_document_with_version)(
    00408                 axiom_xml_writer_t * writer,
    00409                 const axutil_env_t * env,
    00410                 axis2_char_t * version);
    00411
    00420         axis2_status_t(
    00421             AXIS2_CALL
    00422             * write_start_document_with_version_encoding)(
    00423                 axiom_xml_writer_t * writer,
    00424                 const axutil_env_t * env,
    00425                 axis2_char_t * version,
    00426                 axis2_char_t * encoding);
    00427
    00435         axis2_status_t(
    00436             AXIS2_CALL
    00437             * write_characters)(
    00438                 axiom_xml_writer_t * writer,
    00439                 const axutil_env_t * env,
    00440                 axis2_char_t * text);
    00441
    00449         axis2_char_t *(
    00450             AXIS2_CALL
    00451             * get_prefix)(
    00452                 axiom_xml_writer_t * writer,
    00453                 const axutil_env_t * env,
    00454                 axis2_char_t * uri);
    00455
    00464         axis2_status_t(
    00465             AXIS2_CALL
    00466             * set_prefix)(
    00467                 axiom_xml_writer_t * writer,
    00468                 const axutil_env_t * env,
    00469                 axis2_char_t * prefix,
    00470                 axis2_char_t * uri);
    00471
    00479         axis2_status_t(
    00480             AXIS2_CALL
    00481             * set_default_prefix)(
    00482                 axiom_xml_writer_t * writer,
    00483                 const axutil_env_t * env,
    00484                 axis2_char_t * uri);
    00485
    00494         axis2_status_t(
    00495             AXIS2_CALL
    00496             * write_encoded)(
    00497                 axiom_xml_writer_t * writer,
    00498                 const axutil_env_t * env,
    00499                 axis2_char_t * text,
    00500                 int in_attr);
    00501
    00502         void *(
    00503             AXIS2_CALL
    00504             * get_xml)(
    00505                 axiom_xml_writer_t * writer,
    00506                 const axutil_env_t * env);
    00507
    00508         unsigned int(
    00509             AXIS2_CALL
    00510             * get_xml_size)(
    00511                 axiom_xml_writer_t * writer,
    00512                 const axutil_env_t * env);
    00513
    00514         int(
    00515             AXIS2_CALL
    00516             * get_type)(
    00517                 axiom_xml_writer_t * writer,
    00518                 const axutil_env_t * env);
    00519
    00520         axis2_status_t(
    00521             AXIS2_CALL
    00522             * write_raw)(
    00523                 axiom_xml_writer_t * writer,
    00524                 const axutil_env_t * env,
    00525                 axis2_char_t * content);
    00526         axis2_status_t(
    00527             AXIS2_CALL
    00528             * flush)(
    00529                 axiom_xml_writer_t * writer,
    00530                 const axutil_env_t * env);
    00531
    00532     };
    00533
    00539     struct axiom_xml_writer
    00540     {
    00541         const axiom_xml_writer_ops_t *ops;
    00542     };
    00543
    00553     AXIS2_EXTERN axiom_xml_writer_t *AXIS2_CALL
    00554     axiom_xml_writer_create(
    00555         const axutil_env_t * env,
    00556         axis2_char_t * filename,
    00557         axis2_char_t * encoding,
    00558         int is_prefix_default,
    00559         int compression);
    00560
    00570     AXIS2_EXTERN axiom_xml_writer_t *AXIS2_CALL
    00571     axiom_xml_writer_create_for_memory(
    00572         const axutil_env_t * env,
    00573         axis2_char_t * encoding,
    00574         int is_prefix_default,
    00575         int compression,
    00576         int type);
    00577
    00585     AXIS2_EXTERN void AXIS2_CALL
    00586     axiom_xml_writer_free(
    00587         axiom_xml_writer_t * writer,
    00588         const axutil_env_t * env);
    00589
    00596     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00597     axiom_xml_writer_write_start_element(
    00598         axiom_xml_writer_t * writer,
    00599         const axutil_env_t * env,
    00600         axis2_char_t * localname);
    00608     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00609     axiom_xml_writer_end_start_element(
    00610         axiom_xml_writer_t * writer,
    00611         const axutil_env_t * env);
    00612
    00619     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00620     axiom_xml_writer_write_start_element_with_namespace(
    00621         axiom_xml_writer_t * writer,
    00622         const axutil_env_t * env,
    00623         axis2_char_t * localname,
    00624         axis2_char_t * namespace_uri);
    00625
    00634     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00635     axiom_xml_writer_write_start_element_with_namespace_prefix(
    00636         axiom_xml_writer_t * writer,
    00637         const axutil_env_t * env,
    00638         axis2_char_t * localname,
    00639         axis2_char_t * namespace_uri,
    00640         axis2_char_t * prefix);
    00641
    00648     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00649     axiom_xml_writer_write_empty_element(
    00650         axiom_xml_writer_t * writer,
    00651         const axutil_env_t * env,
    00652         axis2_char_t * localname);
    00653
    00661     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00662     axiom_xml_writer_write_empty_element_with_namespace(
    00663         axiom_xml_writer_t * writer,
    00664         const axutil_env_t * env,
    00665         axis2_char_t * localname,
    00666         axis2_char_t * namespace_uri);
    00667
    00676     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00677     axiom_xml_writer_write_empty_element_with_namespace_prefix(
    00678         axiom_xml_writer_t * writer,
    00679         const axutil_env_t * env,
    00680         axis2_char_t * localname,
    00681         axis2_char_t * namespace_uri,
    00682         axis2_char_t * prefix);
    00683
    00690     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00691     axiom_xml_writer_write_end_element(
    00692         axiom_xml_writer_t * writer,
    00693         const axutil_env_t * env);
    00694
    00701     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00702     axiom_xml_writer_write_end_document(
    00703         axiom_xml_writer_t * writer,
    00704         const axutil_env_t * env);
    00705
    00713     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00714     axiom_xml_writer_write_attribute(
    00715         axiom_xml_writer_t * writer,
    00716         const axutil_env_t * env,
    00717         axis2_char_t * localname,
    00718         axis2_char_t * value);
    00719
    00728     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00729     axiom_xml_writer_write_attribute_with_namespace(
    00730         axiom_xml_writer_t * writer,
    00731         const axutil_env_t * env,
    00732         axis2_char_t * localname,
    00733         axis2_char_t * value,
    00734         axis2_char_t * namespace_uri);
    00735
    00745     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00746     axiom_xml_writer_write_attribute_with_namespace_prefix(
    00747         axiom_xml_writer_t * writer,
    00748         const axutil_env_t * env,
    00749         axis2_char_t * localname,
    00750         axis2_char_t * value,
    00751         axis2_char_t * namespace_uri,
    00752         axis2_char_t * prefix);
    00753
    00761     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00762     axiom_xml_writer_write_namespace(
    00763         axiom_xml_writer_t * writer,
    00764         const axutil_env_t * env,
    00765         axis2_char_t * prefix,
    00766         axis2_char_t * namespace_uri);
    00767
    00774     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00775     axiom_xml_writer_write_default_namespace(
    00776         axiom_xml_writer_t * writer,
    00777         const axutil_env_t * env,
    00778         axis2_char_t * namespace_uri);
    00779
    00786     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00787     axiom_xml_writer_write_comment(
    00788         axiom_xml_writer_t * writer,
    00789         const axutil_env_t * env,
    00790         axis2_char_t * value);
    00791
    00798     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00799     axiom_xml_writer_write_processing_instruction(
    00800         axiom_xml_writer_t * writer,
    00801         const axutil_env_t * env,
    00802         axis2_char_t * target);
    00803
    00810     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00811     axiom_xml_writer_write_processing_instruction_data(
    00812         axiom_xml_writer_t * writer,
    00813         const axutil_env_t * env,
    00814         axis2_char_t * target,
    00815         axis2_char_t * data);
    00816
    00823     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00824     axiom_xml_writer_write_cdata(
    00825         axiom_xml_writer_t * writer,
    00826         const axutil_env_t * env,
    00827         axis2_char_t * data);
    00828
    00835     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00836     axiom_xml_writer_write_dtd(
    00837         axiom_xml_writer_t * writer,
    00838         const axutil_env_t * env,
    00839         axis2_char_t * dtd);
    00840
    00847     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00848     axiom_xml_writer_write_entity_ref(
    00849         axiom_xml_writer_t * writer,
    00850         const axutil_env_t * env,
    00851         axis2_char_t * name);
    00852
    00859     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00860     axiom_xml_writer_write_start_document(
    00861         axiom_xml_writer_t * writer,
    00862         const axutil_env_t * env);
    00863
    00870     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00871     axiom_xml_writer_write_start_document_with_version(
    00872         axiom_xml_writer_t * writer,
    00873         const axutil_env_t * env,
    00874         axis2_char_t * version);
    00875
    00882     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00883     axiom_xml_writer_write_start_document_with_version_encoding(
    00884         axiom_xml_writer_t * writer,
    00885         const axutil_env_t * env,
    00886         axis2_char_t * version,
    00887         axis2_char_t * encoding);
    00888
    00895     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00896     axiom_xml_writer_write_characters(
    00897         axiom_xml_writer_t * writer,
    00898         const axutil_env_t * env,
    00899         axis2_char_t * text);
    00900
    00907     AXIS2_EXTERN axis2_char_t *AXIS2_CALL
    00908     axiom_xml_writer_get_prefix(
    00909         axiom_xml_writer_t * writer,
    00910         const axutil_env_t * env,
    00911         axis2_char_t * uri);
    00912
    00919     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00920     axiom_xml_writer_set_prefix(
    00921         axiom_xml_writer_t * writer,
    00922         const axutil_env_t * env,
    00923         axis2_char_t * prefix,
    00924         axis2_char_t * uri);
    00925
    00932     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00933     axiom_xml_writer_set_default_prefix(
    00934         axiom_xml_writer_t * writer,
    00935         const axutil_env_t * env,
    00936         axis2_char_t * uri);
    00937
    00945     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00946     axiom_xml_writer_write_encoded(
    00947         axiom_xml_writer_t * writer,
    00948         const axutil_env_t * env,
    00949         axis2_char_t * text,
    00950         int in_attr);
    00951
    00958     AXIS2_EXTERN void *AXIS2_CALL
    00959     axiom_xml_writer_get_xml(
    00960         axiom_xml_writer_t * writer,
    00961         const axutil_env_t * env);
    00962
    00969     AXIS2_EXTERN unsigned int AXIS2_CALL
    00970     axiom_xml_writer_get_xml_size(
    00971         axiom_xml_writer_t * writer,
    00972         const axutil_env_t * env);
    00973
    00980     AXIS2_EXTERN int AXIS2_CALL
    00981     axiom_xml_writer_get_type(
    00982         axiom_xml_writer_t * writer,
    00983         const axutil_env_t * env);
    00984
    00991     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00992     axiom_xml_writer_write_raw(
    00993         axiom_xml_writer_t * writer,
    00994         const axutil_env_t * env,
    00995         axis2_char_t * content);
    00996
    01003     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    01004     axiom_xml_writer_flush(
    01005         axiom_xml_writer_t * writer,
    01006         const axutil_env_t * env);
    01007
    01010 #ifdef __cplusplus
    01011 }
    01012 #endif
    01013
    01014 #endif                          /* AXIOM_XML_WRITER_H */