I'm stuck on XSLT1.0 with no extensions.
I need to get a list of nodes whose attributes are distinct. From the XML below below, the result should be 1,2,3,5 for the first post_press_version (25) and 1,2,3,6 for the second (26)
<order>
<post_press_version>
<post_press_version_id>25</post_press_version_id>
<hopper_allocations>
<hopper_sequence>
<sequence_id>2</sequence_id>
<sequence_part_produced_id>37</sequence_part_produced_id>
<sequence_part_produced_name>96854-12WS10</sequence_part_produced_name>
<sequence_qty>2</sequence_qty>
<hopper number="0" id="" is_insert="False"/>
<hopper number="1" id="23" is_insert="False">96854-6FL</hopper>
<hopper number="2" id="13" is_insert="False">96854-8FL003</hopper>
<hopper number="3" id="15" is_insert="False">96854-10FL004</hopper>
<hopper number="4" id="" is_insert="False"/>
<hopper number="5" id="" is_insert="False"/>
<hopper number="6" id="" is_insert="False"/>
</hopper_sequence>
<hopper_sequence>
<sequence_id>3</sequence_id>
<sequence_part_produced_id>38</sequence_part_produced_id>
<sequence_part_produced_name>96854-12WS20</sequence_part_produced_name>
<sequence_qty>250</sequence_qty>
<hopper number="0" id="" is_insert="False"/>
<hopper number="1" id="24" is_insert="False">96854-6FL10</hopper>
<hopper number="2" id="29" is_insert="False">96854-8FL</hopper>
<hopper number="3" id="" is_insert="False"/>
<hopper number="4" id="" is_insert="False"/>
<hopper number="5" id="31" is_insert="False">96854-10FL</hopper>
<hopper number="6" id="" is_insert="False"/>
</hopper_sequence>
</hopper_allocations>
</post_press_version>
<post_press_version>
<post_press_version_id>26</post_press_version_id>
<hopper_allocations>
<hopper_sequence>
<sequence_id>2</sequence_id>
<sequence_part_produced_id>37</sequence_part_produced_id>
<sequence_part_produced_name>96854-12WS10</sequence_part_produced_name>
<sequence_qty>2</sequence_qty>
<hopper number="0" id="" is_insert="False"/>
<hopper number="1" id="23" is_insert="False">96854-6FL</hopper>
<hopper number="2" id="13" is_insert="False">96854-8FL003</hopper>
<hopper number="3" id="15" is_insert="False">96854-10FL004</hopper>
<hopper number="4" id="" is_insert="False"/>
<hopper number="5" id="" is_insert="False"/>
<hopper number="6" id="" is_insert="False"/>
</hopper_sequence>
<hopper_sequence>
<sequence_id>3</sequence_id>
<sequence_part_produced_id>38</sequence_part_produced_id>
<sequence_part_produced_name>96854-12WS20</sequence_part_produced_name>
<sequence_qty>250</sequence_qty>
<hopper number="0" id="" is_insert="False"/>
<hopper number="1" id="24" is_insert="False">96854-6FL10</hopper>
<hopper number="2" id="29" is_insert="False">96854-8FL</hopper>
<hopper number="3" id="" is_insert="False"/>
<hopper number="4" id="" is_insert="False"/>
<hopper number="5" id="31" is_insert="False"/>
<hopper number="6" id="" is_insert="False">96854-10FL</hopper>
</hopper_sequence>
</hopper_allocations>
</post_press_version>
I tried the XSL below, but it only returns 1,2,3: the results of the first hopper node in the first hopper_sequence
<xsl:template match="order">
<html>
<body>
<xsl:for-each
select="/order/post_press_version/hopper_allocations/hopper_sequence/hopper[node() and not(#number = preceding::hopper/#number)]]">
<p>
<xsl:value-of select="../../../post_press_version_id"/>-<xsl:value-of select="#number"/>
</p>
</xsl:for-each>
</body>
</html>
</xsl:template>
I'm struggling to figure out where I'm goign wrong. I laso tried the Meunchen method with this key, but get similar results
<xsl:key name="unique_post_press_version_hoppers" match="/order/post_press_version/hopper_allocations/hopper_sequence/hopper" use="concat(../../../post_press_version_id, #number)"/>
Any suggestions?
Thanks
Mark
I updated and used your XML and find the proper output as you want. please look again it is correct. Only zero is coming.
Related
I Have a TABLE in that one filed have XML data, below I have provided and I need to read this fields and filter the data in SQL QUery, Can someone help to read below select list fields?
XML is:
<Order
xmlns:Order="http://www.hp.com/namespaces/iscs/base/ordermanagement/ois/schemas/order_xml"
UniqueId="" Id="SCEO37600056" Name="" DisplayName=""
Description="" ShopperId="0c52f72f-d24d-492b-89e8-a8f433b652b1"
SerializationVersion="1.0.0" SourceCode=""
CustomerId="SCEU33684387" CustomerEmail="administratie#entis.ai"
TaxLogic="DRC" DefaultTaxRate="21" OrderEDDMessage="UnKnown"
QuoteCreatedOn="1901-01-01T00:00:00" OrderKey="SCEO37600056"
CurrencyCode="EUR" Language="nl"
CurrentApplication="NLSMBCallCenter" IPAddress=""
DiscountType="None" CanProcess="false" AccountId="SCEA3258"
CatalogName="NL Public (CG1926)" Tier1="false"
ExternalAccountId="" CustomerName="Tineke van Westrenen"
CompanyName="Default Public Account" SalesRepId="SCEU33285893"
QuoteId="" AgentId="" AgentLogin="" QuoteCreatedBy=""
OrderCreatedBy="" QuoteCreatedDate="1901-01-01T00:00:00"
CommunityId="SCESG23099"
InternalComments="DYN_BUNDLE_0008162_6B8D6EA_ABH on BC pricePGS Fraud Review
-- Order removed from RMS Hold - X Minute Services -- Order released - X Minute Services "
ExternalComments=""
PSTQSTExemptionCode="" GSTHSTExemptionCode=""
InvoiceComments="" PurchaseStatus="" PrimaryUse=""
CatalogId="CG1926" BillingBlock="false"
ReceivedInvoice="false" BusinessPipeline=""
CustomerRequestedDeliveryDate="" CustomerRequestedDeliveryTime=""
BypassAvaialblility="false" BypassAvaialblilityReason=""
CustomerSegment="Business" ProcessingType="Regular"
SendSiebel="false" AssociateOpportunity=""
CheckInventory="true" IsInventoryAvailable="false"
CountryKey="NL" Region="EMEA" ApplyForRecycleServices=""
RegisterForInternetServiceProvider="" RequestToIssueReceipt=""
ReceiveOrderStatusMails="" CanValidatePipeLine="true"
IsCCRepApproved="false" FulfillmentId="EU_Direct"
SourceCatalogKey="CAT-1157426" ShouldSettleBill="false"
IsPriceInclusiveofTax="true" IsFrozenQuote="false"
ShouldSettlePayPal="false" DiscountAllowanceExceeded="false"
DiscountAllowanceExceededAmount="0"
HasDisplayedDiscountExceededMsg="false"
PriceIncludesRegulatoryFee="false"
HasMultipleLSPFulfillment="false"
IsEDDMessageRequested="false" FulfillmentSegment="SMB"
FulfillmentSubSegment="Public" CustomerApprovalEmail=""
ClubName="" HasOutOfStockItem="false" ISDRCEligible="true"
ISDRCApplied="true" Doc_number="0087a107-49b337ac8-7"
ISVIESRequired="false" OrderWithSavedCardProfile="false"
Is3DSecure="false" IsValidGeoBlockingSoldtoCountry="false"
ISGeoBlockingApplied="false" ISGeoBlockingEligible="false"
GeoBlockingSoldToCountry="NL" OrderMethodType="ZCDO"
OrderType="Regular" OrderSource="ZISCSCC" Currency=""
Prefix="" DealDescriptor="NLEURSP" OrderCancelledBy=""
OrderStatus="Open" OrderDate="2022-11-22T14:48:55">
<EffectiveStartDate>1901-01-01T00:00:00</EffectiveStartDate>
<EffectiveEndDate>1901-01-01T00:00:00</EffectiveEndDate>
<Status>Open</Status>
<Created UniqueId="" Id="" ActionPerformed="Created" PerformedBy="AUTH\vanVegS" PerformedDate="2022-11-22T13:48:55.2475289+00:00" />
<LastModified UniqueId="" Id="" ActionPerformed="Modified" PerformedBy="AUTH\vanVegS" PerformedDate="2022-11-22T13:48:58.3725983+00:00" />
<ExtendedProperties />
<ExpirationDate>2022-12-22T00:00:00</ExpirationDate>
<OriginationSource>CallCenter</OriginationSource>
<SubTotal UniqueId="" Id="" Amount="23137.97" />
<BasePriceSubTotal UniqueId="" Id="" Amount="23137.8" />
<Total UniqueId="" Id="" Amount="20874.57" />
<Errors />
<LineItems>
<Item UniqueId="" Id="1" Name="" DisplayName="" Description="HP ZBook Firefly G9 mobiele workstation met NVIDIA® T500" OSSStatus="" GroupId="1" Quantity="10" ActualQty="0" AttachId="0" DynamicBunImageURL="" IsDisplayable="true" Availability="0" ValidatePrice="true" CurrentQty="0" FutureQty="-1" ReservationQty="0" EDD="TBA" FutureUsed="false" IsValid="true" CampaignCode="" TaxLogic="DRC" PriceIncludesRegulatoryFee="false" OID="0" DynamicBundleId="" DynamicBundleName="" DynamicBundleDescription="" Sequence="0" ActualLineItemId="1" IsDynamicBundle="false" DynamicBundleQty="0" IsCouponApplicable="false" ParentSku="" isTaxRateChanged="false" ItemMaxQty="0">
<EffectiveStartDate>1901-01-01T00:00:00</EffectiveStartDate>
<EffectiveEndDate>1901-01-01T00:00:00</EffectiveEndDate>
<Status>Active</Status>
<ExtendedProperties />
<Product UniqueId="" Id="P498222" Name="HP ZBook Firefly G9 mobiele workstation met NVIDIA® T500" DisplayName="HP ZBook Firefly G9 mobiele workstation met NVIDIA® T500" Description="HP ZBook Firefly G9 mobiele workstation met NVIDIA® T500" CategoryId="" CategoryName="" OID="" Characteristics="" Sequence="0" PrimaryImage="https://www.hp.com/nl-nl/shop/Html/Merch/Images/c08249910_209x189.jpg" CatalogId="CG1926" ParentCategoryId="" HierarchyDescription="" Hierarchy="" FulfillmentId="EU_Direct" Expressflag="false" ApplicationType="" ConsumesInventory="true" IsProductTangible="true" IsConfigurable="true" CurrentEDD="TBA" FutureEDD="TBA" CurrentInventory="9" FutureInventory="0" ConfigBaseProductPartNumber="" PreferredProduct="false" Family="" ArfFlag="false" IsNonBuyable="false" IsExternal="false" FreeShipping="false" IsProductNew="false" PartNumber="6B8D6EA#ABH" MfgName="" Unspsc="43211503" ProductLine="IK" HTSCode="8471300000" IsAncillary="false" IsSameQtyReq="false" TaxCode="OV" ProductFamily="" ProductSource="" QuickAccessCode="" Qualifier="" IsActive="true" IsVirtual="false" IsSellable="false" IsStandAlone="false" DeliveryGroup="" FulfillmentSource="" CampaignCode="" EclipseId="" TaxRate="0" TaxType="OM" BigDealId="44301913" Quantity="1" WarrantyDesc="" PscLocale="" PscReferringUrl="" PscCrossSellUrl="" PscPartNumber="" LspSku="" LSPFulfillmentId="" OutOfStock="true" LeadTime="365" ETA="261" EDDMessage="ShipIn48Hours" ActualEDDMessage="UnKnown" FreeShippingOrder="false" DFlag="false" SourceCatalogId="" HasPromotions="false" HasDiscounts="false" DynBunId="">
<EffectiveStartDate>1901-01-01T00:00:00</EffectiveStartDate>
<EffectiveEndDate>1901-01-01T00:00:00</EffectiveEndDate>
<Status>Active</Status>
<ExtendedProperties />
<AttachId>0</AttachId>
<CatalogItemType>Product</CatalogItemType>
<CatalogItems />
<Specifications />
<MetadataList>
<Metadata UniqueId="" Id="" Name="MarketingText" Value="" Sequence="0">
<MetadataType>Specification</MetadataType>
</Metadata>
<Metadata UniqueId="" Id="" Name="XmlContentText" Value="" Sequence="0">
<MetadataType>Specification</MetadataType>
</Metadata>
</MetadataList>
<MetadataGroups />
<Promotions />
<Surcharge UniqueId="" Id="" Amount="0" />
<CopyrightFee UniqueId="" Id="" Amount="0" />
<ProductType>Bto</ProductType>
<Discount
xmlns:d6p1="http://www.w3.org/2001/XMLSchema-instance" d6p1:type="OperatorDiscount" UniqueId="" Id="" Name="" DisplayName="" Description="" Code="" ApplyToLocation="Unknown" DiscountType="FixedAmount" ReasonCode="Deal price approval" Value="64.64" MinimumApplicableAmount="0" MaximumApplicableAmount="0">
<EffectiveStartDate>1901-01-01T00:00:00</EffectiveStartDate>
<EffectiveEndDate>1901-01-01T00:00:00</EffectiveEndDate>
<ApprovalId />
</Discount>
</ProductDiscount>
<PscSegment>unknown</PscSegment>
<BaseCatalogPrice UniqueId="" Id="" Amount="2152" />
<BaseListPrice UniqueId="" Id="" Amount="2152" />
<ListPrice UniqueId="" Id="" Amount="2603.92" />
<CatalogFinalPrice UniqueId="" Id="" Amount="2603.92" />
<PriceType>Unknown</PriceType>
</Product>
<ExternalInfo UniqueId="" Id="" Name="" DisplayName="" Description="" ProductColor="" ProductURL="" AccessoryURL="" ImageURL="" ProductLine="" ProductFamily="">
<EffectiveStartDate>1901-01-01T00:00:00</EffectiveStartDate>
<EffectiveEndDate>1901-01-01T00:00:00</EffectiveEndDate>
<Status>Active</Status>
<ExtendedProperties />
</ExternalInfo>
<LineItemDiscountCollection>
<Discount
xmlns:d5p1="http://www.w3.org/2001/XMLSchema-instance" d5p1:type="OperatorDiscount" UniqueId="" Id="" Name="" DisplayName="" Description="" Code="" ApplyToLocation="Item" DiscountType="FixedAmount" ReasonCode="Deal price approval" Value="-646.4" MinimumApplicableAmount="0" MaximumApplicableAmount="0">
<EffectiveStartDate>1901-01-01T00:00:00</EffectiveStartDate>
<EffectiveEndDate>1901-01-01T00:00:00</EffectiveEndDate>
<Status>Active</Status>
<ExtendedProperties />
<Message />
<DiscountTaxFactor UniqueId="" Id="" Amount="0" />
<TypeOfDiscount>Operator</TypeOfDiscount>
<RequestorSalesRepId />
<ApproverSalesRepId />
<ApprovalId />
</Discount>
</LineItemDiscountCollection>
<TaxItems>
<LineItemTax UniqueId="" Id="0" Message="" Code="OM" Type="Product">
<TotalAmount UniqueId="" Id="" Amount="0" />
<SubTaxes>
<LineItemTaxLevel UniqueId="" Id="0">
<_amount UniqueId="" Id="" Amount="0" />
<_level />
<_code>OM</_code>
<_type>OM</_type>
<_message />
<_rate>21</_rate>
<_certificateNumber />
</LineItemTaxLevel>
</SubTaxes>
</LineItemTax>
</TaxItems>
<IsExclude>false</IsExclude>
<LineItemApportionedDiscount UniqueId="" Id="" Amount="0" />
<RefreshedProduct UniqueId="" Id="P498222" Name="HP ZBook Firefly G9 mobiele workstation met NVIDIA® T500" DisplayName="HP ZBook Firefly G9 mobiele workstation met NVIDIA® T500" Description="HP ZBook Firefly G9 mobiele workstation met NVIDIA® T500" CategoryId="" CategoryName="" OID="" Characteristics="" Sequence="0" PrimaryImage="https://www.hp.com/nl-nl/shop/Html/Merch/Images/c08249910_209x189.jpg" CatalogId="CG1926" ParentCategoryId="" HierarchyDescription="" Hierarchy="" FulfillmentId="EU_Direct" Expressflag="false" ApplicationType="" ConsumesInventory="true" IsProductTangible="true" IsConfigurable="true" CurrentEDD="TBA" FutureEDD="TBA" CurrentInventory="9" FutureInventory="0" ConfigBaseProductPartNumber="" PreferredProduct="false" Family="" ArfFlag="false" IsNonBuyable="false" IsExternal="false" FreeShipping="false" IsProductNew="false" PartNumber="6B8D6EA#ABH" MfgName="" Unspsc="43211503" ProductLine="IK" HTSCode="8471300000" IsAncillary="false" IsSameQtyReq="false" TaxCode="OM" ProductFamily="" ProductSource="" QuickAccessCode="" Qualifier="" IsActive="true" IsVirtual="false" IsSellable="false" IsStandAlone="false" DeliveryGroup="" FulfillmentSource="" CampaignCode="" EclipseId="" TaxRate="21" TaxType="OM" BigDealId="44301913" Quantity="1" WarrantyDesc="" PscLocale="" PscReferringUrl="" PscCrossSellUrl="" PscPartNumber="" LspSku="" LSPFulfillmentId="" OutOfStock="false" LeadTime="365" ETA="261" EDDMessage="ShipIn48Hours" ActualEDDMessage="UnKnown" FreeShippingOrder="false" DFlag="false" SourceCatalogId="" HasPromotions="false" HasDiscounts="false" DynBunId="">
<EffectiveStartDate>1901-01-01T00:00:00</EffectiveStartDate>
<EffectiveEndDate>1901-01-01T00:00:00</EffectiveEndDate>
<Status>Active</Status>
<ExtendedProperties />
<AttachId>0</AttachId>
<CatalogItemType>Product</CatalogItemType>
<CatalogItems />
<Specifications />
<MetadataList>
<Metadata UniqueId="" Id="" Name="MarketingText" Value="" Sequence="0">
<MetadataType>Specification</MetadataType>
</Metadata>
<Metadata UniqueId="" Id="" Name="XmlContentText" Value="" Sequence="0">
<MetadataType>Specification</MetadataType>
</Metadata>
</MetadataList>
<MetadataGroups />
<Promotions />
<Surcharge UniqueId="" Id="" Amount="0" />
<CopyrightFee UniqueId="" Id="" Amount="0" />
<ProductType>Bto</ProductType>
<Height Value="0" UnitOfMeasure="Unknown" />
<Length Value="0" UnitOfMeasure="Unknown" />
<Width Value="0" UnitOfMeasure="Unknown" />
<Weight Value="0" UnitOfMeasure="Unknown" />
<AliasSkus />
<TaxAmount UniqueId="" Id="" Amount="451.92" />
<TaxAmountwithQty UniqueId="" Id="" Amount="0" />
<ProductDiscount />
<PscSegment>unknown</PscSegment>
<BaseCatalogPrice UniqueId="" Id="" Amount="2152" />
<BaseListPrice UniqueId="" Id="" Amount="2152" />
<ListPrice UniqueId="" Id="" Amount="2603.92" />
<CatalogFinalPrice UniqueId="" Id="" Amount="2603.92" />
<PriceType>Unknown</PriceType>
</RefreshedProduct>
<SurchargeTaxFactor UniqueId="" Id="" Amount="0" />
<CopyrightFeeTaxFactor UniqueId="" Id="" Amount="0" />
</Item>
</LineItems>
<ValidationErrors />
<CreditRequestAmount UniqueId="" Id="" Amount="25259" />
<CVResult />
</Payment>
</Payments>
<Shipments>
<Shipment
xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance" d3p1:type="LSShipment" UniqueId="" Id="" AddressId="" IsDefault="false" ShippingInstructions="" ThirdPartyTrackingNo="" ShipmentNo="" ActualAdminData="" ActualProductionDate="" AcutalConsolidationDate="" ActualShipDate="" ActualDeliveryDate="" PlannedShipDate="" PlannedDeliveryDate="" OSSStatus="" StatusRefTime="" CarrierCode="LSCarrierCode" IsAssisted="false" ServiceLevelCode="LSServiceLevelCode" ServiceLevelDescCode="SS">
<LineItems>
<Id>1</Id>
<Id>2</Id>
</LineItems>
<CarrierList />
<EnhancedServiceList />
<EnhancedService />
<LsSkus>
<LineItem UniqueId="" Id="1" Name="" DisplayName="" Description="" OSSStatus="" GroupId="" Quantity="1" ActualQty="0" AttachId="0" DynamicBunImageURL="" IsDisplayable="true" Availability="0" ValidatePrice="true" CurrentQty="0" FutureQty="0" ReservationQty="0" FutureUsed="false" IsValid="true" CampaignCode="" TaxLogic="Default" PriceIncludesRegulatoryFee="false" OID="0" DynamicBundleId="" DynamicBundleName="" DynamicBundleDescription="" Sequence="0" ActualLineItemId="" IsDynamicBundle="false" DynamicBundleQty="0" IsCouponApplicable="false" ParentSku="" isTaxRateChanged="false" ItemMaxQty="0">
<DiscountCollection />
<TaxItems />
<IsExclude>false</IsExclude>
<LineItemApportionedDiscount UniqueId="" Id="" Amount="0" />
<SurchargeTaxFactor UniqueId="" Id="" Amount="0" />
<CopyrightFeeTaxFactor UniqueId="" Id="" Amount="0" />
</LineItem>
</LsSkus>
</Shipment>
</Shipments>
<Discounts />
<TaxItems>
<LineItemTax UniqueId="" Id="0" Message="" Code="OM" Type="Product">
<TotalAmount UniqueId="" Id="" Amount="0" />
<SubTaxes>
</SubTaxes>
</LineItemTax>
<LineItemTax UniqueId="" Id="1" Message="" Code="OM" Type="Product">
<TotalAmount UniqueId="" Id="" Amount="0.2" />
<SubTaxes>
</SubTaxes>
</LineItemTax>
</TaxItems>
<Compensations />
<SendSiebelTime>1901-01-01T00:00:00</SendSiebelTime>
<AssociateOpportunityTime>1901-01-01T00:00:00</AssociateOpportunityTime>
</Addresses>
<PhoneNumbers />
<EmailAddresses>
<Email UniqueId="" Id="SCEUE33685069" Address="administratie#entis.ai" IsDefault="false">
<Locale>Work</Locale>
<Status>Active</Status>
</Email>
</EmailAddresses>
<ExternalKey>p1mfrp6tt34bsmpbpu9cgn4yduj61x5x</ExternalKey>
<UserGuid>05FB4EDB-8CB3-4224-BB49-39628D21C6BF</UserGuid>
<Type>External</Type>
<RegistrationDate>2022-10-28T12:32:56</RegistrationDate>
<PasswordExpirationDate>1901-01-01T00:00:00</PasswordExpirationDate>
<SecurityQuestion1 />
<SecurityAnswer1 />
<SecurityQuestion2 />
<SecurityAnswer2 />
<SiebelContactID />
<LastSiebelUpdatedDate>1901-01-01T00:00:00</LastSiebelUpdatedDate>
</CreatedFor>
<CreatedBy UniqueId="" Id="SCEU33285893" Name="AUTH\vanVegS" DisplayName="" Description="" FirstName="serge" MiddleInitial="" LastName="vegten" LastName2="" Salutation="" Language="nl" Notes="" UserTypeCode="" UserType="0" UserName="AUTH\vanVegS" PasswordHash="" Password="" UserSecuritySalt="" SecurityQuestion="" SecurityAnswer="" PrimaryAccountId="" Country="NL" PhoneticLastName="" PhoneticFirstName="" Gender="Unknown" DateOfBirth="1901-01-01T00:00:00" Occupation="" BusinessFunction="" PromoEmailConsent="" AdminEmailConsent="" FaxConsent="" Department="" CustomerSegment="Business" CompanyName="" CustomerSubSegment="Public" IsFarmingAccount="false">
<EffectiveStartDate>1901-01-01T00:00:00</EffectiveStartDate>
<EffectiveEndDate>1901-01-01T00:00:00</EffectiveEndDate>
<Status>Active</Status>
<Created UniqueId="" Id="" ActionPerformed="created" PerformedBy="AUTH\canovasl" PerformedDate="2020-11-16T16:40:41" ItemSource="CallCenter" />
<LastModified UniqueId="" Id="" ActionPerformed="modified" PerformedBy="AUTH\vanVegS" PerformedDate="2022-11-22T13:47:04.0639606+00:00" ItemSource="CallCenter" />
<ExtendedProperties />
<Addresses>
<Address UniqueId="" Id="SCEUA35660872" Name="" DisplayName="" Description="" AddressName="" CustomerTitle="" SalutationKey="" FirstName="" Area="" TaxId="" AlternateShippingContact="" MiddleInitial="" LastName="" CompanyName="" Line1="" Line2="" Line3="" City="" Region="" PostalCode="" Country="NL" IsDefault="false" LastName2="" AddressAssociationType="User" Locale="Unknown" CRSID="" DepartmentName="" PhoneticCompanyName="" PhoneticFirstName="" PhoneticLastName="" Email="" CYSISID="" StateName="" CRSStatusCode="RequestNotCalled" CRSErrorCode="" AVRStatusCode="SE00000800" AVRErrorCode="" IsVerified="false">
<EffectiveStartDate>1901-01-01T00:00:00</EffectiveStartDate>
<EffectiveEndDate>1901-01-01T00:00:00</EffectiveEndDate>
<Status>Active</Status>
<ExtendedProperties />
<AddressType>Billing</AddressType>
<CompanyPresident />
</Address>
</Addresses>
<PhoneNumbers />
<EmailAddresses>
<Email UniqueId="" Id="SCEUE33286377" Address="serge.van.vegten#hp.com" IsDefault="false">
<Locale>Work</Locale>
<Status>Active</Status>
</Email>
</EmailAddresses>
<ExternalKey>U</ExternalKey>
<UserGuid>0DFFDA3D-B811-4381-8E81-DAFF3349CEC9</UserGuid>
<Type>Internal</Type>
<RegistrationDate>2020-11-16T16:40:41</RegistrationDate>
<PasswordExpirationDate>1901-01-01T00:00:00</PasswordExpirationDate>
<SecurityQuestion1 />
<SecurityAnswer1 />
<SecurityQuestion2 />
<SecurityAnswer2 />
<SiebelContactID />
<LastSiebelUpdatedDate>1901-01-01T00:00:00</LastSiebelUpdatedDate>
</CreatedBy>
<UpdatedBy UniqueId="" Id="" Name="" DisplayName="" Description="" FirstName="" MiddleInitial="" LastName="" LastName2="" Salutation="" Language="" Notes="" UserTypeCode="" UserType="0" UserName="" PasswordHash="" Password="" UserSecuritySalt="" SecurityQuestion="" SecurityAnswer="" PrimaryAccountId="" Country="" PhoneticLastName="" PhoneticFirstName="" Gender="Unknown" DateOfBirth="1901-01-01T00:00:00" Occupation="" BusinessFunction="" Department="" CustomerSegment="Consumer" CompanyName="" CustomerSubSegment="Public" IsFarmingAccount="false">
<EffectiveStartDate>1901-01-01T00:00:00</EffectiveStartDate>
<EffectiveEndDate>1901-01-01T00:00:00</EffectiveEndDate>
<Status>Active</Status>
<ExtendedProperties />
<Addresses />
<PhoneNumbers />
<EmailAddresses />
<ExternalKey />
<UserGuid />
<Type>Unknown</Type>
<RegistrationDate>1901-01-01T00:00:00</RegistrationDate>
<PasswordExpirationDate>1901-01-01T00:00:00</PasswordExpirationDate>
<LastSiebelUpdatedDate>1901-01-01T00:00:00</LastSiebelUpdatedDate>
</UpdatedBy>
<PreferredShipDate>1901-01-01T00:00:00</PreferredShipDate>
<QuoteIds>
<Id />
</QuoteIds>
SELECT X.Y.value('ProductType[1]','VARCHAR(20)') AS ProductType, X.Y.value('ISDRCEligible[1]','VARCHAR(20)') AS ISDRCEligible,
X.Y.value('ISDRCApplied[1]','VARCHAR(20)') AS ISDRCApplied,
X.Y.value('type[1]','NVARCHAR(20)') AS type,
X.Y.value('IsAncillary[1]','VARCHAR(20)') AS IsAncillary,X.Y.value('IsSameQtyReq[1]','VARCHAR(20)') AS IsSameQtyReq,X.Y.value('TaxCode[1]','VARCHAR(20)') AS TaxCode,
X.Y.value('Country[1]','VARCHAR(20)') AS Country
FROM (
SELECT top 100000 CAST(SerializedOrder AS XML) as SerializedOrder
FROM TransactionOrder WITH(NOLOCK))a
CROSS APPLY a.SerializedOrder.nodes('Order/LineItems/Item') AS X(Y)
WHERE X.Y.value('ProductType[1]','VARCHAR(20)')='Bto' AND X.Y.value('ISDRCEligible[1]','VARCHAR(20)')='true' AND
X.Y.value('ISDRCApplied[1]','VARCHAR(20)')='true' AND --X.Y.value('type[1]','NVARCHAR(20)')='CarePack' AND
X.Y.value('IsAncillary[1]','VARCHAR(20)')='true' AND X.Y.value('IsSameQtyReq[1]','VARCHAR(20)')='true' AND
X.Y.value('TaxCode[1]','VARCHAR(20)')='OM' AND X.Y.value('Country[1]','VARCHAR(20)')='NL'
I am new to JPOS. I want to add a set of sub fields into a single field with a bitmap. I tried with following URL but I didn't get any good result.
PISO 8583 subfield using JPOS
What I want to do :
I have to send a "0100" request. In this case I want to put CVV value into "126.10" field. Field "126" has many sub fields and field "126" has a bit map.
Is it possible to do this kind of case using JPOS? If it is possible how can we do that. If you have any sample please help me to complete this task.
Thank you.
With jPos it is possible to configure an isofieldpackager in the packager XML file as shown in the example below. The "emitBitmap" property determines if field 56 will have a bitmap.
Sample packager MXL file with SubFieldPackager in field 56:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE isopackager PUBLIC
"-//jPOS/jPOS Generic Packager DTD 1.0//EN"
"http://jpos.org/dtd/generic-packager-1.0.dtd">
<isopackager>
<isofield id="0" length="4" name="MESSAGE TYPE INDICATOR" pad="true" class="org.jpos.iso.IFB_NUMERIC" />
<isofield id="1" length="8" name="BIT MAP" class="org.jpos.iso.IFB_BITMAP" />
<isofield id="2" length="99" name="?" class="org.jpos.iso.IFB_LLNUM" />
<isofield id="3" length="6" name="PROCESSING CODE" class="org.jpos.iso.IFB_NUMERIC" />
<isofield id="11" length="6" name="?" class="org.jpos.iso.IFB_NUMERIC" />
<isofield id="12" length="6" name="?" class="org.jpos.iso.IFB_NUMERIC" />
<isofield id="13" length="4" name="?" class="org.jpos.iso.IFB_NUMERIC" />
<isofield id="14" length="4" name="?" class="org.jpos.iso.IFB_NUMERIC" />
<isofield id="24" length="3" name="?" class="org.jpos.iso.IFB_NUMERIC" />
<isofield id="39" length="2" name="?" class="org.jpos.iso.IF_CHAR" />
<isofield id="41" length="8" name="?" class="org.jpos.iso.IF_CHAR" />
<isofield id="42" length="999" name="?" class="org.jpos.iso.IFB_LLLBINARY" />
<isofieldpackager id="56" length="999" name="ADDITIONAL TRANSACTION DATA" class="org.jpos.iso.IFB_LLLBINARY"
packager="org.jpos.iso.packager.GenericSubFieldPackager" emitBitmap="true">
<isofield id="1" length="2" name="PHONE PREFIX" pad="true" class="org.jpos.iso.IFB_NUMERIC" />
<isofield id="2" length="9" name="PHONE" pad="true" class="org.jpos.iso.IFB_NUMERIC" />
<isofield id="3" length="99" name="?" class="org.jpos.iso.IFB_LLBINARY" />
</isofieldpackager>
<isofield id="61" length="999" name="SERVER INFORMATIONS" class="org.jpos.iso.IFB_LLLCHAR" />
</isopackager>
The projects of this file can be found in the repositories of the links below. They are simple projects that send and respond ISO 8583 messages.
Repositories of ISO 8583 projects:
https://github.com/alexlirio/iso-sender
https://github.com/alexlirio/iso-responder
In my case I need to include the bitmap field like this.
<isofield
id="0"
length="8"
name="BIT MAP"
class="org.jpos.iso.IFA_BITMAP" />
Also set this two attributes on the isofieldpackager tag.
emitBitmap="true"
bitmapField="0"
<isofieldpackager
id="56"
length="999"
name="ADDITIONAL TRANSACTION DATA"
class="org.jpos.iso.IFA_LLLNUM"
packager="org.jpos.iso.packager.GenericSubFieldPackager"
emitBitmap="true"
bitmapField="0">
<isofield
id="0"
length="8"
name="BIT MAP"
class="org.jpos.iso.IFA_BITMAP" />
<isofield
id="1"
length="2"
name="???"
pad="true"
class="org.jpos.iso.IFA_NUMERIC" />
<isofield
id="2"
length="9"
name="???"
pad="true"
class="org.jpos.iso.IFA_NUMERIC" />
<isofield
id="3"
length="99"
name="???"
class="org.jpos.iso.IFA_NUMERIC" />
</isofieldpackager>
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>
I have a mule flow with DataMapper configuration to map XML to JSON, in that I have a requirement to Lookup a CSV file which contains, for example, two columns and four rows to map to one of the JSON output field.
Below are my sample CSV file contents:
Name,Contact
Ram,111-222
Kumar,222-333
John,333-444
I got below exception while running DataMapper:
Element [CSV:CSV]-Pre-Execution of lookup table [CSV:CSV]failed
Error when parsing record #2 field Name
Caused by: java.lang.RuntimeException: Parsing error: Unexpected record delimiter, probably record has too few fields.
When the CSV file contains only one row there is no exception.
Could any one provide me a way to solve the issue? Thanks in advance.
EDIT: Please find the DataMapper configuration
<mule>
<data-mapper:config name="XML_To_JSON_1" transformationGraphPath="xml_to_json_1.grf" doc:name="XML_To_JSON" />
<flow name="mule-csv-lookupFlow1" doc:name="mule-csv-lookupFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="9090" doc:name="HTTP" />
<data-mapper:transform config-ref="XML_To_JSON_1" doc:name="XML To JSON" />
</flow>
</mule>
Below is the .grf file
<?xml version="1.0" encoding="UTF-8"?><Graph __version="3.5.0" author="pradeep" created="Wed Dec 03 13:06:48 IST 2014" description="XML To JSON" guiVersion="3.4.4.P" id="1417593604462" licenseCode="Unlicensed" licenseType="Unknown" modified="Wed Dec 03 13:06:48 IST 2014" modifiedBy="pradeep" name="XML_To_JSON" preview-file="${Project_Home}/src/main/resources/employee.xml" revision="1.0" showComponentDetails="false">
<Global>
<Metadata __index="0" __referenceCounter="1" __sourcePath="{}/object/contact" _dataStructure="SINGLE_DIMENSIONAL_COLLECTION" _id="__id" _metadataParentId="4430d2fe-5b06-4e39-b259-492c325fe164" _parent_id="__parent_id" _type="Output" id="f11ab87d-ec49-4034-a277-1e96a57b7925">
<Record fieldDelimiter="," name="contact" recordDelimiter="\n\\|\r\n\\|\r" type="delimited">
<Field __artificialType="_parent_id" __systemManaged="true" name="__parent_id" type="string"/>
<Field __artificialType="_id" __systemManaged="true" name="__id" type="string"/>
<Field __index="0" __sourcePath="{}/object/contact/name" containerType="SINGLE" label="name" name="name" type="string"/>
<Field __index="1" __sourcePath="{}/object/contact/phone" containerType="SINGLE" label="phone" name="phone" type="string"/>
</Record>
</Metadata>
<Metadata _type="Lookup" id="963db4af-a7a1-428c-be6b-39af261e93d4">
<Record fieldDelimiter="," name="CSV" recordDelimiter="\n\\|\r\n\\|\r" type="delimited">
<Field containerType="SINGLE" label="firstname" name="firstname" size="10" type="string"/>
<Field containerType="SINGLE" eofAsDelimiter="true" label="phone" name="phone" size="10" type="string"/>
</Record>
</Metadata>
<Metadata __index="0" __referenceCounter="1" __schemaType="employeeType" __sourcePath="{}/employees/employee" _dataStructure="SINGLE_DIMENSIONAL_COLLECTION" _id="__id" _metadataParentId="80f1c157-e81d-439d-afa8-e475de2dfe36" _parent_id="__parent_id" _type="Input" id="019cda9c-1078-4d00-bdcc-f81a59df5292">
<Record fieldDelimiter="," name="employee" recordDelimiter="\n\\|\r\n\\|\r" type="delimited">
<Field __artificialType="_parent_id" __systemManaged="true" name="__parent_id" type="string"/>
<Field __artificialType="_id" __systemManaged="true" name="__id" type="string"/>
<Field __index="0" __schemaType="employeeType" __sourcePath="{}/employees/employee/#firstname" containerType="SINGLE" label="firstname" name="firstname" type="string"/>
<Field __index="1" __schemaType="employeeType" __sourcePath="{}/employees/employee/#lastname" containerType="SINGLE" label="lastname" name="lastname" type="string"/>
<Field __index="2" __schemaType="employeeType" __sourcePath="{}/employees/employee/#gender" containerType="SINGLE" label="gender" name="gender" type="string"/>
<Field __index="3" __schemaType="employeeType" __sourcePath="{}/employees/employee/#phone" containerType="SINGLE" label="phone" name="phone" type="string"/>
<Field __index="4" __schemaType="employeeType" __sourcePath="{}/employees/employee/#text()" containerType="SINGLE" label="text()" name="text" type="string"/>
</Record>
</Metadata>
<Metadata __filteredMetadata="false" __index="0" __referenceCounter="1" __schemaType="employeesType" __sourcePath="{}/employees" _dataStructure="OBJECT" _id="__id" _type="Input" id="80f1c157-e81d-439d-afa8-e475de2dfe36">
<Record fieldDelimiter="," name="employees" recordDelimiter="\n\\|\r\n\\|\r" type="delimited">
<Field __artificialType="_id" __systemManaged="true" name="__id" type="string"/>
</Record>
</Metadata>
<Metadata __index="0" __referenceCounter="1" __sourcePath="{}/object" _dataStructure="OBJECT" _id="__id" _type="Output" id="4430d2fe-5b06-4e39-b259-492c325fe164">
<Record fieldDelimiter="," name="object" recordDelimiter="\n\\|\r\n\\|\r" type="delimited">
<Field __artificialType="_id" __systemManaged="true" name="__id" type="string"/>
</Record>
</Metadata>
<LookupTable fileURL="D:/1_Ram/DEV/Workspace/mule-workspace/mule-datamapper-lookup/src/main/resources/staff.txt" id="CSV" key="phone" metadata="963db4af-a7a1-428c-be6b-39af261e93d4" name="CSV" type="simpleLookup">
<attr name="lookupType"><![CDATA[CSV]]></attr>
</LookupTable>
<Dictionary>
<Entry id="DictionaryEntry0" input="true" name="inputPayload" output="false" type="object"/>
<Entry id="DictionaryEntry1" input="false" name="outputPayload" output="true" type="object"/>
</Dictionary>
</Global>
<Phase number="0">
<Node enabled="enabled" guiName="Foreach 'employees' -> 'object'" guiX="460" guiY="20" id="FOREACH_EMPLOYEES_OBJECT" transformClass="com.mulesoft.datamapper.transform.MelRecordTransform" type="REFORMAT">
<attr name="melScript"><![CDATA[//MEL
//START -> DO NOT REMOVE
output.__id = input.__id;
//END -> DO NOT REMOVE
]]></attr>
</Node>
<Node enabled="enabled" guiName="Foreach 'employee' -> 'contact'" guiX="460" guiY="120" id="FOREACH_EMPLOYEE_CONTACT" transformClass="com.mulesoft.datamapper.transform.MelRecordTransform" type="REFORMAT">
<attr name="melScript"><![CDATA[//MEL
//START -> DO NOT REMOVE
output.__id = input.__id;
output.__parent_id = input.__parent_id;
//END -> DO NOT REMOVE
output.phone = input.phone + (isnull(lookup("CSV").get([input.firstname])) ? null : lookup("CSV").get([input.firstname]).phone);
output.name = input.lastname + ' ' + input.firstname;]]></attr>
</Node>
<Node cacheInMemory="true" charset="UTF-8" enabled="enabled" fileURL="dict:outputPayload" guiName="JSON WRITER" guiX="900" guiY="20" id="JSON_WRITER0" type="JSON_WRITER">
<attr name="mapping"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<object xmlns:clover="http://www.cloveretl.com/ns/xmlmapping" clover:inPort="0">
<clover:collection clover:name="contact">
<item clover:inPort="1" clover:key="__parent_id" clover:parentKey="__id">
<name>$1.name</name>
<phone>$1.phone</phone>
</item>
</clover:collection>
</object>]]></attr>
<attr name="__isJsonSchema"><![CDATA[false]]></attr>
<attr name="_data_format"><![CDATA[JSON]]></attr>
<attr name="jsonSchemaURL"><![CDATA[./src/main/resources/contacts.json]]></attr>
</Node>
<Node charset="UTF-8" dataPolicy="strict" enabled="enabled" fileURL="dict:inputPayload" guiName="XML READER" guiX="20" guiY="20" id="XML_READER0" type="XML_READER">
<attr name="xmlSchemaURL"><![CDATA[./src/main/resources/employees.xsd]]></attr>
<attr name="mapping"><![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Context outPort="0" sequenceField="__id" xpath="/employees">
<Context generatedKey="__parent_id" outPort="1" parentKey="__id" sequenceField="__id" xpath="employee">
<Mapping cloverField="firstname" trim="true" xpath="#firstname"/>
<Mapping cloverField="lastname" trim="true" xpath="#lastname"/>
<Mapping cloverField="gender" trim="true" xpath="#gender"/>
<Mapping cloverField="phone" trim="true" xpath="#phone"/>
<Mapping cloverField="text" trim="true" xpath="text()"/>
</Context>
</Context>
]]></attr>
<attr name="_data_format"><![CDATA[XML]]></attr>
<attr name="__rootGlobalElementName"><![CDATA[employees]]></attr>
</Node>
<Edge debugMode="true" fromNode="FOREACH_EMPLOYEES_OBJECT:0" guiBendpoints="" id="Edge1" inPort="Port 0 (in)" metadata="4430d2fe-5b06-4e39-b259-492c325fe164" outPort="Port 0 (out)" toNode="JSON_WRITER0:0"/>
<Edge debugMode="true" fromNode="FOREACH_EMPLOYEE_CONTACT:0" guiBendpoints="" id="Edge3" inPort="Port 1 (in)" metadata="f11ab87d-ec49-4034-a277-1e96a57b7925" outPort="Port 0 (out)" toNode="JSON_WRITER0:1"/>
<Edge debugMode="true" fromNode="XML_READER0:0" guiBendpoints="" id="Edge0" inPort="Port 0 (in)" metadata="80f1c157-e81d-439d-afa8-e475de2dfe36" outPort="Port 0 (out)" toNode="FOREACH_EMPLOYEES_OBJECT:0"/>
<Edge debugMode="true" fromNode="XML_READER0:1" guiBendpoints="" id="Edge2" inPort="Port 0 (in)" metadata="019cda9c-1078-4d00-bdcc-f81a59df5292" outPort="Port 1 (out)" toNode="FOREACH_EMPLOYEE_CONTACT:0"/>
</Phase>
</Graph>
I noticed the following issues in your .grf file:
1. CSV Record fields are firstname and phone while in your actual csv file they are Name and Contact (I assume the CSV sample in your original post matches what in staff.txt file).
2. LookupTable key is phone while you lookup based on name in your phone mapping lookup("CSV").get([input.firstname]).phone
I've created content type with following xml but it ain't using my custom forms specified in the xml below. What's wrong ?
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Field ID="{854DCDF4-5091-4B1E-AA31-D9DC71A29637}"
Type="Text"
Required="TRUE"
DisplayName="Customer ID"
Name="Customer-ID"
Indexed="TRUE"
EnforceUniqueValues="FALSE" />
<Field ID="{7E898932-91C0-4285-A8A2-B6440BE2FDC9}"
Type="Text"
Required="FALSE"
DisplayName="Customer Name"
Name="Customer-Name" />
<Field ID="{5168AB24-21A8-438A-8112-E82E24E180CE}"
Type="Text"
Required="FALSE"
DisplayName="Country"
Name="Country" />
<!-- Parent ContentType: Item (0x01) -->
<ContentType ID="0x010081e20b9903d945a8beacde43ae09f766"
Name="Customer"
Group="Custom Content Types"
Description="Customer Content Type"
Inherits="TRUE"
Version="0">
<FieldRefs>
<FieldRef ID="{854DCDF4-5091-4B1E-AA31-D9DC71A29637}" />
<FieldRef ID="{7E898932-91C0-4285-A8A2-B6440BE2FDC9}" />
<FieldRef ID="{5168AB24-21A8-438A-8112-E82E24E180CE}" />
</FieldRefs>
<XmlDocuments>
<XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
<FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
<New>_layouts/customer/customer.aspx</New>
<Display>_layouts/customer/customerdisp.aspx</Display>
<Edit>_layouts/customer/customeredit.aspx</Edit>
</FormUrls>
</XmlDocument>
</XmlDocuments>
</ContentType>
</Elements>
Try Inherts="FALSE" as an attribute on the element