2012-04-26 6 views
0

내 xslt 변환에 문제가 있습니다. 소스 xml에 다중 레벨 노드가있는 곳.xslt 다중 레벨 그룹화 - 하나의 XML 형식에서 다른 형식으로 변환

내가 여기에 다른

한 폼에서 XML을 변환하고자하는 것은 내 XSLT

<?xml version="1.0" encoding="UTF-8"?> 
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> 
    <xsl:template match="text() | @*"> 
    <xsl:apply-templates select="text() | @*"/> 
    </xsl:template> 
    <xsl:template match="SalesOrder"> 
    <SalesOrder z:Id="i1" xmlns="http://schemas.datacontract.org/2004/07/Eurofins.Genomics.Egsp.Xbo.OrderManagement" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/"> 
     <BillTo> 
     <xsl:value-of select="BillTo"/> 
     </BillTo> 
     <OrderReferenceCustomer> 
     <xsl:value-of select="OrderID"/> 
     </OrderReferenceCustomer> 
     <OrderStatus> 
     <xsl:value-of select="OrderStatus"/> 
     </OrderStatus> 
     <Contact> 
     <xsl:value-of select="BillTo"/> 
     </Contact> 
     <ShipTo> 
     <xsl:value-of select="ShipTo"/> 
     </ShipTo> 
     <SoldTo> 
     <xsl:value-of select="SoldTo"/> 
     </SoldTo> 
     <SoldBy> 
     <xsl:value-of select="SoldBy"/> 
     </SoldBy> 
     <Site> 
     <xsl:value-of select="OrderSite"/> 
     </Site> 
     <ConfirmedDate> 
     <xsl:value-of select="ConfirmedDate"/> 
     </ConfirmedDate> 
     <xsl:apply-templates/> 
    </SalesOrder> 
    </xsl:template> 
    <xsl:template match="FulfilmentInfo"> 
    <FulfillmentInfo> 
     <TestOrder> 
     <xsl:value-of select="TestOrder"/> 
     </TestOrder> 
     <PromotionCode> 
     <xsl:value-of select="PromotionCode"/> 
     </PromotionCode> 
     <FirstConfirmedDate> 
     <xsl:value-of select="FirstConfirmedDate"/> 
     </FirstConfirmedDate> 
     <DocumentationLanguage> 
     <xsl:value-of select="DocumentationLanguage"/> 
     </DocumentationLanguage> 
    </FulfillmentInfo> 
    </xsl:template> 
    <xsl:template match="PaymentOptions"> 
    <PaymentInformations> 
     <xsl:apply-templates /> 
    </PaymentInformations> 
    </xsl:template> 
    <xsl:template match="PaymentOptions"> 
    <PaymentInformation> 
     <PaymentMethod> 
     <xsl:value-of select="PaymentMethod"/> 
     </PaymentMethod> 
    </PaymentInformation> 
    </xsl:template> 
</xsl:stylesheet> 

내 목적지 변환 된 XML이

<SalesOrder> 
     <BillTo>anyType</BillTo> 
     <OrderReferenceCustomer>anyType</OrderReferenceCustomer> 
     <OrderStatus>InCart</OrderStatus> 
     <Contact>anyType</Contact> 
     <ShipTo>anyType</ShipTo> 
     <SoldTo>anyType</SoldTo> 
     <SoldBy>anyType</SoldBy> 
     <Site>TKY</Site> 
     <ConfirmedDate>1900-01-01T01:01:01+05:30</ConfirmedDate> 
     <FulfillmentInfo xmlns=""> 
     <TestOrder>true</TestOrder> 
     <PromotionCode>anyType</PromotionCode> 
     <FirstConfirmedDate>1900-01-01T01:01:01+05:30</FirstConfirmedDate> 
     <DocumentationLanguage>anyType</DocumentationLanguage> 
     </FulfillmentInfo> 
     <PaymentInformation xmlns=""> 
     <PaymentMethod>CC</PaymentMethod> 
     </PaymentInformation> 
     <PaymentInformation xmlns=""> 
     <PaymentMethod>PO</PaymentMethod> 
     </PaymentInformation> 
     <PaymentInformation xmlns=""> 
     <PaymentMethod>EVO</PaymentMethod> 
     </PaymentInformation> 
    </SalesOrder> 

