How to suppress Namespace in XmlBeans Object ? ----------------------------------------------
Key: XMLBEANS-408 URL: https://issues.apache.org/jira/browse/XMLBEANS-408 Project: XMLBeans Issue Type: Improvement Components: Binding Affects Versions: Version 1.0.4 Environment: TEST Reporter: Rajeshkumar Priority: Critical Fix For: Version 2.1 Hi.... Im using XmlBeans for paste 1yr, i dont know much on this topics, but i got one requirement for that want to suppress total Namespace from input xml. My scenario im getting xml like this.... <?xml version="1.0" encoding="UTF-8"?> <XSDPaymentRequestMsg xmlns="urn:XSD:xsd:XSDPaymentRequestMsg.00.03.00" xmlns:HE2E="urn:XSD:xsd:XSDHdrSrv.001.07" xmlns:HTRT="urn:XSD:xsd:XSDHdrTrt.001.07" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <XSDBdyPaymentRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SSRD="urn:XSD:xsd:XSDBdyPaymentRequest.00.03.00" xmlns:SGNT="urn:XSD:xsd:XSDSgnInf.001.04" xmlns:GPRS="urn:XSD:xsd:XSDPaymentRequest.00.03.00"> <SSRD:XSDEnvelPaymentRequest> <SSRD:XSDPaymentRequest> <GPRS:GrpHdr> <GPRS:MsgId>2008013100010</GPRS:MsgId> <GPRS:CreDtTm>2008-01-31T15:14:53</GPRS:CreDtTm> <GPRS:NbOfTxs>2</GPRS:NbOfTxs> <GPRS:CtrlSum>27.00</GPRS:CtrlSum> <GPRS:Grpg>GRPD</GPRS:Grpg> <GPRS:InitgPty> <GPRS:Nm>Fortunati Maria Grazia</GPRS:Nm> <GPRS:Id> <GPRS:OrgId> <GPRS:TaxIdNb> FRTMGR70D60G337W </GPRS:TaxIdNb> <GPRS:PrtryId> <GPRS:Id>0031885X</GPRS:Id> <GPRS:Issr>ACBI</GPRS:Issr> </GPRS:PrtryId> </GPRS:OrgId> </GPRS:Id> </GPRS:InitgPty> </GPRS:GrpHdr> </SSRD:XSDPaymentRequest> </SSRD:XSDEnvelPaymentRequest> </XSDBdyPaymentRequest> </XSDPaymentRequestMsg> if i get object like this... final XSDPaymentRequestMsgDocument requestMsgDocument = XSDPaymentRequestMsgDocument.Factory.parse(inputXml,new XmlOptions().setSaveAggresiveNamespaces()); XSDBdyPaymentRequest000305 request000305 = requestMsgDocument.getXSDPaymentRequestMsg().getXSDBdyPaymentRequest(); XSDPaymentRequest000305 request0003052 = request000305.getXSDEnvelPaymentRequestArray(0).getXSDPaymentRequest(); XSDGenericIdentification1 pmtrequest = request0003052.getGrpHdr().getInitgPty().getId().getOrgId().getPrtryId(); System.out.println(">>> pmtrequest = "+pmtrequest ); OUTPUT ======== I will get like this..... <xml-fragment xmlns:urn="urn:XSD:xsd:XSDPaymentRequest.00.03.05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:HTRT="urn:XSD:xsd:XSDHdrTrt.001.07" xmlns:HE2E="urn:XSD:xsd:XSDHdrSrv.001.07\" xmlns:BODY="urn:XSD:xsd:XSDBdyPaymentRequest.00.03.05"> <GPRS:Id>0031885X</GPRS:Id> <GPRS:Issr>ACBI</GPRS:Issr> </xml-fragment> but i Expect output is like this......... <xml-fragment> <Id>0031885X</Id> <Issr>ACBI</Issr> </xml-fragment> Can you please suggest me to how to do get this scenario? Regards, Rajesh. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: dev-h...@xmlbeans.apache.org