You need to sign in to do that
Don't have an account?

Throwing this Error:"Unrecognized base64 character: ;"
used this code throwing this error: "Unrecognized base64 character: ;" can any one please help me
for(Dom.XMLNode child : xrec) {
//system.debug('child..'+child);
for (dom.XmlNode awr : child.getchildren() ) {
//System.debug('awr...'+awr);
for(dom.XmlNode xy:awr.getchildren()){
// system.debug('xy...'+xy);
for(dom.XmlNode anc :xy.getchildren()){
//if(anc.gettext() != null ){
baseco=true;
encodedvalue=anc.gettext();
Blob d = EncodingUtil.base64Decode(encodedvalue);
//system.debug('d...'+d);
decodedstring = d.tostring();
}
}
}
}
Thanks
kullayappa
for(Dom.XMLNode child : xrec) {
//system.debug('child..'+child);
for (dom.XmlNode awr : child.getchildren() ) {
//System.debug('awr...'+awr);
for(dom.XmlNode xy:awr.getchildren()){
// system.debug('xy...'+xy);
for(dom.XmlNode anc :xy.getchildren()){
//if(anc.gettext() != null ){
baseco=true;
encodedvalue=anc.gettext();
Blob d = EncodingUtil.base64Decode(encodedvalue);
//system.debug('d...'+d);
decodedstring = d.tostring();
}
}
}
}
Thanks
kullayappa
dont use thsi.
encodedvalue=encodedvalue.replace(';',' ');
use this below code:
howp this will work. if there is any error. let me know the error line exactly. also try to post the XML
Thanks
karthik
All Answers
i tried this code Throwing this error:"
Failed to parse XML due to: only whitespace content allowed before start tag and not P (position: START_DOCUMENT seen P... @1:1)"
Please help me
thanks
kullayappa
can you post the value that you are getting in to this "anc.gettext()" so that i can look in to this and let you know the correct one.
Thanks
karthik
I am getting the data is:basecode64 anc.gettext(); in that code converting the XML format
These Xml code using the DOM.XML code this code using
Thanks
kullayappa
i tried this code but throwing this error:
"Failed to parse XML due to: only whitespace content allowed before start tag and not P (position: START_DOCUMENT seen P... @1:1)"
for(Dom.XMLNode child : xrec) {
//system.debug('child..'+child);
for (dom.XmlNode awr : child.getchildren() ) {
//System.debug('awr...'+awr);
for(dom.XmlNode xy:awr.getchildren()){
// system.debug('xy...'+xy);
for(dom.XmlNode anc :xy.getchildren()){
//if(anc.gettext() != null ){
baseco=true;
encodedvalue=anc.gettext();
encodedvalue=encodedvalue.replace(';',' ');
Blob d= Blob.valueof(encodedvalue);
decodedstring =d.tostring();
}
}
}
}
Thanks
kullayappa
Itried itially that code "*Blob d = EncodingUtil.base64Decode(encodedvalue);
//system.debug('d...'+d);
decodedstring = d.tostring();*/"
Throwing the same error.
Thanks
kullayappa
dont use thsi.
encodedvalue=encodedvalue.replace(';',' ');
use this below code:
howp this will work. if there is any error. let me know the error line exactly. also try to post the XML
Thanks
karthik
Throwing same error.
for(Dom.XMLNode child : xrec) {
//system.debug('child..'+child);
for (dom.XmlNode awr : child.getchildren() ) {
//System.debug('awr...'+awr);
for(dom.XmlNode xy:awr.getchildren()){
// system.debug('xy...'+xy);
for(dom.XmlNode anc :xy.getchildren()){
//if(anc.gettext() != null ){
baseco=true;
encodedvalue=anc.gettext();
//encodedvalue=encodedvalue.replace(';',' ');
/*Blob d = EncodingUtil.base64Decode(encodedvalue);
//system.debug('d...'+d);
decodedstring = d.tostring();*/
Blob d= Blob.valueof(encodedvalue);
decodedstring =d.tostring();
Dom.Document docxxml = new Dom.Document();
if(baseco==true)
docxxml.load(decodedstring);
dom.XmlNode xrootxml = docxxml.getrootelement() ;
for(Dom.XMLNode child_rep: xrootxml.getChildElements()) {
// System.debug('head....'+child);
for(Dom.XML
thanks
kullayappa