<commit_before>////////////////////////////////////////////////////////////////////////////////
//
//  ADOBE SYSTEMS INCORPORATED
//  Copyright 2003-2007 Adobe Systems Incorporated
//  All Rights Reserved.
//
//  NOTICE: Adobe permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

package mx.rpc.xml
{

import flash.utils.ByteArray;
import flash.utils.Dictionary;
import mx.collections.ArrayCollection;
import mx.utils.DescribeTypeCache;
import mx.utils.object_proxy;
import mx.utils.ObjectProxy;
import mx.utils.ObjectUtil;
import mx.collections.IList;
import flash.system.Capabilities;

[ExcludeClass]

/**
 * Encodes an ActionScript Object graph to XML based on an XML Schema.
 * 
 * @private
 */
public class XMLEncoder extends SchemaProcessor implements IXMLEncoder
{
    public function XMLEncoder()
    {
        super();
        
        // Depending on the player type/version, xml characters in strings
        // need or need not be escaped. AIR 1.5 ('Desktop' version 10) escapes
        // these characters by default. For all other versions Flex needs to
        // do it. The version test to determine this behavior is done here, so
        // that it's not repeated every time xml content is encoded. This is a
        // fix for bug SDK-18326.
        if (flash.system.Capabilities.playerType == "Desktop")
        {
            var version:String = flash.system.Capabilities.version.split(' ')[1];
            var majorVersion:Number = Number(version.split(',')[0]);
            if (majorVersion >= 10)
            {
                _escapeXMLChars = false;
            }
        }
        
    }

    //--------------------------------------------------------------------------
    //
    // Methods
    // 
    //--------------------------------------------------------------------------

    /**
     * Encodes an ActionScript value as XML.<commit_msg>Transferred from the Adobe Open Source Subversion Repository<commit_after>////////////////////////////////////////////////////////////////////////////////
//
//  ADOBE SYSTEMS INCORPORATED
//  Copyright 2003-2007 Adobe Systems Incorporated
//  All Rights Reserved.
//
//  NOTICE: Adobe permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

package mx.rpc.xml
{

import flash.utils.ByteArray;
import flash.utils.Dictionary;
import mx.collections.ArrayCollection;
import mx.collections.IList;
import mx.messaging.config.LoaderConfig;
import mx.utils.DescribeTypeCache;
import mx.utils.object_proxy;
import mx.utils.ObjectProxy;
import mx.utils.ObjectUtil;

[ExcludeClass]

/**
 * Encodes an ActionScript Object graph to XML based on an XML Schema.
 * 
 * @private
 */
public class XMLEncoder extends SchemaProcessor implements IXMLEncoder
{
    public function XMLEncoder()
    {
        super();
        
        // Depending on the target player version, xml characters in strings
        // need or need not be escaped. Prior to version 10, Flex needs to
        // do it. The version test to determine this behavior is done here, so
        // that it's not repeated every time xml content is encoded. This is a
        // fix for bug SDK-18326.
        if (LoaderConfig.swfVersion >= 10)
        {
            _escapeXMLChars = false;
        }
    }

    //--------------------------------------------------------------------------
    //
    // Methods
    // 
    //--------------------------------------------------------------------------

    /**
     * Encodes an ActionScript value as XML.
{'fraction_non_alphanumeric': 0.23661303086256924, 'fraction_numerical': 0.010023740437879188, 'mean_word_length': 1.4639376218323588, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3396403', 'n_tokens_mistral': 938, 'n_tokens_neox': 890, 'n_words': 313}