chima
asked on
Space assigning or printing error
Hello,
I have this line of code: closingRootElement =("</"+rootElement.substri ng(1,rootE lement.len gth())+">" );
and when I print it; pw.print(closingRootElemen t);
pw is; PrintWriter pw = new PrintWriter(new FileWriter(tempFile));
What I get is:</CorrelationEnginePara meters > There is a space between the s and >, i.e., "s >".
I can not figure out from where this space is coming from.
Any thoughts, suggestions?
I have this line of code: closingRootElement =("</"+rootElement.substri
and when I print it; pw.print(closingRootElemen
pw is; PrintWriter pw = new PrintWriter(new FileWriter(tempFile));
What I get is:</CorrelationEnginePara
I can not figure out from where this space is coming from.
Any thoughts, suggestions?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<<<<<
Grading Comments:
Dame your good! Had to add a -1 to the parser;
rootElement = (line.trim().substring(lin e.trim().i ndexOf('<' ), (line.trim().indexOf("xmln s=")-1)));
>>>>>
You got it. Since there is a space before the xmlns attribute in the tag. :)
Glad to help.
Grading Comments:
Dame your good! Had to add a -1 to the parser;
rootElement = (line.trim().substring(lin
>>>>>
You got it. Since there is a space before the xmlns attribute in the tag. :)
Glad to help.
ASKER
rootElement = (line.trim().substring(lin