Selecting values out of XML with SQL Server 2012 with nested namespaces - sql

My XML looks like
<?xml version="1.0" encoding="UTF-8"?>
<ListasExternasFull xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Encabezado xmlns="http://tempuri.org/">
<Acceso>true</Acceso>
<Usuario>FENALCO</Usuario>
<Contrasena>FENALCO2015PROD</Contrasena>
<Documento>24944511</Documento>
<TipoDocumento>1</TipoDocumento>
<Nombres />
<Apellidos />
<Login />
<Fecha>2016-01-23T17:07:56.1986626-05:00</Fecha>
<IdConsulta>0</IdConsulta>
</Encabezado>
<objContraloria xmlns="http://tempuri.org/">
<Id>92798</Id>
<IsContraloria>false</IsContraloria>
<Cedula>24944511</Cedula>
<Nombre />
<Departamento />
<Municipio />
<EntidadAfectada />
<FallosACargo />
<TipoResponsabilidad />
<TipoPersona />
<ReportadoPor />
<FechaControl>2016-01-23T17:03:43.13</FechaControl>
<Excepcion />
</objContraloria>
<objFosyga xmlns="http://tempuri.org/">
<Id>92496</Id>
<IsFosyga>false</IsFosyga>
<NumeroIdentidad>24944511</NumeroIdentidad>
<Nombre />
<Apellido />
<Departamento />
<Municipio />
<Estado />
<Entidad />
<Regimen />
<FechaAfiliacion />
<TipoAfiliado />
<FechaControl>2016-01-23T17:07:56.285612-05:00</FechaControl>
<Excepcion>Se generó un error al consultar la lista. Por favor intente mas tarde o contacte a su administrador.</Excepcion>
</objFosyga>
<objOfac xmlns="http://tempuri.org/">
<Id>91950</Id>
<Cedula>24944511</Cedula>
<Nombre />
<Direccion />
<Tipo />
<Programa />
<Score />
<FechaControl>2016-01-23T17:03:43.097</FechaControl>
<Lista />
<Excepcion />
<IsOfac>false</IsOfac>
</objOfac>
<objPolicia xmlns="http://tempuri.org/">
<Id>93113</Id>
<Cedula>24944511</Cedula>
<Nombre />
<IsAntecedentes>false</IsAntecedentes>
<IsRegistrado>false</IsRegistrado>
<Mensaje />
<FechaControl>2016-01-23T17:08:17.3118339-05:00</FechaControl>
<IsPolicia>false</IsPolicia>
<Excepcion>Se generó un error al consultar la lista. Por favor intente mas tarde o contacte a su administrador.</Excepcion>
</objPolicia>
<objRues xmlns="http://tempuri.org/">
<Id>91297</Id>
<TipoID />
<Nit>24944511</Nit>
<RazonSocial />
<Descripcion_Camara />
<Descripcion_Categoria_Matricula />
<Fecha_Matricula />
<IsRM>false</IsRM>
<IsRUP>false</IsRUP>
<IsESAL>false</IsESAL>
<IsRNT>false</IsRNT>
<FechaControl>2016-01-23T17:03:43.473</FechaControl>
<IsRUES>false</IsRUES>
<Excepcion />
</objRues>
<objSim xmlns="http://tempuri.org/">
<Id>92657</Id>
<Cedula>24944511</Cedula>
<NoRadicado />
<Identificador />
<FechaSolicitud />
<Estado />
<Resultado />
<DisponibleEntrega />
<Excepcion />
<FechaControl>2016-01-23T17:03:43.207</FechaControl>
<IsSim>false</IsSim>
</objSim>
<objSimit xmlns="http://tempuri.org/">
<Id>92905</Id>
<Cedula>24944511</Cedula>
<Infractor />
<Resolucion />
<FechaResolucion />
<Comparendo />
<FechaComparendo />
<Secretaria />
<Estado />
<Infraccion />
<ValorMulta />
<InteresMora />
<ValorAdicional />
<ValorPagar />
<FechaControl>2016-01-23T17:03:43.55</FechaControl>
<IsSimit>false</IsSimit>
<Excepcion />
</objSimit>
<objSisben xmlns="http://tempuri.org/">
<Id>94783</Id>
<IsSisben>true</IsSisben>
<NumeroDocumento>24944511</NumeroDocumento>
<Nombres>MARIA ISLENY</Nombres>
<Apellidos>RODAS DE FRANCO</Apellidos>
<TipoDocumento>Cédula de Ciudadanía</TipoDocumento>
<Departamento>RISARALDA</Departamento>
<Municipio>PEREIRA</Municipio>
<Area>1</Area>
<Ficha>10097</Ficha>
<Puntaje>47,86</Puntaje>
<FechaModificacion>2015/03/05</FechaModificacion>
<Estado>VALIDADO</Estado>
<FechaControl>2016-01-23T17:03:43.287</FechaControl>
<Excepcion />
</objSisben>
<objRuaf xmlns="http://tempuri.org/">
<Id>84066</Id>
<IsRuaf>true</IsRuaf>
<TipoIdentificacion>CC</TipoIdentificacion>
<Identificacion>24944511</Identificacion>
<Nombre>MARIA ISLENY RODAS DE FRANCO</Nombre>
<Sexo>FEMENINO</Sexo>
<UbicacionAfiliacion>RISARALDA - PEREIRA</UbicacionAfiliacion>
<EstadoAfiliado>ACTIVO</EstadoAfiliado>
<Administradora>NUEVA EPS SA</Administradora>
<Regimen>SALUD: CONTRIBUTIVO</Regimen>
<FechaAfiliacion>2015-08-01</FechaAfiliacion>
<TipoAfiliado>BENEFICIARIO</TipoAfiliado>
<FechaControl>2016-01-23T17:03:45.207</FechaControl>
<Observacion />
<Excepcion />
</objRuaf>
<objDisponibilidad xmlns="http://tempuri.org/">
<Fosyga>true</Fosyga>
<Sisben>true</Sisben>
<Ofac>true</Ofac>
<Policia>true</Policia>
<Rues>true</Rues>
<Sim>true</Sim>
<Simit>true</Simit>
<Contraloria>true</Contraloria>
<Onu>true</Onu>
<Ruaf>true</Ruaf>
</objDisponibilidad>
</ListasExternasFull>
and I can not get reach to consult the objRuaf/Identificacion node due to nested namespaces aguin I can help with a query to reach these nodes