이 예상 된 결과처럼, 내가 원하는입니다 내 변형에서

<SalesOrder> 
    <BillTo>anyType</BillTo> 
    <OrderReferenceCustomer>anyType</OrderReferenceCustomer> 
    <OrderStatus>InCart</OrderStatus> 
    <Contact>anyType</Contact> 
    <ShipTo>anyType</ShipTo> 
    <SoldTo>anyType</SoldTo> 
    <SoldBy>anyType</SoldBy> 
    <Site>TKY</Site> 
    <ConfirmedDate>1900-01-01T01:01:01+05:30</ConfirmedDate> 
    <FulfillmentInfo xmlns=""> 
    <TestOrder>true</TestOrder> 
    <PromotionCode>anyType</PromotionCode> 
    <FirstConfirmedDate>1900-01-01T01:01:01+05:30</FirstConfirmedDate> 
    <DocumentationLanguage>anyType</DocumentationLanguage> 
    </FulfillmentInfo> 
<PaymentInformations> 
    <PaymentInformation xmlns=""> 
    <PaymentMethod>CC</PaymentMethod> 
    </PaymentInformation> 
    <PaymentInformation xmlns=""> 
    <PaymentMethod>PO</PaymentMethod> 
    </PaymentInformation> 
    <PaymentInformation xmlns=""> 
    <PaymentMethod>EVO</PaymentMethod> 
    </PaymentInformation> 
</PaymentInformations> 
</SalesOrder> 

XML을 한 형식에서 다른 형식으로 변환하는 데 올바른 접근 방식인지 여부도 알고 싶습니다.

