00001 /* 00002 * Copyright 2006-2008 The FLWOR Foundation. 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #ifndef ZORBA_ITEM_FACTORY_API_H 00018 #define ZORBA_ITEM_FACTORY_API_H 00019 00020 #include <iostream> 00021 #include <vector> 00022 00023 #include <zorba/config.h> 00024 #include <zorba/api_shared_types.h> 00025 #include <zorba/item.h> 00026 #include <zorba/streams.h> 00027 00028 namespace zorba { 00029 00030 /** \brief ItemFactory to create Items. 00031 * 00032 * An instance of this class can be obtained by calling getItemFactory on the Zorba object. 00033 * 00034 * Each createXXX function of this class creates an Item of an XML Schema item. 00035 * If an isNull() call on an Item created by one of these functions returns true the 00036 * Item could not be created. 00037 */ 00038 class ZORBA_DLL_PUBLIC ItemFactory 00039 { 00040 public: 00041 /** \brief Destructor 00042 */ 00043 virtual ~ItemFactory() {} 00044 00045 /** \brief Creates a String Item 00046 * see [http://www.w3.org/TR/xmlschema-2/#string] 00047 * 00048 * @param aString String representation of the String Item. 00049 * @return The String Item 00050 */ 00051 virtual Item 00052 createString(const String& aString) = 0; 00053 00054 /** \brief Creates a streamable String Item 00055 * see [http://www.w3.org/TR/xmlschema-2/#string] 00056 * 00057 * @param stream An istream from where to read the string's content. 00058 * @param streamReleaser A function pointer which is invoked once 00059 * the StreamableStringItem is destroyed. Normally this function 00060 * will delete the std::istream object passed to it. 00061 * @param seekable 00062 * @return The streamable String Item 00063 */ 00064 virtual Item 00065 createStreamableString( std::istream &stream, 00066 StreamReleaser streamReleaser, 00067 bool seekable = false ) = 0; 00068 00069 /** \brief Creates an AnyURI Item 00070 * see [http://www.w3.org/TR/xmlschema-2/#anyURI] 00071 * 00072 * @param aURI String representation of the AnyURI. 00073 * @return The AnyURI Item. 00074 */ 00075 virtual Item 00076 createAnyURI(const String& aURI) = 0; 00077 00078 /** \brief Creates a QName Item 00079 * see [http://www.w3.org/TR/xmlschema-2/#QName] 00080 * 00081 * @param aNamespace String representation of the namespace. 00082 * @param aPrefix String representation of the prefix. 00083 * @param aLocalname String representation of the localname. 00084 * 00085 * @return The QName Item. 00086 */ 00087 virtual Item 00088 createQName(const String& aNamespace, const String& aPrefix, 00089 const String& aLocalname) = 0; 00090 00091 /** \brief Creates a QName Item 00092 * see [http://www.w3.org/TR/xmlschema-2/#QName] 00093 * 00094 * @param aNamespace String representation of the namespace. 00095 * @param aLocalname String representation of the localname. * 00096 * @return The QName Item. 00097 */ 00098 virtual Item 00099 createQName(const String& aNamespace, const String& aLocalname) = 0; 00100 00101 /** \brief Creates a QName Item 00102 * see [http://www.w3.org/TR/xmlschema-2/#QName] 00103 * 00104 * The QName is constructed by parsing the string using the notation 00105 * invented by James Clark (i.e. {namespace}localname). 00106 * 00107 * @param aQNameString String in the QName notation by James Clark. 00108 * @return The QName Item. 00109 */ 00110 virtual Item 00111 createQName(const String& aQNameString) = 0; 00112 00113 /** \brief Creates a NCName Item 00114 * see [http://www.w3.org/TR/xmlschema-2/#NCName] 00115 * 00116 * @param aValue String representation of the NCName. 00117 * @return The NCName Item. 00118 */ 00119 virtual Item 00120 createNCName(const String& aValue) = 0; 00121 00122 00123 /** \brief Creates a Base64Binary Item 00124 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary] 00125 * 00126 * @param aBinData a pointer to the base64 binary data. 00127 * @param aLength the length of the base64 binary data. 00128 * @return The Base64Binary Item. 00129 */ 00130 virtual Item 00131 createBase64Binary(const char* aBinData, size_t aLength) = 0; 00132 00133 /** \brief Creates a Base64Binary Item 00134 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary] 00135 * 00136 * @param aStream A stream containing the Base64 encoded data. 00137 * @return the Base64Binary Item. 00138 */ 00139 virtual Item 00140 createBase64Binary(std::istream& aStream) = 0; 00141 00142 /** \brief Creates a Base64Binary Item 00143 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary] 00144 * 00145 * @param aBinData the data in binary form. The data is copied from aBinData. 00146 * @param aLength the length of the data 00147 * @return the Base64Binary Item. 00148 */ 00149 virtual Item 00150 createBase64Binary(const unsigned char* aBinData, size_t aLength) = 0; 00151 00152 /** \brief Creates a streamable Base64Binary Item 00153 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary] 00154 * 00155 * @param stream An istream from where to read the binary's content. 00156 * @param streamReleaser A function pointer which is invoked once 00157 * the StreamableBase64Binary is destroyed. Normally this function 00158 * will delete the std::istream object passed to it. 00159 * @param seekable is the given stream seekable 00160 * @param encoded is the contents of the given stream already base64 00161 * encoded 00162 * @return The streamable String Item 00163 */ 00164 virtual Item 00165 createStreamableBase64Binary( 00166 std::istream &stream, 00167 StreamReleaser streamReleaser, 00168 bool seekable = false, 00169 bool encoded = false) = 0; 00170 00171 /** \brief Creates a Boolean Item 00172 * see [http://www.w3.org/TR/xmlschema-2/#bool] 00173 * 00174 * @param aValue bool representation of the Boolean. 00175 * @return The Boolean Item. 00176 */ 00177 virtual Item 00178 createBoolean(bool aValue) = 0; 00179 00180 /** \brief Creates a Decimal Item 00181 * see [http://www.w3.org/TR/xmlschema-2/#decimal] 00182 * 00183 * @param aValue unsigned long representation of the Decimal. 00184 * @return The Decimal Item. 00185 */ 00186 virtual Item 00187 createDecimalFromLong (unsigned long aValue) = 0; 00188 00189 /** \brief Creates a Decimal Item 00190 * see [http://www.w3.org/TR/xmlschema-2/#decimal] 00191 * 00192 * @param aValue double representation of the Decimal. 00193 * @return The Decimal Item. 00194 */ 00195 virtual Item 00196 createDecimalFromDouble (double aValue) = 0; 00197 00198 /** \brief Creates a Decimal Item 00199 * see [http://www.w3.org/TR/xmlschema-2/#decimal] 00200 * 00201 * @param aValue String representation of the Decimal (e.g. 12678967.543233). 00202 * @return The Decimal Item. 00203 */ 00204 virtual Item 00205 createDecimal (const String& aValue) = 0; 00206 00207 /** \brief Creates an Integer Item 00208 * see [http://www.w3.org/TR/xmlschema-2/#integer] 00209 * 00210 * @param aInteger unsigned long representation of the Integer. 00211 * @return The Integer Item. 00212 */ 00213 virtual Item 00214 createInteger(long long aInteger) = 0; 00215 00216 /** \brief Creates an Integer Item 00217 * see [http://www.w3.org/TR/xmlschema-2/#integer] 00218 * 00219 * @param aInteger String representation of the Integer. 00220 * @return The Integer Item. 00221 */ 00222 virtual Item 00223 createInteger(const String& aInteger) = 0; 00224 00225 /** \brief Creates a Long Item 00226 * see [http://www.w3.org/TR/xmlschema-2/#long] 00227 * 00228 * @param aLong long long representation of the Long. 00229 * @return The Long Item. 00230 */ 00231 virtual Item 00232 createLong ( long long aLong ) = 0; 00233 00234 /** \brief Creates a Int Item 00235 * see [http://www.w3.org/TR/xmlschema-2/#int] 00236 * 00237 * @param aInt int representation of the Int. 00238 * @return The NCName Item. 00239 */ 00240 virtual Item 00241 createInt ( int aInt ) = 0; 00242 00243 /** \brief Creates a Short Item 00244 * see [http://www.w3.org/TR/xmlschema-2/#short] 00245 * 00246 * @param aShort short representation of the Short. 00247 * @return The Short Item. 00248 */ 00249 virtual Item 00250 createShort ( short aShort ) = 0; 00251 00252 /** \brief Creates a Byte Item 00253 * see [http://www.w3.org/TR/xmlschema-2/#byte] 00254 * 00255 * @param aByte char representation of the Byte. 00256 * @return The Byte Item. 00257 */ 00258 virtual Item 00259 createByte ( char aByte ) = 0; 00260 00261 /** \brief Creates a Date Item 00262 * see [http://www.w3.org/TR/xmlschema-2/#date] 00263 * 00264 * @param aDate String representation of the Date (e.g. 2002-10-10). 00265 * @return The Date Item. 00266 */ 00267 virtual Item 00268 createDate ( const String& aDate ) = 0; 00269 00270 /** \brief Creates a Date Item 00271 * see [http://www.w3.org/TR/xmlschema-2/#date] 00272 * 00273 * @param aYear short-valued representation of the year. 00274 * @param aMonth short-valued representation of the month. 00275 * @param aDay short-valued representation of the day. 00276 * @return The Date Item. 00277 */ 00278 virtual Item 00279 createDate ( short aYear, short aMonth, short aDay ) = 0; 00280 00281 /** \brief Creates a DateTime Item 00282 * see [http://www.w3.org/TR/xmlschema-2/#dateTime] 00283 * 00284 * @param aYear short-valued representation of the year. 00285 * @param aMonth short-valued representation of the month. 00286 * @param aDay short-valued representation of the day. 00287 * @param aHour short-valued representation of the hour. 00288 * @param aMinute short-valued representation of the minute. 00289 * @param aSecond double-valued representation of the seconds and fractional seconds. 00290 * @param aTimeZone_hours short-valued representation of the difference in hours to UTC. 00291 * @return The DateTime Item. 00292 */ 00293 virtual Item 00294 createDateTime(short aYear, short aMonth, short aDay, 00295 short aHour, short aMinute, double aSecond, 00296 short aTimeZone_hours) = 0; 00297 00298 /** \brief Creates a DateTime Item 00299 * see [http://www.w3.org/TR/xmlschema-2/#dateTime] 00300 * 00301 * @param aDateTimeValue String representation of the datetime value 00302 * (for example, 2002-10-10T12:00:00-05:00). 00303 * @return The DateTime Item. 00304 */ 00305 virtual Item 00306 createDateTime( const String& aDateTimeValue ) = 0; 00307 00308 /** \brief Creates a Double Item 00309 * see [http://www.w3.org/TR/xmlschema-2/#double] 00310 * 00311 * @param aValue double representation of the Double. 00312 * @return The Double Item. 00313 */ 00314 virtual Item 00315 createDouble ( double aValue ) = 0; 00316 00317 /** \brief Creates a Double Item 00318 * see [http://www.w3.org/TR/xmlschema-2/#double] 00319 * 00320 * @param aValue String representation of the Double. 00321 * @return The Double Item. 00322 */ 00323 virtual Item 00324 createDouble ( const String& aValue ) = 0; 00325 00326 /** \brief Creates a Duration Item 00327 * see [http://www.w3.org/TR/xmlschema-2/#duration] 00328 * 00329 * @param aValue String representation of the NCName. 00330 * @return The Duration Item. 00331 */ 00332 virtual Item 00333 createDuration( const String& aValue ) = 0; 00334 00335 /** \brief Creates a Duration Item 00336 * see [http://www.w3.org/TR/xmlschema-2/#duration] 00337 * 00338 * @param aYear short-valued representation of the years. 00339 * @param aMonths short-valued representation of the months. 00340 * @param aDays short-valued representation of the days. 00341 * @param aHours short-valued representation of the hours. 00342 * @param aMinutes short-valued representation of the minutes. 00343 * @param aSeconds double-valued representation of the seconds and fractional seconds. 00344 * @return The Duration Item. 00345 */ 00346 virtual Item 00347 createDuration ( short aYear, short aMonths, short aDays, 00348 short aHours, short aMinutes, double aSeconds ) = 0; 00349 00350 /** \brief Creates a dayTimeDuration Item 00351 * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes] 00352 * 00353 * @param aValue String lexical representation of the duration. 00354 * @return the dayTimeDuration Item. 00355 */ 00356 virtual Item 00357 createDayTimeDuration( const String& aValue ) = 0; 00358 00359 /** \brief Creates a yearMonthDuration Item 00360 * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes] 00361 * 00362 * @param aValue String lexical representation of the duration. 00363 * @return the yearMonthDuration Item. 00364 */ 00365 virtual Item 00366 createYearMonthDuration( const String& aValue ) = 0; 00367 00368 /** \brief Creates a documentNode Item 00369 * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes] 00370 * 00371 * @param aBaseUri String representation of the Base URI. 00372 * @param aDocUri String representation of the Document URI. 00373 * @return the documentNode Item. 00374 */ 00375 virtual Item 00376 createDocumentNode( const String& aBaseUri, const String& aDocUri ) = 0; 00377 00378 /** \brief creates a float item 00379 * see [http://www.w3.org/tr/xmlschema-2/#float] 00380 * 00381 * @param aValue string representation of the float. 00382 * @return the float item. 00383 */ 00384 virtual Item 00385 createFloat ( const String& aValue ) = 0; 00386 00387 /** \brief creates a float item 00388 * see [http://www.w3.org/tr/xmlschema-2/#float] 00389 * 00390 * @param aValue float representation of the float. 00391 * @return the float item. 00392 */ 00393 virtual Item 00394 createFloat ( float aValue ) = 0; 00395 00396 /** \brief Creates a gDay Item 00397 * see [http://www.w3.org/TR/xmlschema-2/#gDay] 00398 * 00399 * @param aValue String representation of the gDay. 00400 * @return The gDay Item. 00401 */ 00402 virtual Item 00403 createGDay ( const String& aValue ) = 0; 00404 00405 /** \brief Creates a gDay Item 00406 * see [http://www.w3.org/TR/xmlschema-2/#gDay] 00407 * 00408 * @param aDay short representation of the gDay. 00409 * @return The gDay Item. 00410 */ 00411 virtual Item 00412 createGDay ( short aDay ) = 0; 00413 00414 /** \brief Creates a gMonth Item 00415 * see [http://www.w3.org/TR/xmlschema-2/#gMonth] 00416 * 00417 * @param aValue String representation of the gMonth. 00418 * @return The gMonth Item. 00419 */ 00420 virtual Item 00421 createGMonth ( const String& aValue ) = 0; 00422 00423 /** \brief Creates a gMonth Item 00424 * see [http://www.w3.org/TR/xmlschema-2/#gMonth] 00425 * 00426 * @param aMonth short representation of the gMonth. 00427 * @return The gMonth Item. 00428 */ 00429 virtual Item 00430 createGMonth ( short aMonth ) = 0; 00431 00432 /** \brief Creates a gMonthDay Item 00433 * see [http://www.w3.org/TR/xmlschema-2/#gMonthDay] 00434 * 00435 * @param aValue String representation of the gMonthDay. 00436 * @return The gMonthDay Item. 00437 */ 00438 virtual Item 00439 createGMonthDay ( const String& aValue ) = 0; 00440 00441 /** \brief Creates a gMonthDay Item 00442 * see [http://www.w3.org/TR/xmlschema-2/#gMonthDay] 00443 * 00444 * @param aMonth short representation of the month. 00445 * @param aDay short representation of the day. 00446 * @return The gMonthDay Item. 00447 */ 00448 virtual Item 00449 createGMonthDay ( short aMonth, short aDay ) = 0; 00450 00451 /** \brief Creates a gYear Item 00452 * see [http://www.w3.org/TR/xmlschema-2/#gYear] 00453 * 00454 * @param aValue String representation of the gYear. 00455 * @return The gYear Item. 00456 */ 00457 virtual Item 00458 createGYear ( const String& aValue ) = 0; 00459 00460 /** \brief Creates a gYear Item 00461 * see [http://www.w3.org/TR/xmlschema-2/#gYear] 00462 * 00463 * @param aYear short representation of the gYear. 00464 * @return The gYear Item. 00465 */ 00466 virtual Item 00467 createGYear ( short aYear ) = 0; 00468 00469 /** \brief Creates a gYearMonth Item 00470 * see [http://www.w3.org/TR/xmlschema-2/#gYearMonth] 00471 * 00472 * @param aValue String representation of the gYearMonth. 00473 * @return The gYearMonth Item. 00474 */ 00475 virtual Item 00476 createGYearMonth ( const String& aValue ) = 0; 00477 00478 /** \brief Creates a gYearMonth Item 00479 * see [http://www.w3.org/TR/xmlschema-2/#gYearMonth] 00480 * 00481 * @param aYear short representation of the year. 00482 * @param aMonth short representation of the month. 00483 * @return The gYearMonth Item. 00484 */ 00485 virtual Item 00486 createGYearMonth ( short aYear, short aMonth ) = 0; 00487 00488 /** \brief Creates a HexBinary Item 00489 * see [http://www.w3.org/TR/xmlschema-2/#hexBinary] 00490 * 00491 * @param aHexData pointer to the hexdata. 00492 * @param aSize size of the hexdata. 00493 * @return The HexBinary Item. 00494 */ 00495 virtual Item 00496 createHexBinary ( const char* aHexData, size_t aSize ) = 0; 00497 00498 /** \brief Creates a negativeInteger Item 00499 * see [http://www.w3.org/TR/xmlschema-2/#negativeInteger] 00500 * 00501 * @param aValue long long representation of the negativeInteger. 00502 * @return The negativeInteger Item. 00503 */ 00504 virtual Item 00505 createNegativeInteger ( long long aValue ) = 0; 00506 00507 /** \brief Creates a nonNegativeInteger Item 00508 * see [http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger] 00509 * 00510 * @param aValue unsigned long representation of the nonNegativeInteger. 00511 * @return The nonNegativeInteger Item. 00512 */ 00513 virtual Item 00514 createNonNegativeInteger ( unsigned long long aValue ) = 0; 00515 00516 /** \brief Creates a nonPositiveInteger Item 00517 * see [http://www.w3.org/TR/xmlschema-2/#nonPositiveInteger] 00518 * 00519 * @param aValue long long representation of the NCName. 00520 * @return The nonPositiveInteger Item. 00521 */ 00522 virtual Item 00523 createNonPositiveInteger ( long long aValue ) = 0; 00524 00525 /** \brief Creates a positiveInteger\ Item 00526 * see [http://www.w3.org/TR/xmlschema-2/#positiveInteger] 00527 * 00528 * @param aValue unsigned long representation of the positiveInteger. 00529 * @return The positiveInteger Item. 00530 */ 00531 virtual Item 00532 createPositiveInteger ( unsigned long long aValue ) = 0; 00533 00534 /** \brief Creates a Time Item 00535 * see [http://www.w3.org/TR/xmlschema-2/#time] 00536 * 00537 * @param aValue String representation of the Time. 00538 * @return The Time Item 00539 */ 00540 virtual Item 00541 createTime ( const String& aValue ) = 0; 00542 00543 /** \brief Creates a Time Item 00544 * see [http://www.w3.org/TR/xmlschema-2/#time] 00545 * 00546 * @param aHour short representation of the hour. 00547 * @param aMinute short representation of the minute. 00548 * @param aSecond double representation of the seconds and fractional seconds. 00549 * @return The Time Item. 00550 */ 00551 virtual Item 00552 createTime ( short aHour, short aMinute, double aSecond ) = 0; 00553 00554 /** \brief Creates a Time Item 00555 * see [http://www.w3.org/TR/xmlschema-2/#time] 00556 * 00557 * @param aHour short representation of the hour. 00558 * @param aMinute short representation of the minute. 00559 * @param aSecond double representation of the seconds and fractional seconds. 00560 * @param aTimeZone_hours short representation of the timezone difference in hours to UTC. 00561 * @return The Time Item. 00562 */ 00563 virtual Item 00564 createTime ( short aHour, short aMinute, double aSecond, short aTimeZone_hours ) = 0; 00565 00566 /** \brief Creates an Unsigned Byte Item 00567 * see [http://www.w3.org/TR/xmlschema-2/#unsignedByte] 00568 * 00569 * @param aValue unsignedByte unsigned char representation of the unsigned byte. 00570 * @return The Unsigned Byte Item. 00571 */ 00572 virtual Item 00573 createUnsignedByte(const unsigned char aValue) = 0; 00574 00575 /** \brief Creates an unsigned int Item 00576 * see [http://www.w3.org/TR/xmlschema-2/#unsignedInt] 00577 * 00578 * @param aValue unsigned int representation of the unsignedInt. 00579 * @return The unsignedInt Item. 00580 */ 00581 virtual Item 00582 createUnsignedInt(unsigned int aValue) = 0; 00583 00584 /** \brief Creates an unsignedLong Item 00585 * see [http://www.w3.org/TR/xmlschema-2/#unsignedLong] 00586 * 00587 * @param aValue unsignedLong long long representation of the unsignedLong. 00588 * @return The unsignedLong Item. 00589 */ 00590 virtual Item 00591 createUnsignedLong(unsigned long long aValue) = 0; 00592 00593 /** \brief Creates a unsignedShort Item 00594 * see [http://www.w3.org/TR/xmlschema-2/#unsignedShort] 00595 * 00596 * @param aValue unsigned short representation of the unsignedShort. 00597 * @return The unsignedShort Item. 00598 */ 00599 virtual Item 00600 createUnsignedShort(unsigned short aValue) = 0; 00601 00602 /** 00603 * @brief Creates a new element node. 00604 * 00605 * Create a new element node N and place it at the end among the 00606 * children of a given parent node. If no parent is given, N becomes the 00607 * root (and single node) of a new XML tree. 00608 * 00609 * @param aParent The parent P of the new node; may be NULL. 00610 * @param aNodeName The fully qualified name of the new node. 00611 * @param aTypeName The fully qualified name of the new node's type. 00612 * Not allowed to be NULL, use xsd:untyped instead. 00613 * @param aHasTypedValue Whether the node has a typed value or not (element 00614 * nodes with complex type and element-only content do 00615 * not have typed value). 00616 * @param aHasEmptyValue True if the typed value of the node is the empty 00617 * sequence. This is the case if the element has a 00618 * complex type with empty content. 00619 * @param aNsBindings A set of namespace bindings. The namespaces property 00620 * of N will be the union of this set and the namespaces 00621 * property of P. 00622 * @return The new node N created by this method 00623 */ 00624 virtual Item 00625 createElementNode(Item& aParent, 00626 Item aNodeName, 00627 Item aTypeName, 00628 bool aHasTypedValue, 00629 bool aHasEmptyValue, 00630 NsBindings aNsBindings) = 0; 00631 00632 /** 00633 * Create a new attribute node N and place it among the 00634 * attributes of a given parent node. If no parent is given, N becomes the 00635 * root (and single node) of a new XML tree. 00636 * 00637 * @param aParent The parent P of the new node; may be NULL. 00638 * @param aNodeName The fully qualified name of the new node. The nemaspace 00639 * binding implied by this name will be added to the namespaces 00640 * of P. If the name prefix is "xml" and the local name is 00641 * "base", then the base-uri property of P will be set or 00642 * updated accordingly. 00643 * @param aTypeName The fully qualified name of the new node's type. 00644 * @param aTypedValue The typed value of the new node. 00645 * @return The new node N created by this method 00646 */ 00647 virtual Item 00648 createAttributeNode(Item aParent, 00649 Item aNodeName, 00650 Item aTypeName, 00651 Item aTypedValue) = 0; 00652 00653 virtual Item 00654 createAttributeNode(Item aParent, 00655 Item aNodeName, 00656 Item aTypeName, 00657 std::vector<Item> aTypedValue) = 0; 00658 00659 /** 00660 * Create a new comment node N and place it as the last child of a given 00661 * parent node. If no parent is given, N becomes the root (and single node) 00662 * of a new XML tree. 00663 * 00664 * @param aParent The parent P of the new node; may be NULL. 00665 * @param aContent The content of the new node. 00666 * @return The new node N created by this method 00667 */ 00668 virtual Item createCommentNode ( 00669 Item aParent, 00670 String &aContent) = 0; 00671 00672 /** 00673 * Create a new Processing Instruction node N and place it among the 00674 * children of a given parent node. If no parent is given, N becomes the 00675 * root (and single node) of a new XML tree. 00676 * 00677 * @param aParent The parent P of the new node; may be NULL. 00678 * @param aTarget The Target of the new node. 00679 * @param aContent The Content of the new node. 00680 * @param aBaseUri The Base URI of the new node, may be NULL. 00681 * @return The new node N created by this method 00682 */ 00683 virtual Item createPiNode ( 00684 Item aParent, 00685 String &aTarget, 00686 String &aContent, 00687 String &aBaseUri)=0; 00688 00689 /** 00690 * Create a new text node N and place it among the 00691 * children of a given parent node. If no parent is given, N becomes the 00692 * root (and single node) of a new XML tree. 00693 * 00694 * @param parent The parent P of the new node; may be NULL. 00695 * @param content The content of the new node. 00696 * @return The new node N created by this method 00697 */ 00698 virtual Item createTextNode( 00699 Item parent, 00700 String content) = 0; 00701 }; // class ItemFactory 00702 00703 } // namespace zorba 00704 #endif 00705 /* vim:set et sw=2 ts=2: */