Declare default XML namespace WITH XMLNAMESPACES (DEFAULT 'http://tempuri.org/'):
;WITH XMLNAMESPACES (DEFAULT 'http://tempuri.org/')
SELECT val = s.c.value('.', 'NVARCHAR(100)')
FROM #x.nodes('//objRuaf/Identificacion') AS s(c);
LiveDemo
Or:
;WITH XMLNAMESPACES ('http://tempuri.org/' AS a)
SELECT val = s.c.value('.', 'NVARCHAR(100)')
FROM #x.nodes('//a:objRuaf/a:Identificacion') AS s(c)

Related

Outlook Web Add-In error 'There were deployment errors. Continue?'

Currently I'm working on an Outlook Add-In using Visual Studio 2022 with React (TypeScript). When starting the application a message box appears containing following message:
There were deployment errors. Continue?
The output of the build console doesn't help at all because it only says that an error has occurred but without any further information.
Is there any way to get more error details or does anyone know how to fix this?
Manifest:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xsi:type="MailApp">
<Id>0ca51293-705c-45d5-975c-e59909dab3ea</Id>
<Version>1.0.0.0</Version>
<ProviderName>Company</ProviderName>
<DefaultLocale>de-DE</DefaultLocale>
<DisplayName DefaultValue="OutlookAddInWeb" />
<Description DefaultValue="OutlookAddInWeb Description" />
<IconUrl DefaultValue="~remoteAppUrl/Images/Button64x64.png" />
<HighResolutionIconUrl DefaultValue="~remoteAppUrl/Images/Button80x80.png" />
<SupportUrl DefaultValue="https://www.somesite.com/" />
<AppDomains>
<AppDomain>https://login.microsoftonline.com</AppDomain>
<AppDomain>https://localhost:44488</AppDomain>
</AppDomains>
<Hosts>
<Host Name="Mailbox" />
</Hosts>
<Requirements>
<Sets>
<Set Name="Mailbox" MinVersion="1.1" />
</Sets>
</Requirements>
<FormSettings>
<Form xsi:type="ItemEdit">
<DesktopSettings>
<SourceLocation DefaultValue="~remoteAppUrl/" />
</DesktopSettings>
</Form>
</FormSettings>
<Permissions>ReadWriteItem</Permissions>
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit" />
<DisableEntityHighlighting>false</DisableEntityHighlighting>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
<Requirements>
<bt:Sets DefaultMinVersion="1.5">
<bt:Set Name="Mailbox" />
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<FunctionFile resid="Commands.Url" />
<ExtensionPoint xsi:type="MessageComposeCommandSurface">
<OfficeTab id="TabDefault">
<Group id="msgComposeGroup">
<Label resid="GroupLabel" />
<Control xsi:type="Button" id="msgComposeOpenPaneButton">
<Label resid="TaskpaneButton.Label" />
<Supertip>
<Title resid="TaskpaneButton.Label" />
<Description resid="TaskpaneButton.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16" />
<bt:Image size="32" resid="Icon.32x32" />
<bt:Image size="80" resid="Icon.80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="Taskpane.Url" />
</Action>
</Control>
<Control xsi:type="Button" id="ActionButton">
<Label resid="ActionButton.Label" />
<Supertip>
<Title resid="ActionButton.Label" />
<Description resid="ActionButton.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16" />
<bt:Image size="32" resid="Icon.32x32" />
<bt:Image size="80" resid="Icon.80x80" />
</Icon>
<Action xsi:type="ExecuteFunction">
<FunctionName>action</FunctionName>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="Icon.16x16" DefaultValue="~remoteAppUrl/Images/Button16x16.png" />
<bt:Image id="Icon.32x32" DefaultValue="~remoteAppUrl/Images/Button32x32.png" />
<bt:Image id="Icon.80x80" DefaultValue="~remoteAppUrl/Images/Button80x80.png" />
</bt:Images>
<bt:Urls>
<bt:Url id="Commands.Url" DefaultValue="~remoteAppUrl/commands.html" />
<bt:Url id="Taskpane.Url" DefaultValue="~remoteAppUrl/" />
</bt:Urls>
<bt:ShortStrings>
<bt:String id="GroupLabel" DefaultValue="Outlook Add-in" />
<bt:String id="TaskpaneButton.Label" DefaultValue="Show Taskpane" />
<bt:String id="ActionButton.Label" DefaultValue="Perform an action" />
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="TaskpaneButton.Tooltip" DefaultValue="Opens a pane displaying all available properties." />
<bt:String id="ActionButton.Tooltip" DefaultValue="Perform an action when clicked." />
</bt:LongStrings>
</Resources>
<WebApplicationInfo>
<Id>1d32bd7d-70ab-42b5-b11a-8e73a6b8ab4a</Id>
<Resource>api://localhost:44488/1d32bd7d-70ab-42b5-b11a-8e73a6b8ab4a</Resource>
<Scopes>
<Scope>openid</Scope>
<Scope>profile</Scope>
</Scopes>
</WebApplicationInfo>
</VersionOverrides>
</VersionOverrides>
</OfficeApp>
Use https://learn.microsoft.com/en-us/office/dev/add-ins/testing/troubleshoot-manifest to validate your manifest file. There are issues with your manifest file.