<?xml version="1.0" encoding="utf-8"?> 
<GenomicOrder> 
    <SalesOrder> 
    <OrderID>anyType</OrderID> 
    <ProductionOrderCount>1</ProductionOrderCount> 
    <OrderStatus>InCart</OrderStatus> 
    <Contact>anyType</Contact> 
    <ShipTo>anyType</ShipTo> 
    <SoldTo>anyType</SoldTo> 
    <BillTo>anyType</BillTo> 
    <SoldBy>anyType</SoldBy> 
    <OrderSite>TKY</OrderSite> 
    <ConfirmedDate>1900-01-01T01:01:01+05:30</ConfirmedDate> 
    <OrderRef> 
     <Type>ERP</Type> 
     <OrderRef>OrderRef1</OrderRef> 
    </OrderRef> 
    <OrderRef> 
     <Type>CUSTOMER</Type> 
     <OrderRef>OrderRef2</OrderRef> 
    </OrderRef> 
    <OrderRef> 
     <Type>EXT</Type> 
     <OrderRef>OrderRef3</OrderRef> 
    </OrderRef> 
    <FulfilmentInfo> 
     <TestOrder>true</TestOrder> 
     <PromotionCode>anyType</PromotionCode> 
     <Comment> 
     <CommentType>anyType</CommentType> 
     <CommentText>anyType</CommentText> 
     <CommentDate>1900-01-01T01:01:01+05:30</CommentDate> 
     <InternalComment>true</InternalComment> 
     </Comment> 
     <Comment> 
     <CommentType>anyType</CommentType> 
     <CommentText>anyType</CommentText> 
     <CommentDate>0001-01-01T00:00:00+05:30</CommentDate> 
     <InternalComment>false</InternalComment> 
     </Comment> 
     <Comment> 
     <CommentType>anyType</CommentType> 
     <CommentText>anyType</CommentText> 
     <CommentDate>9999-12-31T23:59:59.9999999+05:30</CommentDate> 
     <InternalComment>true</InternalComment> 
     </Comment> 
     <Shipment> 
     <shippingMethod>anyType</shippingMethod> 
     <shippingCarrier>anyType</shippingCarrier> 
     <shippingAccount>anyType</shippingAccount> 
     <condolidatedShipment>anyType</condolidatedShipment> 
     <ShippingCost> 
      <NetPrice>1</NetPrice> 
      <Tax>anyType</Tax> 
      <Currency>anyType</Currency> 
      <CalculationDate>anyType</CalculationDate> 
     </ShippingCost> 
     </Shipment> 
     <FirstConfirmedDate>1900-01-01T01:01:01+05:30</FirstConfirmedDate> 
     <DocumentationLanguage>anyType</DocumentationLanguage> 
     <GiftCertificate>anyType</GiftCertificate> 
     <GiftCertificate>anyType</GiftCertificate> 
     <GiftCertificate>anyType</GiftCertificate> 
    </FulfilmentInfo> 
    <PaymentOptions> 
     <PaymentMethod>CC</PaymentMethod> 
     <TransactionId>anyType</TransactionId> 
     <CardID>anyType</CardID> 
     <PoNumber>PoNumber1</PoNumber> 
     <Amount>1</Amount> 
    </PaymentOptions> 
    <PaymentOptions> 
     <PaymentMethod>PO</PaymentMethod> 
     <TransactionId>anyType</TransactionId> 
     <CardID>anyType</CardID> 
     <PoNumber>PoNumber2</PoNumber> 
     <Amount>-3.40282347E+38</Amount> 
    </PaymentOptions> 
    <PaymentOptions> 
     <PaymentMethod>EVO</PaymentMethod> 
     <TransactionId>anyType</TransactionId> 
     <CardID>anyType</CardID> 
     <PoNumber>PoNumber3</PoNumber> 
     <Amount>3.40282347E+38</Amount> 
    </PaymentOptions> 
    </SalesOrder> 
    <ProductionOrder> 
    <extpectedDeliveryDate>anyType</extpectedDeliveryDate> 
    <ProductionSite>TKY</ProductionSite> 
    <ProductionSystem>anyType</ProductionSystem> 
    <BusinessUnit>GSY</BusinessUnit> 
    <Comment> 
     <CommentType>anyType</CommentType> 
     <CommentText>anyType</CommentText> 
     <CommentDate>1900-01-01T01:01:01+05:30</CommentDate> 
     <InternalComment>true</InternalComment> 
    </Comment> 
    <Comment> 
     <CommentType>anyType</CommentType> 
     <CommentText>anyType</CommentText> 
     <CommentDate>0001-01-01T00:00:00+05:30</CommentDate> 
     <InternalComment>false</InternalComment> 
    </Comment> 
    <Comment> 
     <CommentType>anyType</CommentType> 
     <CommentText>anyType</CommentText> 
     <CommentDate>9999-12-31T23:59:59.9999999+05:30</CommentDate> 
     <InternalComment>true</InternalComment> 
    </Comment> 
    <Price> 
     <NetPrice>1</NetPrice> 
     <Tax>anyType</Tax> 
     <Currency>anyType</Currency> 
     <CalculationDate>anyType</CalculationDate> 
    </Price> 
    <Shipment> 
     <shippingMethod>anyType</shippingMethod> 
     <shippingCarrier>anyType</shippingCarrier> 
     <shippingAccount>anyType</shippingAccount> 
     <condolidatedShipment>anyType</condolidatedShipment> 
     <ShippingCost> 
     <NetPrice>-3.40282347E+38</NetPrice> 
     <Tax>anyType</Tax> 
     <Currency>anyType</Currency> 
     <CalculationDate>anyType</CalculationDate> 
     </ShippingCost> 
    </Shipment> 
    <OrderItems> 
     <ItemName>anyType</ItemName> 
     <Quantity>anyType</Quantity> 
     <UnitPrice> 
     <NetPrice>1</NetPrice> 
     <Tax>anyType</Tax> 
     <Currency>anyType</Currency> 
     <CalculationDate>anyType</CalculationDate> 
     </UnitPrice> 
     <KitNumber>anyType</KitNumber> 
     <KitComponents> 
     <KitComponentNumber>anyType</KitComponentNumber> 
     <Quantity>anyType</Quantity> 
     <Price> 
      <NetPrice>1</NetPrice> 
      <Tax>anyType</Tax> 
      <Currency>anyType</Currency> 
      <CalculationDate>anyType</CalculationDate> 
     </Price> 
     </KitComponents> 
     <ProductionInformation> 
     <GeneItem>anyType</GeneItem> 
     </ProductionInformation> 
    </OrderItems> 
    <OrderItems> 
     <ItemName>anyType</ItemName> 
     <Quantity>anyType</Quantity> 
     <UnitPrice> 
     <NetPrice>-3.40282347E+38</NetPrice> 
     <Tax>anyType</Tax> 
     <Currency>anyType</Currency> 
     <CalculationDate>anyType</CalculationDate> 
     </UnitPrice> 
     <KitNumber>anyType</KitNumber> 
     <KitComponents> 
     <KitComponentNumber>anyType</KitComponentNumber> 
     <Quantity>anyType</Quantity> 
     <Price> 
      <NetPrice>-3.40282347E+38</NetPrice> 
      <Tax>anyType</Tax> 
      <Currency>anyType</Currency> 
      <CalculationDate>anyType</CalculationDate> 
     </Price> 
     </KitComponents> 
     <ProductionInformation> 
     <GeneItem>anyType</GeneItem> 
     </ProductionInformation> 
    </OrderItems> 
    <OrderItems> 
     <ItemName>anyType</ItemName> 
     <Quantity>anyType</Quantity> 
     <UnitPrice> 
     <NetPrice>3.40282347E+38</NetPrice> 
     <Tax>anyType</Tax> 
     <Currency>anyType</Currency> 
     <CalculationDate>anyType</CalculationDate> 
     </UnitPrice> 
     <KitNumber>anyType</KitNumber> 
     <KitComponents> 
     <KitComponentNumber>anyType</KitComponentNumber> 
     <Quantity>anyType</Quantity> 
     <Price> 
      <NetPrice>3.40282347E+38</NetPrice> 
      <Tax>anyType</Tax> 
      <Currency>anyType</Currency> 
      <CalculationDate>anyType</CalculationDate> 
     </Price> 
     </KitComponents> 
     <ProductionInformation> 
     <GeneItem>anyType</GeneItem> 
     </ProductionInformation> 
    </OrderItems> 
    <ProductionOrderStatus>CART</ProductionOrderStatus> 
    </ProductionOrder> 
    <ProductionOrder> 
    <extpectedDeliveryDate>anyType</extpectedDeliveryDate> 
    <ProductionSite>EBE</ProductionSite> 
    <ProductionSystem>anyType</ProductionSystem> 
    <BusinessUnit>OLIGO</BusinessUnit> 
    <Comment> 
     <CommentType>anyType</CommentType> 
     <CommentText>anyType</CommentText> 
     <CommentDate>1899-11-30T01:01:01+05:30</CommentDate> 
     <InternalComment>false</InternalComment> 
    </Comment> 
    <Comment> 
     <CommentType>anyType</CommentType> 
     <CommentText>anyType</CommentText> 
     <CommentDate>1900-02-02T01:01:01+05:30</CommentDate> 
     <InternalComment>true</InternalComment> 
    </Comment> 
    <Comment> 
     <CommentType>anyType</CommentType> 
     <CommentText>anyType</CommentText> 
     <CommentDate>0001-02-02T00:00:00+05:30</CommentDate> 
     <InternalComment>false</InternalComment> 
    </Comment> 
    <Price> 
     <NetPrice>-3.40282347E+38</NetPrice> 
     <Tax>anyType</Tax> 
     <Currency>anyType</Currency> 
     <CalculationDate>anyType</CalculationDate> 
    </Price> 
    <Shipment> 
     <shippingMethod>anyType</shippingMethod> 
     <shippingCarrier>anyType</shippingCarrier> 
     <shippingAccount>anyType</shippingAccount> 
     <condolidatedShipment>anyType</condolidatedShipment> 
     <ShippingCost> 
     <NetPrice>3.40282347E+38</NetPrice> 
     <Tax>anyType</Tax> 
     <Currency>anyType</Currency> 
     <CalculationDate>anyType</CalculationDate> 
     </ShippingCost> 
    </Shipment> 
    <OrderItems> 
     <ItemName>anyType</ItemName> 
     <Quantity>anyType</Quantity> 
     <UnitPrice> 
     <NetPrice>-0.100000024</NetPrice> 
     <Tax>anyType</Tax> 
     <Currency>anyType</Currency> 
     <CalculationDate>anyType</CalculationDate> 
     </UnitPrice> 
     <KitNumber>anyType</KitNumber> 
     <KitComponents> 
     <KitComponentNumber>anyType</KitComponentNumber> 
     <Quantity>anyType</Quantity> 
     <Price> 
      <NetPrice>0.100000024</NetPrice> 
      <Tax>anyType</Tax> 
      <Currency>anyType</Currency> 
      <CalculationDate>anyType</CalculationDate> 
     </Price> 
     </KitComponents> 
     <ProductionInformation> 
     <GeneItem>anyType</GeneItem> 
     </ProductionInformation> 
    </OrderItems> 
    <OrderItems> 
     <ItemName>anyType</ItemName> 
     <Quantity>anyType</Quantity> 
     <UnitPrice> 
     <NetPrice>2.1</NetPrice> 
     <Tax>anyType</Tax> 
     <Currency>anyType</Currency> 
     <CalculationDate>anyType</CalculationDate> 
     </UnitPrice> 
     <KitNumber>anyType</KitNumber> 
     <KitComponents> 
     <KitComponentNumber>anyType</KitComponentNumber> 
     <Quantity>anyType</Quantity> 
     <Price> 
      <NetPrice>2.1</NetPrice> 
      <Tax>anyType</Tax> 
      <Currency>anyType</Currency> 
      <CalculationDate>anyType</CalculationDate> 
     </Price> 
     </KitComponents> 
     <ProductionInformation> 
     <GeneItem>anyType</GeneItem> 
     </ProductionInformation> 
    </OrderItems> 
    <OrderItems> 
     <ItemName>anyType</ItemName> 
     <Quantity>anyType</Quantity> 
     <UnitPrice> 
     <NetPrice>3.40282347E+38</NetPrice> 
     <Tax>anyType</Tax> 
     <Currency>anyType</Currency> 
     <CalculationDate>anyType</CalculationDate> 
     </UnitPrice> 
     <KitNumber>anyType</KitNumber> 
     <KitComponents> 
     <KitComponentNumber>anyType</KitComponentNumber> 
     <Quantity>anyType</Quantity> 
     <Price> 
      <NetPrice>-3.40282347E+38</NetPrice> 
      <Tax>anyType</Tax> 
      <Currency>anyType</Currency> 
      <CalculationDate>anyType</CalculationDate> 
     </Price> 
     </KitComponents> 
     <ProductionInformation> 
     <GeneItem>anyType</GeneItem> 
     </ProductionInformation> 
    </OrderItems> 
    <ProductionOrderStatus>ORDERED</ProductionOrderStatus> 
    </ProductionOrder> 
    <ProductionOrder> 
    <extpectedDeliveryDate>anyType</extpectedDeliveryDate> 
    <ProductionSite>HSV</ProductionSite> 
    <ProductionSystem>anyType</ProductionSystem> 
    <BusinessUnit>NGS</BusinessUnit> 
    <Comment> 
     <CommentType>anyType</CommentType> 
     <CommentText>anyType</CommentText> 
     <CommentDate>9999-11-29T23:59:59.9999999+05:30</CommentDate> 
     <InternalComment>true</InternalComment> 
    </Comment> 
    <Comment> 
     <CommentType>anyType</CommentType> 
     <CommentText>anyType</CommentText> 
     <CommentDate>1899-10-29T01:01:01+05:30</CommentDate> 
     <InternalComment>false</InternalComment> 
    </Comment> 
    <Comment> 
     <CommentType>anyType</CommentType> 
     <CommentText>anyType</CommentText> 
     <CommentDate>1900-03-06T01:01:01+05:30</CommentDate> 
     <InternalComment>true</InternalComment> 
    </Comment> 
    <Price> 
     <NetPrice>3.40282347E+38</NetPrice> 
     <Tax>anyType</Tax> 
     <Currency>anyType</Currency> 
     <CalculationDate>anyType</CalculationDate> 
    </Price> 
    <Shipment> 
     <shippingMethod>anyType</shippingMethod> 
     <shippingCarrier>anyType</shippingCarrier> 
     <shippingAccount>anyType</shippingAccount> 
     <condolidatedShipment>anyType</condolidatedShipment> 
     <ShippingCost> 
     <NetPrice>-0.100000024</NetPrice> 
     <Tax>anyType</Tax> 
     <Currency>anyType</Currency> 
     <CalculationDate>anyType</CalculationDate> 
     </ShippingCost> 
    </Shipment> 
    <OrderItems> 
     <ItemName>anyType</ItemName> 
     <Quantity>anyType</Quantity> 
     <UnitPrice> 
     <NetPrice>3.40282347E+38</NetPrice> 
     <Tax>anyType</Tax> 
     <Currency>anyType</Currency> 
     <CalculationDate>anyType</CalculationDate> 
     </UnitPrice> 
     <KitNumber>anyType</KitNumber> 
     <KitComponents> 
     <KitComponentNumber>anyType</KitComponentNumber> 
     <Quantity>anyType</Quantity> 
     <Price> 
      <NetPrice>3.40282347E+38</NetPrice> 
      <Tax>anyType</Tax> 
      <Currency>anyType</Currency> 
      <CalculationDate>anyType</CalculationDate> 
     </Price> 
     </KitComponents> 
     <ProductionInformation> 
     <GeneItem>anyType</GeneItem> 
     </ProductionInformation> 
    </OrderItems> 
    <OrderItems> 
     <ItemName>anyType</ItemName> 
     <Quantity>anyType</Quantity> 
     <UnitPrice> 
     <NetPrice>1.2</NetPrice> 
     <Tax>anyType</Tax> 
     <Currency>anyType</Currency> 
     <CalculationDate>anyType</CalculationDate> 
     </UnitPrice> 
     <KitNumber>anyType</KitNumber> 
     <KitComponents> 
     <KitComponentNumber>anyType</KitComponentNumber> 
     <Quantity>anyType</Quantity> 
     <Price> 
      <NetPrice>1.2</NetPrice> 
      <Tax>anyType</Tax> 
      <Currency>anyType</Currency> 
      <CalculationDate>anyType</CalculationDate> 
     </Price> 
     </KitComponents> 
     <ProductionInformation> 
     <GeneItem>anyType</GeneItem> 
     </ProductionInformation> 
    </OrderItems> 
    <OrderItems> 
     <ItemName>anyType</ItemName> 
     <Quantity>anyType</Quantity> 
     <UnitPrice> 
     <NetPrice>3.2</NetPrice> 
     <Tax>anyType</Tax> 
     <Currency>anyType</Currency> 
     <CalculationDate>anyType</CalculationDate> 
     </UnitPrice> 
     <KitNumber>anyType</KitNumber> 
     <KitComponents> 
     <KitComponentNumber>anyType</KitComponentNumber> 
     <Quantity>anyType</Quantity> 
     <Price> 
      <NetPrice>3.2</NetPrice> 
      <Tax>anyType</Tax> 
      <Currency>anyType</Currency> 
      <CalculationDate>anyType</CalculationDate> 
     </Price> 
     </KitComponents> 
     <ProductionInformation> 
     <GeneItem>anyType</GeneItem> 
     </ProductionInformation> 
    </OrderItems> 
    <ProductionOrderStatus>REVIEW</ProductionOrderStatus> 
    </ProductionOrder> 
