6 comments
Comment actions Permalink

Hi Turalllb,

Please be more specific with the question. I don't understand what you mean and what you try to achieve. Please explain the context and use case.

0
Comment actions Permalink

I parse the xml file, translate the text into other languages ​​and write everything into a new xml file. But in the original xml file there is a line break character between two string, I don't know how I can find out about the character and how to add it to the new file.

I get the final file in this form, without an empty line between the first and second string

0
Comment actions Permalink

I'm sorry, but it is still too little information. What does it mean that you parse the XML file? How do you write it to a new file? What APIs do you use? Why do you expect a line break character to be added between lines in a new file? Why original file does have these line breaks?

Please be more specific.

0
Comment actions Permalink

I'll try to make it simpler and write the main thing. I'm parsing an xml file, on the screen you see line breaks: /n . Now I find each xml tag , translate its text and write it to a new file, but I don't know how I can find out about line break characters and transfer them to a new file.
 
 
 
 
 
 
 
0
Comment actions Permalink

Hi,

I can't see your code and don't understand the algorithm, but maybe you skip white space elements when you process the XML PSI tree?

0
Comment actions Permalink
I found the reason, it turns out that there is a WhiteSpace interface for whitespace elements, but this element is not used in my xml files, android studio adds XmlText with text like "/n" instead of WhiteSpace when formatting
 
 
 
0

Please sign in to leave a comment.