void asn1DOMTest_CancellationNoteType (OSCTXT* pctxt, CancellationNoteType* pvalue, xmlNodePtr pXmlNode, OSBOOL setChild) { xmlAttrPtr pXmlAttr = pXmlNode->properties; /* Populate attributes */ for ( ; 0 != pXmlAttr; pXmlAttr = pXmlAttr->next) { if (pXmlAttr->type == XML_ATTRIBUTE_NODE) { if (rtxUTF8StrEqual (pXmlAttr->name, OSUTF8("languageLocaleID"))) { pvalue->m.languageLocaleIDPresent = 1; if (0 != pXmlAttr->children) { pvalue->languageLocaleID = pXmlAttr->children->content; } } else if (rtxUTF8StrEqual (pXmlAttr->name, OSUTF8("languageID"))) { pvalue->m.languageIDPresent = 1; if (0 != pXmlAttr->children) { pvalue->languageID = pXmlAttr->children->content; } } } } /* Populate elements */ if (0 != pXmlNode->children) { pvalue->base = pXmlNode->children->content; } }
int DOMTest_Config_item (OSCTXT* pctxt, Config_item* pvalue, xmlNodePtr pXmlNode, OSBOOL setChild) { xmlAttrPtr pXmlAttr = pXmlNode->properties; /* Populate attributes */ for ( ; 0 != pXmlAttr; pXmlAttr = pXmlAttr->next) { if (pXmlAttr->type == XML_ATTRIBUTE_NODE) { if (rtxUTF8StrEqual (pXmlAttr->name, OSUTF8("name"))) { if (0 != ((xmlNodePtr)pXmlAttr)->children) { pvalue->name = ((xmlNodePtr)pXmlAttr)->children->content; } else { pvalue->name = (const OSUTF8CHAR*)""; } } else if (rtxUTF8StrEqual (pXmlAttr->name, OSUTF8("type"))) { if (0 != ((xmlNodePtr)pXmlAttr)->children) { Config_item_type_ToEnum (pctxt, ((xmlNodePtr)pXmlAttr)->children->content, &pvalue->type); } } } } /* Populate elements */ if (setChild) pXmlNode = pXmlNode->children; for ( ; 0 != pXmlNode; pXmlNode = pXmlNode->next) { if (pXmlNode->type == XML_ELEMENT_NODE) { } } return 0; }
int XmlEnc_Seisdata_PDU (OSCTXT* pctxt, Seisdata* pvalue) { int stat; const OSUTF8CHAR* nsPrefix = 0; stat = rtXmlEncStartDocument (pctxt); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = rtXmlEncStartElement (pctxt, OSUTF8("seisdata"), nsPrefix, FALSE); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = rtXmlEncNSAttrs (pctxt); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = rtXmlEncXSIAttrs (pctxt, FALSE); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = XmlEnc_Seisdata (pctxt, pvalue, 0, nsPrefix); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = rtXmlEncEndElement (pctxt, OSUTF8("seisdata"), nsPrefix); if (stat != 0) return LOG_RTERR (pctxt, stat); return stat; }
int XmlEnc_Fault_PDU (OSCTXT* pctxt, Fault* pvalue) { int stat; const OSUTF8CHAR* nsPrefix = 0; rtXmlNSSetNamespace (pctxt, OSUTF8("tns"), OSUTF8("http://schemas.xmlsoap.org/soap/envelope/"), FALSE); nsPrefix = rtXmlNSGetPrefix (pctxt, OSUTF8("http://schemas.xmlsoap.org/soap/envelope/")); stat = rtXmlEncStartDocument (pctxt); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = rtXmlEncStartElement (pctxt, OSUTF8("Fault"), nsPrefix, FALSE); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = rtXmlEncNSAttrs (pctxt); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = rtXmlEncXSIAttrs (pctxt, FALSE); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = XmlEnc_Fault (pctxt, pvalue, 0, nsPrefix); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = rtXmlEncEndElement (pctxt, OSUTF8("Fault"), nsPrefix); if (stat != 0) return LOG_RTERR (pctxt, stat); return stat; }
int XmlEnc_EncodingStyle_1 (OSCTXT* pctxt, EncodingStyle_1* pvalue, const OSUTF8CHAR* elemName, const OSUTF8CHAR* nsPrefix) { int stat = 0; if (elemName != 0) { stat = rtXmlEncStartElement (pctxt, elemName, nsPrefix, TRUE); if (stat != 0) return LOG_RTERR (pctxt, stat); } { const OSUTF8CHAR* savedPrefix = nsPrefix; nsPrefix = rtXmlNSGetPrefix (pctxt, OSUTF8( "http://schemas.xmlsoap.org/soap/envelope/")); { OSRTDListNode* pnode = pvalue->head; while (0 != pnode) { stat = rtXmlEncUTF8Str (pctxt, ((const OSUTF8CHAR*)pnode->data) , OSUTF8(""), 0); if (stat != 0) return LOG_RTERR (pctxt, stat); OSRTSAFEPUTCHAR (pctxt, ' '); pnode = pnode->next; }} nsPrefix = savedPrefix; } stat = rtXmlEncEndElement (pctxt, elemName, nsPrefix); if (stat != 0) return LOG_RTERR (pctxt, stat); return (stat); }
int XmlEnc_Model (OSCTXT* pctxt, Model* pvalue, const OSUTF8CHAR* elemName, const OSUTF8CHAR* nsPrefix) { int stat = 0; if (0 != elemName) { stat = rtXmlEncStartElement (pctxt, elemName, nsPrefix, FALSE); if (stat != 0) return LOG_RTERR (pctxt, stat); } /* add attributes */ { OSRTDListNode* pnode = pvalue->attr.head; size_t len; while (0 != pnode) { len = rtxUTF8LenBytes (pnode->data); stat = rtxCheckBuffer (pctxt, len + 1); if (stat != 0) return LOG_RTERR (pctxt, stat); OSRTPUTCHAR (pctxt, ' '); OSRTMEMCPY (pctxt, pnode->data, len); pnode = pnode->next; }} OSRTSAFEPUTCHAR (pctxt, '>'); pctxt->flags &= ~OSTERMSTART; pctxt->state = OSXMLSTART; { const OSUTF8CHAR* savedPrefix = nsPrefix; nsPrefix = rtXmlNSGetPrefix (pctxt, OSUTF8( "http://www.w3.org/2002/xforms")); /* encode element14_list */ { const OSUTF8CHAR* savedPrefix = nsPrefix; nsPrefix = rtXmlNSGetPrefix (pctxt, OSUTF8( "http://www.w3.org/2002/xforms")); { OSRTDListNode* pnode = pvalue->element14_list.head; while (0 != pnode) { stat = XmlEnc_Odf_Element14 (pctxt, *((Odf_Element14*)pnode->data) , 0, nsPrefix); if (stat != 0) return LOG_RTERR (pctxt, stat); pnode = pnode->next; }} nsPrefix = savedPrefix; } nsPrefix = savedPrefix; } stat = rtXmlEncEndElement (pctxt, elemName, nsPrefix); if (stat != 0) return LOG_RTERR (pctxt, stat); return (stat); }
int XmlEnc_InvoiceType (OSCTXT* pctxt, InvoiceType* pvalue, const OSUTF8CHAR* elemName, const OSUTF8CHAR* nsPrefix) { int stat = 0; if (0 != elemName) { stat = rtXmlEncStartElement (pctxt, elemName, nsPrefix, TRUE); if (stat != 0) return LOG_RTERR (pctxt, stat); } { const OSUTF8CHAR* savedPrefix = nsPrefix; nsPrefix = rtXmlNSGetPrefix (pctxt, OSUTF8( "http://www.sun.com/schema/spidermarkexpress/sm-inv")); /* encode header */ stat = XmlEnc_InvoiceHeaderType (pctxt, &pvalue->header , OSUTF8("Header"), 0); if (stat != 0) return LOG_RTERR (pctxt, stat); /* encode lineItem_list */ if (!(pvalue->lineItem_list.count >= 1U)) { rtxErrAddStrParm (pctxt, "InvoiceType.lineItem_list.count"); rtxErrAddIntParm (pctxt, (int)pvalue->lineItem_list.count); return LOG_RTERR (pctxt, RTERR_CONSVIO); } { const OSUTF8CHAR* savedPrefix = nsPrefix; nsPrefix = rtXmlNSGetPrefix (pctxt, OSUTF8( "http://www.sun.com/schema/spidermarkexpress/sm-inv")); { OSRTDListNode* pnode = pvalue->lineItem_list.head; while (0 != pnode) { stat = XmlEnc_InvoiceLineItemType (pctxt, ((InvoiceLineItemType*)pnode->data), OSUTF8("LineItem"), 0); if (stat != 0) return LOG_RTERR (pctxt, stat); pnode = pnode->next; }} nsPrefix = savedPrefix; } /* encode summary */ stat = XmlEnc_InvoiceSummaryType (pctxt, &pvalue->summary , OSUTF8("Summary"), 0); if (stat != 0) return LOG_RTERR (pctxt, stat); nsPrefix = savedPrefix; } stat = rtXmlEncEndElement (pctxt, elemName, nsPrefix); if (stat != 0) return LOG_RTERR (pctxt, stat); return (stat); }
int DOMTest_Ns7_Light (OSCTXT* pctxt, Ns7_Light* pvalue, xmlNodePtr pXmlNode, OSBOOL setChild) { xmlAttrPtr pXmlAttr = pXmlNode->properties; /* Populate attributes */ for ( ; 0 != pXmlAttr; pXmlAttr = pXmlAttr->next) { if (pXmlAttr->type == XML_ATTRIBUTE_NODE) { if (rtxUTF8StrEqual (pXmlAttr->name, OSUTF8("diffuse-color"))) { pvalue->m.diffuse_colorPresent = 1; if (0 != ((xmlNodePtr)pXmlAttr)->children) { pvalue->diffuse_color = ((xmlNodePtr)pXmlAttr)->children->content; } else { pvalue->diffuse_color = (const OSUTF8CHAR*)""; } } else if (rtxUTF8StrEqual (pXmlAttr->name, OSUTF8("direction"))) { if (0 != ((xmlNodePtr)pXmlAttr)->children) { pvalue->direction = ((xmlNodePtr)pXmlAttr)->children->content; } else { pvalue->direction = (const OSUTF8CHAR*)""; } } else if (rtxUTF8StrEqual (pXmlAttr->name, OSUTF8("enabled"))) { pvalue->m.enabledPresent = 1; if (0 != ((xmlNodePtr)pXmlAttr)->children) { Ns7_Light_enabled_ToEnum (pctxt, ((xmlNodePtr)pXmlAttr)->children->content, &pvalue->enabled); } } else if (rtxUTF8StrEqual (pXmlAttr->name, OSUTF8("specular"))) { pvalue->m.specularPresent = 1; if (0 != ((xmlNodePtr)pXmlAttr)->children) { Ns7_Light_specular_ToEnum (pctxt, ((xmlNodePtr)pXmlAttr)->children->content, &pvalue->specular); } } } } /* Populate elements */ if (setChild) pXmlNode = pXmlNode->children; for ( ; 0 != pXmlNode; pXmlNode = pXmlNode->next) { if (pXmlNode->type == XML_ELEMENT_NODE) { } } return 0; }
EXTXMLMETHOD int rtAsn1XmlEncOpenType (OSCTXT *pctxt, const OSOCTET* data, OSUINT32 nocts, const OSUTF8CHAR* elemName, const OSUTF8CHAR* nsPrefix) { OSUTF8CHAR* qname = 0; int stat; if (0 != isBinaryData (data, nocts)) { const OSUTF8CHAR *ename = (elemName == 0 || strcmp ("", elemName) == 0 ) ? OSUTF8("binext") : elemName; qname = rtXmlNewQName (pctxt, ename, nsPrefix); if (0 != qname) { stat = rtXmlEncStartElement (pctxt, qname, 0, 0, TRUE); if (stat != 0) return LOG_RTERR (pctxt, stat); } else return RTERR_NOMEM; if (0 != data && nocts > 0) { stat = rtXmlEncHexStrValue (pctxt, nocts, data); pctxt->state = OSXMLDATA; if (stat != 0) return LOG_RTERR (pctxt, stat); } if (0 != qname) { stat = rtXmlEncEndElement (pctxt, qname, 0); if (stat != 0) return LOG_RTERR (pctxt, stat); rtxMemFreePtr (pctxt, qname); } } else { if (0 != elemName) { qname = rtXmlNewQName (pctxt, elemName, nsPrefix); if (0 != qname) { stat = rtXmlEncStartElement (pctxt, qname, 0, 0, TRUE); if (stat != 0) return LOG_RTERR (pctxt, stat); } else return RTERR_NOMEM; } if (0 != data && nocts > 0) { OSRTSAFEMEMCPY (pctxt, data, nocts); pctxt->state = OSXMLDATA; } if (0 != qname) { stat = rtXmlEncEndElement (pctxt, qname, 0); if (stat != 0) return LOG_RTERR (pctxt, stat); rtxMemFreePtr (pctxt, qname); } } return 0; }
int XmlEnc_Fault (OSCTXT* pctxt, Fault* pvalue, const OSUTF8CHAR* elemName, const OSUTF8CHAR* nsPrefix) { int stat = 0; if (0 != elemName) { stat = rtXmlEncStartElement (pctxt, elemName, nsPrefix, TRUE); if (stat != 0) return LOG_RTERR (pctxt, stat); } { const OSUTF8CHAR* savedPrefix = nsPrefix; nsPrefix = rtXmlNSGetPrefix (pctxt, OSUTF8( "http://schemas.xmlsoap.org/soap/envelope/")); /* encode faultcode */ stat = rtXmlEncUTF8Str (pctxt, pvalue->faultcode. name, OSUTF8("faultcode"), 0); if (stat != 0) return LOG_RTERR (pctxt, stat); /* encode faultstring */ stat = rtXmlEncUTF8Str (pctxt, pvalue->faultstring , OSUTF8("faultstring"), 0); if (stat != 0) return LOG_RTERR (pctxt, stat); /* encode faultactor */ if (pvalue->m.faultactorPresent) { stat = rtXmlEncUTF8Str (pctxt, pvalue->faultactor , OSUTF8("faultactor"), 0); if (stat != 0) return LOG_RTERR (pctxt, stat); } /* encode detail */ if (pvalue->m.detailPresent) { stat = XmlEnc_Detail (pctxt, &pvalue->detail, OSUTF8("detail"), 0); if (stat != 0) return LOG_RTERR (pctxt, stat); } nsPrefix = savedPrefix; } stat = rtXmlEncEndElement (pctxt, elemName, nsPrefix); if (stat != 0) return LOG_RTERR (pctxt, stat); return (stat); }
int DOMTest_Config_item_map_entry (OSCTXT* pctxt, Config_item_map_entry* pvalue, xmlNodePtr pXmlNode, OSBOOL setChild) { xmlAttrPtr pXmlAttr = pXmlNode->properties; /* Populate attributes */ for ( ; 0 != pXmlAttr; pXmlAttr = pXmlAttr->next) { if (pXmlAttr->type == XML_ATTRIBUTE_NODE) { if (rtxUTF8StrEqual (pXmlAttr->name, OSUTF8("name"))) { pvalue->m.namePresent = 1; if (0 != ((xmlNodePtr)pXmlAttr)->children) { pvalue->name = ((xmlNodePtr)pXmlAttr)->children->content; } else { pvalue->name = (const OSUTF8CHAR*)""; } } } } /* Populate elements */ if (setChild) pXmlNode = pXmlNode->children; for ( ; 0 != pXmlNode; pXmlNode = pXmlNode->next) { if (pXmlNode->type == XML_ELEMENT_NODE) { if (rtxUTF8StrEqual (pXmlNode->name, OSUTF8("config-item")) || rtxUTF8StrEqual (pXmlNode->name, OSUTF8("config-item-set")) || rtxUTF8StrEqual (pXmlNode->name, OSUTF8("config-item-map-named")) || rtxUTF8StrEqual (pXmlNode->name, OSUTF8("config-item-map-indexed"))) { { Config_item_map_entry_element* pdata2; pdata2 = rtxMemAllocType (pctxt, Config_item_map_entry_element); if (pdata2 == NULL) return LOG_RTERR (pctxt, RTERR_NOMEM); asn1Init_Config_item_map_entry_element (pdata2); DOMTest_Config_item_map_entry_element (pctxt, pdata2, pXmlNode, FALSE); if (0 != pdata2) rtxDListAppend (pctxt, &pvalue->choice_list, (void*)pdata2); } } } } return 0; }
const OSUTF8CHAR* CSG_Indicator_ToString (OSINT32 value) { OSINT32 idx = value; if (idx >= 0 && idx < CSG_Indicator_ENUMTABSIZE) { return CSG_Indicator_ENUMTAB[CSG_Indicator_ENUMTAB[idx].transidx].name; } else return OSUTF8("_UNKNOWN_"); }
const OSUTF8CHAR* CauseMisc_ToString (OSINT32 value) { OSINT32 idx = value; if (idx >= 0 && idx < CauseMisc_ENUMTABSIZE) { return CauseMisc_ENUMTAB[CauseMisc_ENUMTAB[idx].transidx].name; } else return OSUTF8("_UNKNOWN_"); }
const OSUTF8CHAR* StateType_ToString (OSINT32 value) { OSINT32 idx = value; if (idx >= 0 && idx < StateType_ENUMTABSIZE) { return StateType_ENUMTAB[StateType_ENUMTAB[idx].transidx].name; } else return OSUTF8("_UNKNOWN_"); }
const OSUTF8CHAR* Units_ToString (OSINT32 value) { OSINT32 idx = value; if (idx >= 0 && idx < Units_ENUMTABSIZE) { return Units_ENUMTAB[Units_ENUMTAB[idx].transidx].name; } else return OSUTF8("_UNKNOWN_"); }
const OSUTF8CHAR* Values_format_ToString (OSINT32 value) { OSINT32 idx = value; if (idx >= 0 && idx < Values_format_ENUMTABSIZE) { return Values_format_ENUMTAB[Values_format_ENUMTAB[idx].transidx].name; } else return OSUTF8("_UNKNOWN_"); }
const OSUTF8CHAR* Technique_ToString (OSINT32 value) { OSINT32 idx = value; if (idx >= 0 && idx < Technique_ENUMTABSIZE) { return Technique_ENUMTAB[Technique_ENUMTAB[idx].transidx].name; } else return OSUTF8("_UNKNOWN_"); }
const OSUTF8CHAR* Ns11_Additive_ToString (OSINT32 value) { OSINT32 idx = value; if (idx >= 0 && idx < Ns11_Additive_ENUMTABSIZE) { return Ns11_Additive_ENUMTAB[Ns11_Additive_ENUMTAB[idx].transidx].name; } else return OSUTF8("_UNKNOWN_"); }
const OSUTF8CHAR* CurrencyCodeContentType_ToString (OSINT32 value) { OSINT32 idx = value; if (idx >= 0 && idx < CurrencyCodeContentType_ENUMTABSIZE) { return CurrencyCodeContentType_ENUMTAB [CurrencyCodeContentType_ENUMTAB[idx].transidx].name; } else return OSUTF8("_UNKNOWN_"); }
const OSUTF8CHAR* GAML_integrity_algorithm_ToString (OSINT32 value) { OSINT32 idx = value; if (idx >= 0 && idx < GAML_integrity_algorithm_ENUMTABSIZE) { return GAML_integrity_algorithm_ENUMTAB [GAML_integrity_algorithm_ENUMTAB[idx].transidx].name; } else return OSUTF8("_UNKNOWN_"); }
const OSUTF8CHAR* Access_stratum_release_indicator_ToString (OSINT32 value) { OSINT32 idx = value; if (idx >= 0 && idx < Access_stratum_release_indicator_ENUMTABSIZE) { return Access_stratum_release_indicator_ENUMTAB [Access_stratum_release_indicator_ENUMTAB[idx].transidx].name; } else return OSUTF8("_UNKNOWN_"); }
const OSUTF8CHAR* Registration_Cause_ToString (OSINT32 value) { OSINT32 idx = value; if (idx >= 0 && idx < Registration_Cause_ENUMTABSIZE) { return Registration_Cause_ENUMTAB [Registration_Cause_ENUMTAB[idx].transidx].name; } else return OSUTF8("_UNKNOWN_"); }
const OSUTF8CHAR* DocumentStatusCodeContentType_ToString (OSINT32 value) { OSINT32 idx = value; if (idx >= 0 && idx < DocumentStatusCodeContentType_ENUMTABSIZE) { return DocumentStatusCodeContentType_ENUMTAB [DocumentStatusCodeContentType_ENUMTAB[idx].transidx].name; } else return OSUTF8("_UNKNOWN_"); }
const OSUTF8CHAR* AnimateColor_color_interpolation_direction_ToString (OSINT32 value) { OSINT32 idx = value; if (idx >= 0 && idx < AnimateColor_color_interpolation_direction_ENUMTABSIZE) { return AnimateColor_color_interpolation_direction_ENUMTAB [AnimateColor_color_interpolation_direction_ENUMTAB[idx].transidx].name; } else return OSUTF8("_UNKNOWN_"); }
const OSUTF8CHAR* AltitudeAndDirection_directionOfAltitude_ToString (OSINT32 value) { OSINT32 idx = value; if (idx >= 0 && idx < AltitudeAndDirection_directionOfAltitude_ENUMTABSIZE) { return AltitudeAndDirection_directionOfAltitude_ENUMTAB [AltitudeAndDirection_directionOfAltitude_ENUMTAB[idx].transidx].name; } else return OSUTF8("_UNKNOWN_"); }
const OSUTF8CHAR* GeographicalCoordinates_latitudeSign_ToString (OSINT32 value) { OSINT32 idx = value; if (idx >= 0 && idx < GeographicalCoordinates_latitudeSign_ENUMTABSIZE) { return GeographicalCoordinates_latitudeSign_ENUMTAB [GeographicalCoordinates_latitudeSign_ENUMTAB[idx].transidx].name; } else return OSUTF8("_UNKNOWN_"); }
int XmlEnc_Invoice_PDU (OSCTXT* pctxt, Invoice* pvalue) { int stat; const OSUTF8CHAR* nsPrefix = 0; rtXmlNSSetNamespace (pctxt, OSUTF8("cct"), OSUTF8("urn:oasis:names:tc:ubl:CommonLeafTypes:1.0:0.65"), FALSE); rtXmlNSSetNamespace (pctxt, OSUTF8("cmn"), OSUTF8("http://www.sun.com/schema/spidermarkexpress/sm-common"), FALSE); rtXmlNSSetNamespace (pctxt, OSUTF8("jxb"), OSUTF8("http://java.sun.com/xml/ns/jaxb"), FALSE); rtXmlNSSetNamespace (pctxt, 0, OSUTF8("http://www.sun.com/schema/spidermarkexpress/sm-inv"), FALSE); nsPrefix = rtXmlNSGetPrefix (pctxt, OSUTF8("http://www.sun.com/schema/spidermarkexpress/sm-inv")); stat = rtXmlEncStartDocument (pctxt); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = rtXmlEncStartElement (pctxt, OSUTF8("invoice"), nsPrefix, FALSE); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = rtXmlEncNSAttrs (pctxt); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = rtXmlEncXSIAttrs (pctxt, FALSE); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = XmlEnc_Invoice (pctxt, pvalue, 0, nsPrefix); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = rtXmlEncEndElement (pctxt, OSUTF8("invoice"), nsPrefix); if (stat != 0) return LOG_RTERR (pctxt, stat); return stat; }
int XmlEnc_Ns1_Min_width (OSCTXT* pctxt, Ns1_Min_width* pvalue, const OSUTF8CHAR* elemName, const OSUTF8CHAR* nsPrefix) { int stat = 0; if (0 != elemName) { stat = rtXmlEncStartElement (pctxt, elemName, nsPrefix, TRUE); if (stat != 0) return LOG_RTERR (pctxt, stat); } { const OSUTF8CHAR* savedPrefix = nsPrefix; nsPrefix = rtXmlNSGetPrefix (pctxt, OSUTF8( "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0")); switch (pvalue->t) { case 1: /* encode alt */ stat = rtXmlEncUTF8Str (pctxt, pvalue->u.alt, 0, 0); if (stat != 0) return LOG_RTERR (pctxt, stat); break; case 2: /* encode alt_1 */ stat = rtXmlEncUTF8Str (pctxt, pvalue->u.alt_1, 0, 0); if (stat != 0) return LOG_RTERR (pctxt, stat); break; default: { char buf[40]; os_snprintf (buf, 40, "%d", pvalue->t); return LOG_RTERRNEW1 (pctxt, RTERR_INVOPT, rtxErrAddStrParm (pctxt, buf)); } } nsPrefix = savedPrefix; } stat = rtXmlEncEndElement (pctxt, elemName, nsPrefix); if (stat != 0) return LOG_RTERR (pctxt, stat); return (stat); }
int XmlDec_Invoice_PDU (OSCTXT* pctxt, Invoice* pvalue) { int stat; rtXmlpCreateReader (pctxt); asn1Init_Invoice (pvalue); stat = rtXmlpMatchStartTag (pctxt, OSUTF8("invoice"), 0); if (stat < 0) return LOG_RTERR (pctxt, stat); stat = XmlDec_Invoice (pctxt, pvalue); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = rtXmlpMatchEndTag (pctxt, -1); if (stat < 0) return LOG_RTERR (pctxt, stat); return stat; }
int XmlEnc_Seisdata (OSCTXT* pctxt, Seisdata* pvalue, const OSUTF8CHAR* elemName, const OSUTF8CHAR* nsPrefix) { int stat = 0; if (0 != elemName) { stat = rtXmlEncStartElement (pctxt, elemName, nsPrefix, TRUE); if (stat != 0) return LOG_RTERR (pctxt, stat); } /* encode head */ stat = XmlEnc_Headtype (pctxt, &pvalue->head, OSUTF8("head"), 0); if (stat != 0) return LOG_RTERR (pctxt, stat); /* encode xcrd */ stat = XmlEnc_Xcrdtype (pctxt, &pvalue->xcrd, OSUTF8("xcrd"), 0); if (stat != 0) return LOG_RTERR (pctxt, stat); /* encode ycrd */ stat = XmlEnc_Xcrdtype (pctxt, &pvalue->ycrd, OSUTF8("ycrd"), 0); if (stat != 0) return LOG_RTERR (pctxt, stat); /* encode zval */ stat = XmlEnc_Xcrdtype (pctxt, &pvalue->zval, OSUTF8("zval"), 0); if (stat != 0) return LOG_RTERR (pctxt, stat); /* encode cdp */ stat = XmlEnc_Xcrdtype (pctxt, &pvalue->cdp, OSUTF8("cdp"), 0); if (stat != 0) return LOG_RTERR (pctxt, stat); /* encode data */ stat = XmlEnc_Xcrdtype (pctxt, &pvalue->data, OSUTF8("data"), 0); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = rtXmlEncEndElement (pctxt, elemName, nsPrefix); if (stat != 0) return LOG_RTERR (pctxt, stat); return (stat); }