</GenomicOrder> 

이 내 원하는 결과가 난 내 변화에서 기대하고있다

<?xml version="1.0" encoding="utf-8"?> 
<SalesOrder xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eurofins.Genomics.Egsp.Xbo.OrderManagement" z:Id="i1"> 
    <CreatedByClient >testString</CreatedByClient> 
    <CreatedByUser >testString</CreatedByUser> 
    <CreatedOn >2012-04-26T17:44:15.4556116+05:30</CreatedOn> 
    <ExchangeableBusinessObjectId >00000000-0000-0000-0000-000000000000</ExchangeableBusinessObjectId> 
    <IncrementalId >0</IncrementalId> 
    <InstanceStatus >Active</InstanceStatus> 
    <ModifiedByClient i:nil="true"/> 
    <ModifiedByUser i:nil="true"/> 
    <ModifiedOn i:nil="true"/> 
    <BillTo>self</BillTo> 
    <ConfirmedDate>2012-04-26T17:44:15.4546116+05:30</ConfirmedDate> 
    <Contact z:Id="i2"> 
    <CreatedByClient >TestApplication</CreatedByClient> 
    <CreatedByUser >Ram</CreatedByUser> 
    <CreatedOn >2012-04-26T17:44:15.4546116+05:30</CreatedOn> 
    <ExchangeableBusinessObjectId >00000000-0000-0000-0000-000000000000</ExchangeableBusinessObjectId> 
    <IncrementalId >0</IncrementalId> 
    <InstanceStatus >Active</InstanceStatus> 
    <ModifiedByClient i:nil="true"/> 
    <ModifiedByUser i:nil="true"/> 
    <ModifiedOn i:nil="true"/> 
    <Address z:Id="i3"> 
     <CreatedByClient i:nil="true"/> 
     <CreatedByUser i:nil="true"/> 
     <CreatedOn >2012-04-26T17:44:15.4556116+05:30</CreatedOn> 
     <ExchangeableBusinessObjectId >00000000-0000-0000-0000-000000000000</ExchangeableBusinessObjectId> 
     <IncrementalId >0</IncrementalId> 
     <InstanceStatus >Active</InstanceStatus> 
     <ModifiedByClient i:nil="true"/> 
     <ModifiedByUser i:nil="true"/> 
     <ModifiedOn i:nil="true"/> 
     <AddressType>Contact</AddressType> 
     <City>Bangalore</City> 
     <Country>India</Country> 
     <CustomField1 i:nil="true"/> 
     <CustomField2 i:nil="true"/> 
     <Fax i:nil="true"/> 
     <FirstName i:nil="true"/> 
     <LastName i:nil="true"/> 
     <Line1 i:nil="true"/> 
     <Line2 i:nil="true"/> 
     <Line3 i:nil="true"/> 
     <Mobile i:nil="true"/> 
     <Phone i:nil="true"/> 
     <Recipient i:nil="true"/> 
     <State i:nil="true"/> 
     <Street i:nil="true"/> 
     <Title i:nil="true"/> 
     <Zip i:nil="true"/> 
    </Address> 
    <EmailAddress>[email protected]</EmailAddress> 
    <VatId i:nil="true"/> 
    </Contact> 
    <FulfillmentInfo z:Id="i4"> 
    <CreatedByClient i:nil="true"/> 
    <CreatedByUser >ram</CreatedByUser> 
    <CreatedOn i:nil="true"/> 
    <ExchangeableBusinessObjectId >00000000-0000-0000-0000-000000000000</ExchangeableBusinessObjectId> 
    <IncrementalId >0</IncrementalId> 
    <InstanceStatus >Active</InstanceStatus> 
    <ModifiedByClient i:nil="true"/> 
    <ModifiedByUser i:nil="true"/> 
    <ModifiedOn i:nil="true"/> 
    <Comments i:nil="true"/> 
    <DocumentationLanguage>testString</DocumentationLanguage> 
    <FirstConfirmedDate>2012-04-26T17:44:15.4536116+05:30</FirstConfirmedDate> 
    <GiftCertificate i:nil="true"/> 
    <GiftCertificates i:nil="true"/> 
    <PromotionCode>testString</PromotionCode> 
    <TestOrder>false</TestOrder> 
    </FulfillmentInfo> 
    <OrderReference>test</OrderReference> 
    <OrderReferenceCustomer>Order123456</OrderReferenceCustomer> 
    <OrderReferenceExternal>testext</OrderReferenceExternal> 
    <OrderStatus>Review</OrderStatus> 
    <PaymentInformations> 
    <PaymentInformation z:Id="i5"> 
     <CreatedByClient >testString</CreatedByClient> 
     <CreatedByUser >testString</CreatedByUser> 
     <CreatedOn >2012-04-26T17:44:15.4536116+05:30</CreatedOn> 
     <ExchangeableBusinessObjectId >00000000-0000-0000-0000-000000000000</ExchangeableBusinessObjectId> 
     <IncrementalId >0</IncrementalId> 
     <InstanceStatus >Active</InstanceStatus> 
     <ModifiedByClient i:nil="true"/> 
     <ModifiedByUser i:nil="true"/> 
     <ModifiedOn i:nil="true"/> 
     <Amount>123</Amount> 
     <EvoCardId>ER</EvoCardId> 
     <PaymentMethod>EvoCard</PaymentMethod> 
     <PoNumber i:nil="true"/> 
     <TransactionID i:nil="true"/> 
    </PaymentInformation> 
    </PaymentInformations> 
