on 02-17-2012 6:59 AM
Hi All,
I am facing problem in MII, while i trying to remove 1st 2 XML tags of XML as generated from SAP.
Here is XML which has been generated from SAP
u201C<?xml version="1.0"; encoding="UTF-8"?>
<ZCIFSCHEDULE>
<SCHEDULE>
<MESSAGE_TYPE/>
<SITE>A300</SITE>
<SHOP_ORDER>2012020856</SHOP_ORDER>
<QTY_TO_BUILD>6.000<;/QTY_TO_BUILD>
<DATE_TIME>08-FEB-2012 20:57:21 +05:30</DATE_TIME>
<OPERATION>PRS</OPERATION>
<ITEM>IN-CT00228</ITEM>
<DPICS_CODE>1229</DPICS_CODE>
<REVISION/>
<CYC_TIME_CURING/>
<FLAG_AGING/>
<AGING_MIN/>
<PRODUCTION_VERSION/>
<CYC_TIME_OC/>
<CYC_TIME/>
</SCHEDULE>
</ZCIFSCHEDULE>u201D
From above i want to remove 1st 2 tags and last one tag i.e. u201C<?xml version="1.0"; encoding="UTF-8"?> , <ZCIFSCHEDULE> and last tag ZCIFSCHEDULE>u201D
Its urgent!
Did anyone done regarding this issues. Thanks in advance.
Kind Regards,
Praveen Reddy
Hi Praveen,
Are you trying to make the xml into a string? I think if you remove the first tag, it will either automagically reappear or it will throw and error as being poorly formed xml.
In general, you can remove the nodes by the use of indexes. Since you are operating at the root level, I am not sure how well it will work, but if your xml is in a property, you can reference the specific nodes by something like this: myXML.Output{/*[1]} which if you put it in a tracer will display the contents of the first node (or blank if there are child nodes). The node index can be dynamically set, but start with the simple hard coded one. I would also start at the lowest child level to verify that it is working properly (a tracer will display the contents specified by the index). You can also google xml indices (or indexes) and it will point to some other useful xml operators.
I suggest that you play around with it and also work with the Link Types (hint: removeXML).
Regards,
Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael,
Very thanks for fast response.
If i change this XML into string then its possible to remove header tags. If its possible, please give me instructions regarding how i need to do.
And even i am saving this XML file directly into oracle database with data type varchar.
My client requirement is, they don't want 1st 2 tags and last one Tag of XML . And in database, data should be saved in XML tags only.
And i believing that, its not possible to remove header tags from XML. Please give me conclusion wether its possible or not.
Thanks,
Kind Regards,
Praveen Reddy M
I think he meant to create a new Transaction Property of type xml. Then copy the child node into the new xml property.
But while that will help in removing rows other than the first, the first row will still be populated by default. However, it is worth experimenting as I could be wrong.
Regards,
Mike
Hi,
Thanks for both response and spending time on this issues
i have tired Anshul as you told, but i doesn't worked. xml file itself not coming to xpath.
But Problem has solved through repeater and with small query which as added in SQL query action block.
I have return below code in SQL query i.e.
insert into <Tablename> values( '[Param1]', replace(trim('[Param.2]'),'<?xml version="1.0" encoding="UTF-8"?>',''))
here i am passing Parameter 2 as XML file from repeater item.
once again thanks to both
Kind Regards,
Praveen Reddy M
User | Count |
---|---|
12 | |
7 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.