on 08-04-2008 7:59 PM
Hi Guys,
<?xml version="1.0" encoding="UTF-8" ?>
<MT_SAP_UPS_Address_Validation_In Attr="MT_SAP_UPS_Address_Validation_In">
<AccessRequest>
<AccessLicenseNumber>123</AccessLicenseNumber>
<UserId>xy</UserId>
<Password>AB</Password>
</AccessRequest>
</MT_SAP_UPS_Address_Validation_In>
Is it possible to remove the tag <MT_SAP_UPS_Address_Validation_In opening and clsoing tags
Thanks,
Srini
If you remove these elements, the result won't be a valid XML any longer. Any XML needs a root element.
Best wishes,
Jan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srini,
with XSLT it's definitely possible to create an invalid XML file. You schould try Henrique's solution. (However, he removes the AccessRequest element).
Try this XSLT:
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="MT_SAP_UPS_Address_Validation_In">
<xsl:apply-templates select="@*|node()"/>
</xsl:template>
For help on the transformation editor, go to http://help.sap.com/saphelp_nw04/helpdata/en/fd/9d7348389211d596a200a0c94260a5/frameset.htm
Best wishes,
Jan
Hi,
Why you need to remove the node. See there are many ways you can do this if and only if the subelement of the root element also acts a Root Node.
1. If that is your business requirement you can alwas create another message type with root element as AccessRequest and map the source structure(the one with MT_SAP_UPS_Address_Validation_In ) to the structure i have mentioned using message mapping.
2. You can remove the root element by using Java Mapping.
3. You can use xslt mapping as well to remove it.
Thnaks
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The tag can be removed easily with XSLT or Java mapping. It is not possible with graphical mapping.
Regards,
Chandra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
java mapping is also an option.You can use sax parser and change the begin document and end document events.
regards,
ujjwal kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can't remove the Message Type node as it will be leading as root node in the XML message.
You may able to alter the attributes with xslt mapping but not possible to remove it.
Thanks
swarup
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Of course he can change the XML structure with XSLT.
what about:
<xsl:template match="/MT_SAP_UPS_Address_Validation_In/AccessRequest">
<xsl:copy-of select="."/>
</xsl:template>
?
Also, even in message mappings, if he define the target message accordingly, he can also remove the tags.
Of course, this is not dynamic, so he'll need to know the tags it prior to creating the mapping.
A dynamic XSLT could even be achieved, using parent/child logics.
Regards,
Henrique.
Not with message mappings (not in PI 7.0, at least).
You'll need xslt or java/abap mapping for that.
Henrique.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.