+0

XML 입력 샘플과 해당 입력 샘플에 대해 XSLT로 생성하려는 출력을 게시하는 것을 고려하십시오. 그리고 libxslt가 XSLT 1.0 프로세서이기 때문에'libxslt'와'xslt-2.0' 태그가 혼란 스럽습니다. 따라서 어떤 XSLT 버전을 사용하고 싶은지 명확히하십시오. –

+0

xslt-2.0에서 변환을 원합니다 – KRP

+0

원하는 출력에 제공된 XML 문서에없는 값이 있습니다. 현실적이고 비 모순적인 예를 편집하고 제공하십시오. –

답변

0

어쩌면 당신의 변화 흐름을 좀 더 제어 할 수 있습니다 : 여기

내 입력 XML인가? 이 같은 :

<xsl:template match="/"> 
    <xsl:apply-templates select="GenomicOrder/SalesOrder"/> 
</xsl:template> 
... 

    <xsl:template match="SalesOrder"> 
    <SalesOrder> 
    ... 
     <xsl:apply-templates select="FulfilmentInfo"/> 
     <PaymentInformations> 
      <xsl:apply-templates select="PaymentOptions/PaymentMethod"/> 
     </PaymentInformations> 
    </SalesOrder> 
    </xsl:template> 
    ... 
    <xsl:template match="PaymentMethod"> 
    <PaymentInformation> 
     <PaymentMethod> 
     <xsl:value-of select="."/> 
     </PaymentMethod> 
    </PaymentInformation> 
    </xsl:template> 
    ... 

당신이 수동으로 다시 만드는 구조 대신 <xsl:copy-of select=""> 멀리 얻을 수있는 네임 스페이스 변경 아니라면.

+0

템플릿을 호출하기 위해 변경했지만 미스터리는 여전히 남아 있습니다. 어떻게 내가 그것을 중복 결제 방법 에 대해 한 번만 호출 할 수 있습니다 KRP

+0

이제 XML을 입력하면 여러 개의 PaymentOptions이있는 것을 볼 수 있습니다. 따라서 각 PaymentMethod에 대해 반복됩니다. –

+0

@RamPrasadK 답변을 업데이트했습니다. 오히려 내가 원하는대로 XSLT 전체를 게시 하시겠습니까? –

관련 문제