i am getting while running on my mobile. But it is running fine on ionic serve

Getting ERR_CLEARTEXT_NOT_PERMITTED error. I have tried every thing change my config.xml , network_config getting update automatically when i add my domain. ionic cli is 5.4.13
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.ionic.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>MyApp</name>
<description>An awesome Ionic/Cordova app.</description>
<author email="hi#ionicframework.com" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<preference name="ScrollEnabled" value="false" />
<preference name="android-minSdkVersion" value="19" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
<platform name="android">
<access origin="*" />
<preference name="android-usesCleartextTraffic" value="true" />
<allow-navigation href="*" />
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:networkSecurityConfig="#xml/network_security_config" />
<application android:usesCleartextTraffic="true" />
</edit-config>
<resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />
<allow-intent href="market:*" />
</platform>
</widget>
You can use ionic cordova http plugin for network request your error maybe solve.
Here is link for that
https://ionicframework.com/docs/native/http

Post Array type of Xml data to Http calls

Hi i just want to know how to post xml data to Http post method in Objective-C by dynamically instead of static string Appending
here my sample xml Data :
<xml-packet version="2.5" ctr="1" timestamp="1345193301000">
<device id="0" name="hh" ipaddr="0.0.0.1" type="Hello" status="NORMAL"
capability="ios">
<devcice name="5s" type="2" status="NORMAL">
<sensor name="sample" type="" status="NORMAL">
<event timestamp="1345193300000" type="ITEM">
<position agid="3" name="Manager" lastsynctime="1344433367000" action="" />
<position agid="6" name="LOC3" lastsynctime="1343818867000" action="" />
<position agid="8" name="LOC5" lastsynctime="1344433367000" action="" />
<position agid="4" name="LOC1" lastsynctime="1344504045000" action="" />
<position agid="5" name="LOC2" lastsynctime="1343386683000" action="" />
<position agid="7" name="LOC4" lastsynctime="1344238182000" action="" />
</event>
<event timestamp="1345192938000" type="ITEM">
<position agid="1" name="CEO" lastsynctime="1344594202000" action="update">
<item id="ac001520101217000a012222" result="" status="NEW" lastmodifiedtime="" />
<item id="e20019838306016127500770" result="" status="NEW" lastmodifiedtime="" />
<item id="e20019838309014424301e64" result="" status="NEW" lastmodifiedtime="" />
<item id="2005790000000000000005fc" result="" status="MISSING" lastmodifiedtime="1345212728000" />
<item id="00000000012102007400bd39" result="" status="MISSING" lastmodifiedtime="1344594171000" />
</position>
</event>
</sensor>
</device>
</xml-packet>

