on 02-09-2011 6:09 AM
Hi Folks,
This is the output structure I need to get. My interface is file to file. Can u please let me know How do I create a data type or any XSD to get below Structure.
<?xml version="1.0" encoding="UTF-8" ?>
- <Command xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Command.xsd">
- <WriteTagData readerID="EasyDP">
- <Item>
- <FieldList format="C:\Documents and Settings\wlee\Desktop\Format_4A.btw" jobName="Test1" quantity="1">
<Field name="PlantNo">4012</Field>
<Field name="PlantName">ANE</Field>
<Field name="SKU">12000001</Field>
< </FieldList>
</Item>
</WriteTagData>
</Command>
Please help me How would I create Data type for this. Your help is highly apreciated
Thanks,
Enivass
Hi,
You can use stylus studio for this purpose. Open stulys studio, go to -> XML -> Create Schema from XML Content.
It will geenerate an XSD/DTD.
Aashish Sinha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Enivas,
Save this below code as XSLT, zip and then import as external archive. And then add this as last step in Operation mapping. Hopefully, I think it is help for you out of your issue.
<?xml version="1.0"; encoding="UTF-8"?>
<ns0:stylesheet version="1.0"; xmlns:ns0="http://www.w3.org/1999/XSL/Transform">
<ns0:output method="xml" encoding="UTF-8"/>
<ns0:template match="/">
<ns0:copy>
<ns0:apply-templates/>
</ns0:copy>
</ns0:template>
<ns0:template match="*">
<ns0:element name="{local-name()}">
<ns0:apply-templates select="@* | node()"/>
</ns0:element>
</ns0:template>
<ns0:template match="@*">
<ns0:attribute name="{local-name()}">
<ns0:value-of select="."/>
</ns0:attribute>
</ns0:template>
<ns0:template match="text() | processing-instruction() | comment()">
<ns0:copy/>
</ns0:template>
</ns0:stylesheet>
Regards,
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Enivas,
>>>>>>>>>Please help me how would I delete ns0.
For remove ns0, you have to do use XMLAnonymizerBean module in adpater module (In Communication channel).
Insert the XMLAnonymizerBean before the CallSapAdapter .
The module name u2018CallSapAdapteru2019 is default one that can be left as it is.
Module Name : AF_Modules/XMLAnonymizerBean
Type: Local Enterprise Bean
Module Key: 0
Add Parameters in the Module Configuration
2. Module Key: 0
Parameter Name: anonymizer.acceptNamespaces
Parameter Value: <namespace> u2018u2019
Enter a list of namespaces and their prefixes that are to be kept in the target XML document and to result a namespace without a prefix, enter u2018 u2018 (two single quotation marks). In your case like namespace http://www.w3.org/2001/XMLSchema-instance follow with two single quotation marks.
3. Module Key: 0
Parameter Name: anonymizer.quote
Parameter Value: u2018
Here specify the character to be used to enclose the attribute values. The default value is u2018.
When scenario is executed, the target message contains the namespace with no prefix.
Then, you are not facing any issue in target messages.
Regards,
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajesh,
If I am using HTTP adapter as a receiver so it is not possible right. Can u please let me know how would I handle for HTTP adapter as a target.
Actually My scenario is IDOC to HTTP. In the target Http structure I am getting this ns0. For that reason it is throwing below error
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!-- Call Adapter
-->
- <SAP:Error SOAP:mustUnderstand="" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SAP:Category>XIAdapter</SAP:Category>
<SAP:Code area="PLAINHTTP_ADAPTER">ATTRIBUTE_CLIENT</SAP:Code>
<SAP:P1>400</SAP:P1>
<SAP:P2>ICM_HTTP_CONNECTION_FAILED</SAP:P2>
<SAP:P3 />
<SAP:P4 />
<SAP:AdditionalText />
<SAP:Stack>HTTP client code 400 reason ICM_HTTP_CONNECTION_FAILED</SAP:Stack>
<SAP:Retry>A</SAP:Retry>
</SAP:Error>
Please help me on this.
Thanks,
Enivass
If you have any tool like XML Spy or Srylus studio , you can conver XML to XSD or DTD.
your XML looks simple only, you have to define attriubutes for field name.
Regards,
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raj,
Can u please tell me How would I create below command in DT.
<Command xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Command.xsd">
I tried with message type XML NAMESPACE SHEMA but it is getting output as
<ns0:Command xmlns:ns0="http://www.w3.org/2001/XMLSchema-instance">
Please help me how would I delete ns0.
If possible please paste the XSD Strucutre for the above xml Structure.
Thanks,
Enivass
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.