Removing Existing Namespace Prefixes with XmlBeans

GodLike

New Member
In the past, I've used XmlOptions.setDefaultNamespace() and, if I remember correctly, that was all I needed to do to remove the namespace prefixes from the tags in the XML document.Now, I'm having trouble getting XmlBeans to cooperate. It seems that no matter what I try, the namespace prefixes won't go away. Here are some things I've tried:\[code\]XmlOptions xmlOptions = new XmlOptions();xmlOptions.setSavePrettyPrint();//xmlOptions.setLoadSubstituteNamespaces(namespaceMap);xmlOptions.setUseDefaultNamespace();\[/code\]Also:\[code\]Map<String, String> namespaceMap = new HashMap<String, String>();namespaceMap.put("urn:astm-org:CCR",null);XmlOptions xmlOptions = new XmlOptions();xmlOptions.setSavePrettyPrint();xmlOptions.setLoadSubstituteNamespaces(namespaceMap);xmlOptions.setUseDefaultNamespace();\[/code\]The top of the XML document looks like this:\[code\]<?xml version="1.0" encoding="UTF-8"?><ccr:ContinuityOfCareRecord xsi:schemaLocation="urn:astm-org:CCR CCRV1.xsd"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ccr="urn:astm-org:CCR">\[/code\]The full XML file can be found here: https://trac.opensourcevista.net/browser/ccr/trunk/NIST-ccr/304.f_ds3_CCR.xmlHow do I make these damn things go away?!?! HALP!
 
Back
Top