Facing issue while mapping list within list in xml to xml mapping using mule dataweave

While I am transforming one xml to another and doing mapping list within list elements.I am getting one exception .
"Cannot coerce a :string to a :object (com.mulesoft.weave.mule.exception.WeaveExecutionException). Message payload is of type: WeaveMessageProcessor$WeaveOutputHandler"
Input xml:
<?xml version="1.0" encoding="UTF-8"?>
<ZCOM_IDD2565_AGREEMENT>
<transaction>
<id>www</id>
<timestamp>20160512 200939</timestamp>
<sender>ghh566</sender>
</transaction>
<identification>
<R3number>88898</R3number>
<enterpriseId />
<sourcesystemid>ffff</sourcesystemid>
<sourcesystemobjectid>999089</sourcesystemobjectid>
</identification>
<details>
<newTransaction>N</newTransaction>
<type>siiii</type>
<organizational>
<salesOrg>1223</salesOrg>
<currency>RUPEE</currency>
</organizational>
<description>
<internal>jhjb hjgjhg jkhjh</internal>
<external>jhhgjhb</external>
<project>owdoie</project>
</description>
<dates>
<validFrom>2016-04-05</validFrom>
<validTo>2017-04-30</validTo>
<fixedValue>0000-00-00</fixedValue>
</dates>
<creditTriggerEvent>S</creditTriggerEvent>
</details>
<rules>
<ZCOM_AGR_RULES>
<rule>
<ruleType>923</ruleType>
<agreementItem />
<ruleNumber />
<quantities>
<minimum />
<maximum />
</quantities>
<firstRecordA />
<application />
<conditionType>dddd</conditionType>
<salesOrg>1000</salesOrg>
<distributionChannel />
<division />
<endCustomerNumber />
<serialNumber />
<soldTo>
<ZCOM_AGR_SOLD>
<id>990888</id>
<addressNumber>2132435</addressNumber>
<name>dsfdg fdg</name>
<streetAddress>hu78hj k</streetAddress>
<postalCode>5654</postalCode>
<city>sfds</city>
<country>sdsa</country>
<phone>555-555-5555</phone>
<languageKey>E</languageKey>
<district />
<houseNumber>poio aaed</houseNumber>
<region>iii</region>
</ZCOM_AGR_SOLD>
<ZCOM_AGR_SOLD>
<id>777787</id>
<addressNumber>121223</addressNumber>
<name>dsfdg fdg</name>
<streetAddress>hu78hj k</streetAddress>
<postalCode>5654</postalCode>
<city>sfds</city>
<country>sdsa</country>
<phone>555-555-5555</phone>
<languageKey>E</languageKey>
<district />
<houseNumber>poio aaed</houseNumber>
<region>iii</region>
</ZCOM_AGR_SOLD>
</soldTo>
<shipTo>
<id />
<addressNumber />
<name />
<streetAddress />
<postalCode />
<city />
<country />
<phone />
<languageKey />
<district />
<houseNumber />
<region />
</shipTo>
<upc />
<catalogNumber />
<discountSchedule />
<priceGroupCode />
<priceFamily />
<requested-discount-netPrice />
<delete />
<customerRate />
<priceChange />
<dates>
<validFrom>2016-04-05</validFrom>
<validTo>2017-04-30</validTo>
<fixedValue>0000-00-00</fixedValue>
</dates>
<condition>
<type />
<calculationType />
<approved-discount-netPrice>0.00000</approved-discount-netPrice>
<unitOfMeasue />
<conditionitemindex />
<additionalvaluedays />
<fixedvaluedate />
<maxiumSalesOrdersPerConditionRecord />
<numberOfIncrementalScale />
<scaleNumberForPricing />
</condition>
</rule>
</ZCOM_AGR_RULES>
<ZCOM_AGR_RULES>
<rule>
<ruleType>920</ruleType>
<agreementItem />
<ruleNumber />
<quantities>
<minimum />
<maximum />
</quantities>
<firstRecordA />
<application />
<conditionType>rrrr</conditionType>
<salesOrg>1000</salesOrg>
<distributionChannel />
<division />
<endCustomerNumber />
<serialNumber />
<soldTo />
<shipTo>
<id />
<addressNumber />
<name />
<streetAddress />
<postalCode />
<city />
<country />
<phone />
<languageKey />
<district />
<houseNumber />
<region />
</shipTo>
<upc />
<catalogNumber />
<discountSchedule>B5</discountSchedule>
<priceGroupCode />
<priceFamily />
<requested-discount-netPrice>0.00</requested-discount-netPrice>
<delete />
<customerRate>0.44</customerRate>
<priceChange>X</priceChange>
<dates>
<validFrom>2016-04-05</validFrom>
<validTo>2017-04-30</validTo>
<fixedValue>0000-00-00</fixedValue>
</dates>
<condition>
<type>rrrr</type>
<calculationType>A</calculationType>
<approved-discount-netPrice>0.35000</approved-discount-netPrice>
<unitOfMeasue>%</unitOfMeasue>
<conditionitemindex />
<additionalvaluedays />
<fixedvaluedate />
<maxiumSalesOrdersPerConditionRecord />
<numberOfIncrementalScale />
<scaleNumberForPricing />
</condition>
</rule>
</ZCOM_AGR_RULES>
</rules>
</ZCOM_IDD2565_AGREEMENT>
Data weave script code
%dw 1.0
%output application/xml
%type dtfield = :string { format: "yyyyMMdd" }
%namespace ns0 http://schemas.xmlsoap.org/soap/envelope/
%namespace ns1 FlexiWebService
---
{
ns0#Envelope: {
ns0#Header: {
ns1#AuthHeader: {
Username: "dssdfdf",
Password: "dfff"
}
},
ns0#Body: {
Z_IDDO735_IRM_AGRMNTS01: {
IDOC: {
'_-IRM_-AGMTK01': {
(TRANS: payload.ZCOM_IDD2565_AGREEMENT.details.newTransaction as :string) when payload.ZCOM_IDD2565_AGREEMENT.details.newTransaction?,
(BOART_AG: payload.ZCOM_IDD2565_AGREEMENT.details.type) when payload.ZCOM_IDD2565_AGREEMENT.details.type? ,
(AMTNUM: payload.ZCOM_IDD2565_AGREEMENT.identification.sourcesystemobjectid) when payload.ZCOM_IDD2565_AGREEMENT.identification.sourcesystemobjectid?,
(AGMTNUM_EXT: payload.ZCOM_IDD2565_AGREEMENT.details.description.external as :string) when payload.ZCOM_IDD2565_AGREEMENT.details.description.external?,
(AGMTTXT: payload.ZCOM_IDD2565_AGREEMENT.details.description.internal) when payload.ZCOM_IDD2565_AGREEMENT.details.description.internal?,
(VALID_FROM: payload.ZCOM_IDD2565_AGREEMENT.details.dates.validFrom as :dtfield replace "-" with "") when payload.ZCOM_IDD2565_AGREEMENT.details.dates.validFrom?,
(VALID_TO: payload.ZCOM_IDD2565_AGREEMENT.details.dates.validTo as :dtfield replace "-" with "") when payload.ZCOM_IDD2565_AGREEMENT.details.dates.validTo?,
'_-IRM_-AGMTK02': {
ZIDDO735_AGMTK02: {
(FV_DATE: payload.ZCOM_IDD2565_AGREEMENT.details.dates.fixedValue as :dtfield replace "-" with "") when payload.ZCOM_IDD2565_AGREEMENT.details.dates.fixedValue?,
(TDOBNAME: payload.ZCOM_IDD2565_AGREEMENT.details.creditTriggerEvent) when payload.ZCOM_IDD2565_AGREEMENT.details.creditTriggerEvent?
}
}
},
E1EDK14: {
(ORGID: payload.ZCOM_IDD2565_AGREEMENT.details.organizational.salesOrg) when payload.ZCOM_IDD2565_AGREEMENT.details.organizational.salesOrg?,
ZIDDO735_E1EDK14: {
(CURR: payload.ZCOM_IDD2565_AGREEMENT.details.organizational.currency) when payload.ZCOM_IDD2565_AGREEMENT.details.organizational.currency?
}
},
((payload.ZCOM_IDD2565_AGREEMENT.rules.*ZCOM_AGR_RULES default []) map {
E1KOMG:{
KVEWE: $.rule.firstRecordA,
KOTABNR: $.rule.condition.type,
KAPPL: $.rule.application,
VKORG: $.rule.salesOrg,
VTWEG: $.rule.distributionChannel,
EAN11: $.rule.upc,
KONDM: $.rule.discountSchedule,
EVRTP: $.rule.agreementItem,
HIENR: $.rule.endCustomerNumber,
POSNR: $.rule.ruleNumber,
ANZSN: $.rule.requested-discount-netPrice,
VKGRP: $.rule.priceGroupCode,
ZIDDO735_E1KOMG_QUANTITY: {
TDID_MIN_QTY: $.rule.quantities.minimum,
TDID_MAX_QTY: $.rule.quantities.maximum
},
ZIDDO735_E1KOMG: {
ZIDD0735_SHIP_TO_KUNWE: {
LAND1: $.rule.shipTo.country,
NAME1: $.rule.shipTo.name,
ORT01: $.rule.shipTo.city,
REGIO: $.rule.shipTo.region,
TELF1: $.rule.shipTo.phone as :string replace "-" with "",
ADRNR: $.rule.shipTo.addressNumber,
SPRAS: $.rule.shipTo.languageKey,
STRAS: $.rule.shipTo.streetAddress
},
(ZIDD0735_KNA1_DETAILS: $.rule.soldTo.*ZCOM_AGR_SOLD default [] map {
KUNNR: $.id,
LAND1: $.country,
NAME1: $.name,
ORT01: $.city,
PSTLZ: $.postalCode,
REGIO: $.region,
TELF1: $.phone as :string replace "-" with "",
ADRNR: $.addressNumber,
SPRAS: $.languageKey,
STRAS: $.streetAddress
}) when ($.rule.soldTo !="" and $.rule.soldTo.*ZCOM_AGR_SOLD as :object !="")
},
E1KONH: {
DATAB: $.rule.dates.validFrom as :dtfield replace "-" with "",
DATBI: $.rule.dates.validTo as :dtfield replace "-" with "",
E1KONP: {
KSCHL: $.rule.conditionType,
KRECH: $.rule.condition.calculationType,
KBETR: $.rule.condition.approved-discount-netPrice,
KONWA: $.rule.condition.unitOfMeasue,
ZAEHK_IND: $.rule.condition.conditionitemindex,
VALTG: $.rule.condition.additionalvaluedays,
VALDT: $.rule.condition.fixedvaluedate,
KLF_STG: $.rule.condition.numberOfIncrementalScale,
KLF_KAL: $.rule.condition.scaleNumberForPricing
}
}
}})
}
}
}
}
}
Actually what is happening, fields under ZIDD0735_KNA1_DETAILS-node of output xml is mapped to fields under ZCOM_AGR_SOLD and ZCOM_AGR_SOLD is List of data or you can say array.In output where I have values for ZCOM_AGR_SOLD, I am getting data under ZIDD0735_KNA1_DETAILS, but instead of the repeated values of ZIDD0735_KNA1_DETAILS I am getting ZCOM_AGR_SOLD under ZIDD0735_KNA1_DETAILS with all input xml node names not output node names.This is happening with this field only. rest everything is working fine.
This is a similar scenario:
https://forums.mulesoft.com/questions/1108/dataweave-date-conversion-from-string.html
Could it be that your dates are the one causing the exception?

