Hi Expert,
i have a xml file. the data is like below :
xml version="1.0" encoding="UTF-8" standalone="no" ?>
- <Envelope xmlns="
http://edavki.durs.si/Documents/Schemas/DDV_O_7.xsd" xmlns:edp="
http://edavki.durs.si/Documents/Schemas/EDP-Common-1.xsd" xmlns:ds="
http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://edavki.durs.si/Documents/Schemas/DDV_O_7.xsd">
-
<edp:Header xmlns:edp="http://edavki.durs.si/Documents/Schemas/DDV_O_7.xsd">
- <edp:taxpayer>
<edp:taxNumber>77777777</edp:taxNumber>
<edp:taxpayerType>PO</edp:taxpayerType>
<edp:name>CRONUS International Ltd.</edp:name>
<edp:address1>5 The Ring</edp:address1>
<edp:address2>Westminster</edp:address2>
<edp:city>London</edp:city>
<edp:postNumber>1</edp:postNumber>
<edp:postName>London</edp:postName>
<edp:maticnaStevilka />
<edp:resident>true</edp:resident>
</edp:taxpayer>
<edp:responseTo />
<edp:domain />
</edp:Header>
<edp:Signatures xmlns:edp="
http://edavki.durs.si/Documents/Schemas/DDV_O_7.xsd" />
- <body>
<edp:bodyContent xmlns:edp="
http://edavki.durs.si/Documents/Schemas/DDV_O_7.xsd" />
- <DDV-O>
...............
.............
Now i want to delete the attribute in element <EDP:Header>(Bold portion). means i want to modify
<edp:Header xmlns:edp="
http://edavki.durs.si/Documents/Schemas/DDV_O_7.xsd"> to <edp:Header> only.
i am using Automation.
Please help me to remove the attibute & let me know how to do it?
Thanx in advance.
Regards,
Mrinmay
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Hi Kine,
Thank you for your reply. Can you please let me know how to do it with xslt? Is there any document which i can refer?
because i am not getting how to use xslt in Nav using automation.
Regards,
Mrinmay
You schould also try the removeAttributeNode method before. Maybe it works?!
On the other hand, if copying is the only solution and you don't want to waste time any more then keep it simple. Open the xml File as Textfile, search for the unwanted string xmlns:edp="http://edavki.durs.si/Documents/Schemas/DDV_O_7.xsd", delete it and replace the original file.
Maybe, I didn't tried it, you can do this manipulation inside a stream and then load the stream directly inside you XML document without the need to save it before on disk.