Copy link to clipboard
Copied
Hi All,
I am using AS3 CS6 Flash Pro.
I am trying to create a XML file that I can append child data from other similar XML files. It is the XLIFF format that the Strings Panel uses to manage translation data.
The file is by design backward compatiable to AS2. I don't really want to import the XML as a file.
var TEMP:XML = <?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xml:lang="en">
<file datatype="plaintext" original="ZMP_en.fla" source-language="EN">
<header></header>
<body>
</body>
</file></xliff>
trace(TEMP);
1086: syntax error expecting semicolon before version -- for line 2 of code
I will be appending the other XML snippets as children of <body>.
Thanks
try:
var TEMP:XML = <xliff version="1.0" xml:lang="en"> <file datatype="plaintext" original="ZMP_en.fla" source-language="EN"> <header></header> <body> </body> </file> </xliff> trace(TEMP);
Copy link to clipboard
Copied
try:
var TEMP:XML = <xliff version="1.0" xml:lang="en"> <file datatype="plaintext" original="ZMP_en.fla" source-language="EN"> <header></header> <body> </body> </file> </xliff> trace(TEMP);
Copy link to clipboard
Copied
So this was a 'Cut'N'Paste' induced error when copying from an XML editor.
Well, another good reason for me to make this utility.
Thanks kglad !!
Copy link to clipboard
Copied
you're welcome.
Copy link to clipboard
Copied
I didn't notice before that the version Kglad gave to me was missing the first line of the XML.
I put this in and it errors again - any ideal why?? I though it was a whitespace issue
Copy link to clipboard
Copied
you can't use document declaration like that with the xml class.
if you're transmitting xml elsewhere that must have a declaration, use:
XML.ignoreProcessingInstructions=false;
var TEMP:XML = XML('<?xml version="1.0" encoding="UTF-8"?><xliff version="1.0" xml:lang="en"><file datatype="plaintext" original="ZMP_en.fla" source-language="EN"><header></header><body></body></file></xliff>');
Find more inspiration, events, and resources on the new Adobe Community
Explore Now