How to get value from XML in stored procedure?

Can you all help me for this problem?
I want to get value from following XML in sql stored procedure. I don't get vlaue if 'xsi:type="ActiveDirectoryItem"' is in tag 'anyType', and 'ActiveDirectoryItems' tag is also with URLs. How can i do to get only values?
<?xml version="1.0" encoding="utf-8" ?>
<ActiveDirectoryItems xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">
<Items>
<anyType xsi:type="ActiveDirectoryItem">
<FirstName />
<MiddleInitial />
<LastName />
<DisplayName>Migrate-group</DisplayName>
<UserPrincipalName />
<PostalAddress />
<ResidentialAddress />
<Title />
<HomePhone />
<OfficePhone />
<Mobile />
<Fax />
<Email>Migrate-group#gmail.com</Email>
<Url />
<AccountName>Migrate-group</AccountName>
<DistinguishedName />
<IsAccountActive>false</IsAccountActive>
<ManagedBy />
<Manager />
<CompareType>0</CompareType>
<Description />
<Department />
<Company />
<Type />
</anyType>
</Items>
<GlobalCatalog />
</ActiveDirectoryItems>
The format i want to get is as the following:
DisplayName Email Account Name
Migrate-group Migrate-group#gmail.com Migrate-group
you can use the value keyword
Example:
DECLARE #MyXml XML = '<Root><SomeData>100</SomeData></Root>'
DECLARE #Something INT
SELECT #Something = #MyXml.value('(//Root/SomeData)[1]', 'INT')