2013 Jan 24 7:57 AM
Hello expert. I need help about SAP simple transformation.
1. User need the XML file contains header like this:
<?xml version="1.0" encoding="utf-8"?><Document xmlns ="xxx" xmlns:xsi="http://www.abc.com/yyy">
and this is what I coded in my transformation program
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates"
xmlns:xsi="http://www.abc.com/yyy">
<tt:template>
<Document>
<tt:namespace name="xsi"/>
<tt:attribute name="xlmns">xxx</tt:attribute>
</Document>
But what I got is
<?xml version="1.0" encoding="utf-8"?><Document xmlns:xsi=http://www.abc.com/yyy" xmlns ="xxx" >
The sequence is missed. How can I fix it?
2. When the ref value in each node has no value, it return in XML like <tag name />
For example:
Transformation program
<Name>
<tt:value ref="Nam"/>
</Name>
<NumTx>
<tt:value ref="nuoftx"/> <== This field is null
</NumTx>
Result in XML
<Name>TEST NAME</Name><NumTx />
I know this tag is readable in XML, but the XML file should always has opening tag with ending tag, ortherwise it should be removed.
I use command
<tt:cond check="not-initial(value ref.)">
to exclude null value node, but I have more than 30 fields.
Do I need to check them explicitly every field??
Or any idea to force "opening tag" and "ending tag" if it's value is null?
Hello expert. I need help about SAP simple transformation.
1. User need the XML file contains header like this:
<?xml version="1.0" encoding="utf-8"?><Document xmlns ="xxx" xmlns:xsi="http://www.abc.com/yyy">
and this is what I coded in my transformation program
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates"
xmlns:xsi="http://www.abc.com/yyy">
<tt:template>
<Document>
<tt:namespace name="xsi"/>
<tt:attribute name="xlmns">xxx</tt:attribute>
</Document>
But what I got is
<?xml version="1.0" encoding="utf-8"?><Document xmlns:xsi=http://www.abc.com/yyy" xmlns ="xxx" >
The sequence is missed. How can I fix it?
2. When the ref value in each node has no value, it return in XML like <tag name />
For example:
Transformation program
<Name>
<tt:value ref="Nam"/>
</Name>
<NumTx>
<tt:value ref="nuoftx"/> <== This field is null
</NumTx>
Result in XML
<Name>TEST NAME</Name><NumTx />
I know this tag is readable in XML, but the XML file should always has opening tag with ending tag, ortherwise it should be removed.
I use command
<tt:cond check="not-initial(value ref.)">
to exclude null value node, but I have more than 30 fields.
Do I need to check them explicitly every field??
Or any idea to force "opening tag" and "ending tag" if it's value is null?
2015 May 19 8:24 AM
I have the same issue as number 1 about the xml header. Did you find any solutions for this?
2016 Jan 27 7:06 PM
Hello Paisit,
Try the following
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates"
xmlns:xsi="http://www.abc.com/yyy">
<tt:template>
<Document xmlns ="xxx">
<tt:namespace name="xsi"/>
</Document>
Best regards,
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |