Hello all,
is it possible to strip all namespaces in an xml file when using an switchscript?
Or which namespace must i register when there are namespace definitions like this:
thanks in advance and best regards
Strip Namesspaces
Strip Namesspaces
var xmlFile = new Document( path to XML file );
var defaultMap = xmlFile.createDefaultMap();
Be sure to look it up in the online help for more explanation: Scripting module - Scripting reference - XML module - Document class and Metadata module - Map class.
Freddy
var defaultMap = xmlFile.createDefaultMap();
Be sure to look it up in the online help for more explanation: Scripting module - Scripting reference - XML module - Document class and Metadata module - Map class.
Freddy
Strip Namesspaces
Thanks for your reply.
Actually i am using this after test all avaible namespaces in the xml, and this works.
var dataset = job.getDataset("Xml");
var theXML = new Document( dataset.getPath( ) );
var ns = theXML.createEmptyMap();
ns.put("i" ,"http://url.to/schemas/orderexport");
ok ... i guess i must use the one in xmlns field
deleteng all namespaces from an xml seems to be impossible with switchscripter 
Actually i am using this after test all avaible namespaces in the xml, and this works.
var dataset = job.getDataset("Xml");
var theXML = new Document( dataset.getPath( ) );
var ns = theXML.createEmptyMap();
ns.put("i" ,"http://url.to/schemas/orderexport");
ok ... i guess i must use the one in xmlns field


Strip Namesspaces
it's impossible because you have to enable the namespaces in order to target the element! You could simply open it as a file instead of as a document and perform a line by line string search for "", closing the file and reopening as document then, but that would be a _very_ crude hack!