Name cannot begin with the ' ' character, hexadecimal value 0x20. Line 63, position25

Name cannot begin with the ' ' character, hexadecimal value 0x20. Line 63, position25

  
Hello,

I am reading contents of an XML/XLIFF file.

Suppose, I have a tag like this

<target>.ABC <x id="1" ctype="lb">DEF <x id="2" ctype="lb"> </target>

Then it's working fine.

But whenever there are inputs like this 

<target>.ABC <x id="1" ctype="lb"> < DEF <x id="2" ctype="lb"> </target>

At the time of loading XML document, it's giving an error.

I want to store "<" symbol before DEF into the database.

Please advice.

Thanks and Regards,
Suraj Borade
Hi Suraj,

That is invalid xml. If its part of the text the < should have been encoded into &lt;
Check this: http://stackoverflow.com/questions/1091945/what-characters-do-i-need-to-escape-in-xml-documents

Regards,
João Rosado
Hi Joao,

Thanks for the reply.

Let me explain you my scenario.

1. I am generating XLIFF file using table values.

2. We are passing XLIFF files to the World Server API.

3. World Server API will return us XLIFF file which is translated into another language.

4. We are importing that XLIFF file in our application.

Now in this case, if I put escaping character "&lt;" or "&gt;" in generated XLIFF from OutSystems and sent that file to World Server API, it's possible that "lt" and "gt" would be converted into another language and at the time of import back, I won't be able to get my escape characters to store in the database.

Please advice.

Best Regards,
Suraj Borade
Did you try to see if it would work or not?
Because one is invalid xml and the other is the correct way to do it. Any xml reader will decode it automatically, so it sould be fine.

Regards,
João Rosado
Solution
Joao,

I didn't try to see if it would work or not.

Translation work is done by localization team. I just need to give them XLIFF file and they have told us to give as it is in Database. So not sure whether World Server API will accept file containing "&lt;" or "&gt;"

Best Regards,
Suraj Borade
Solution