|
|
| khiann 2004-10-06, 2:47 am |
| i have a schema as follow
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://candelete.Schema1"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://candelete.Schema1"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="InputSchema">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="Header">
<xs:complexType>
<xs:sequence>
<xs:element name="PO" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" maxOccurs="unbounded" name="Suppliment1">
<xs:complexType>
<xs:sequence>
<xs:element name="Code" type="xs:string" />
<xs:element name="Identifier" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" maxOccurs="unbounded" name="Suppliment2">
<xs:complexType>
<xs:attribute name="Qty" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
would like to map to
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://candelete.Schema2"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://candelete.Schema2"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="OutputSchema">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="Header">
<xs:complexType>
<xs:sequence>
<xs:element name="po" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" maxOccurs="unbounded" name="Details">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="Pqty">
<xs:complexType>
<xs:sequence>
<xs:element name="Ident" type="xs:string" />
<xs:element name="Qty" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
| |
| khiann 2004-10-06, 2:48 am |
| the sample input is
<ns0:InputSchema xmlns:ns0="http://candelete.Schema1">
<Header>
<PO>PO_0</PO>
</Header>
<Suppliment1>
<Code>Code0</Code>
<Identifier>Identifier_0</Identifier>
</Suppliment1>
<Suppliment1>
<Code>Code2</Code>
<Identifier>Identifier2</Identifier>
</Suppliment1>
<Suppliment1>
<Code>Code2</Code>
<Identifier>Identifier2</Identifier>
</Suppliment1>
<Suppliment2 Qty="Qty_0" />
<Suppliment2 Qty="Qty_1" />
</ns0:InputSchema>
and my desire output is take the first Suppliment1 'Code' with value 'Code2'
in sequence to match with 'Code2' combine with suppliment2's 'Qty' to be in
Pqty node.
<ns0:OutputSchema xmlns:ns0="http://candelete.Schema2">
<Header>
<po>po_0</po>
</Header>
<Details>
<Pqty>
<Ident>Code2</Ident>
<Qty>Qty_0</Qty>
</Pqty>
<Pqty>
<Ident>Code2</Ident>
<Qty>Qty_1</Qty>
</Pqty>
</Details>
</ns0:OutputSchema>
| |
| khiann 2004-10-07, 12:58 am |
| Hi...anyone can help me for this problem....
thanks in advance. | |
| Tan Bao Nguyen 2004-12-22, 5:52 pm |
| Did you resolve the issue? My suggestion is to use a Scripting functoid
and write some XSLT to do the mapping.
Regards,
Tan Nguyen
Microsoft BizTalk Server
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------[vbcol=seagreen]
'Code2'[vbcol=seagreen]
in[vbcol=seagreen]
|
|
|
|