( function( ) { function _XML( ) { if ( typeof arguments[ 0 ] != 'string' || arguments[ 0 ].length < 1 ) return null; return new ( function ( ) { var _document = null; var _root = null; var j = null; var _xsl_file = null; function _append( ) { var a = null; if ( typeof arguments[ 0 ] == 'string' && ( arguments[ 0 ] = arguments[ 0 ].replace ( /^ +| +$/g,'' ) ) != '' ) a = j.appendChild( _document.createElement( arguments[ 0 ] ) ); if ( a ) { var i = null; if ( arguments[ 1 ] !== null && typeof arguments[ 1 ] == 'object' ) for ( attr in arguments[ 1 ] ) a.setAttribute( attr,arguments[ 1 ][ attr ] ); if ( typeof arguments[ 2 ] == 'string' && arguments[ 2 ].replace( /^ +| +$/g, '' ) != '' ) a.appendChild( _document.createTextNode( arguments[ 2 ] ) ); function g( ) { j = a; var _node = _append.apply( this, arguments ); j = _root; return _node; } function _parse_node( ) { var b = null; if ( _xsl_file ) b = _xsl_file; if ( i ) _xsl_file = i; var d = _document; _document = a; var f = null; if ( _xsl_file ) f = _parse.apply( this, arguments ); if ( b ) { _xsl_file = b; b = null; } _document = d; return f } function _xsl( ) { if ( arguments[ 0 ] && typeof arguments[ 0 ] == 'string' ) i = arguments[ 0 ]; return this } if ( arguments[ 3 ] && arguments[ 3 ].constructor == Object ) { arguments[ 3 ].append = arguments[ 3 ].$ = g; arguments[ 3 ].serialize = _serialize; arguments[ 3 ].xsl = _xsl; } return new ( function ( ) { this.append = this.$ = g; this.serialize = _serialize; this.xsl = _xsl; this.parse = _parse_node; } ); } return null } function _xml( i ) { var g = null; if ( document.implementation && document.implementation.createDocument ) { XMLDocument.prototype.load = function ( b ) { var d = new XMLHttpRequest( ); d.open( 'GET', b, false ); d.setRequestHeader( 'Content-Type', 'text/xml' ); d.send( null ); var f = d.responseXML; if ( f ) { var a = this.importNode( f.documentElement, true ); with ( this ) { appendChild( a ); } return true } }; g = document.implementation.createDocument( '', '', null ); } else g = new ActiveXObject( 'Msxml2.FreeThreadedDOMDocument' ); g.async = false; g.load( i + ( ( i.indexOf( '?' ) < 0 ) ? '?' + Date.parse( new Date ) : '' ) ); return g; } function _load( b ) { _document = _xml( b ); _root = j = _document.documentElement; return this; } function _parse( ) { var _fragment = null; var _params = { }; if ( arguments[ 0 ] && arguments[ 0 ].constructor == Object ) for ( var _index in arguments[ 0 ] ) { var _type_index = _index.constructor; if ( _type_index != String && _type_index != Number ) continue; var _type_param = arguments[ 0 ][ _index ].constructor; if ( _type_param == Object || _type_param == Function ) continue; _params[ String( _index ) ] = String( arguments[ 0 ][ _index ] ); } if ( window.XSLTProcessor ) { var _processor = new XSLTProcessor( ); _processor.importStylesheet( _xml( _xsl_file ) ); for ( var _param in _params ) if ( _params[ _param ].constructor == String ) _processor.setParameter( null, _param, _params[ _param ] ); _fragment = _processor.transformToFragment( _document, document ); var _aux = document.createElement( 'div' ); _aux.appendChild( _fragment ); _fragment = _aux.innerHTML } else { var _xsl_template = new ActiveXObject( 'MSXML2.XSLTemplate' ); _xsl_template.stylesheet = _xml( _xsl_file ); var _processor = _xsl_template.createProcessor( ); _processor.input = _xml( _xsl_file ); for ( var _param in _params ) if ( _params[ _param ].constructor == String ) _processor.addParameter( String( _param ), String( _params[ _param ] ), '' ); _processor.transform( ); _fragment = _processor.output; } return _fragment; } function _serialize( ) { try { return ( new XMLSerializer( ) ).serializeToString( _document ); } catch ( e ) { try { return _document.xml; } catch ( e ) { return null; } } } function _xsl( ) { if ( arguments[ 0 ] && typeof arguments[ 0 ] == 'string' ) _xsl_file = arguments[ 0 ]; return this; } this.append = this.$ = _append; this.load = _load; this.serialize = _serialize; this.xsl = _xsl; this.parse = _parse; if ( document.implementation.createDocument ) _document = document.implementation.createDocument( '', '', null ); else if ( ActiveXObject ) _document = new ActiveXObject( 'Msxml2.DOMDocument' ); with ( _document ) appendChild( createProcessingInstruction( 'xml', 'version = "1.0" encoding = "UTF-8"' ) ); _root = _document.appendChild( _document.createElement( arguments[ 0 ] ) ); j = _root; function p( ) { for ( child in arguments[ 0 ] ) { var b = this.$( arguments[ 0 ][ child ].name, arguments[ 0 ][ child ].attributes, arguments[ 0 ][ child ].value ); if ( arguments[ 0 ][ child ].children && arguments[ 0 ][ child ].children.constructor == Array ) p.call( b, arguments[ 0 ][ child ].children ); } } if ( arguments[ 1 ] && arguments[ 1 ].constructor == Array ) p.call( this, arguments[ 1 ] ) } )( arguments[ 0 ], arguments[ 1 ] ); } window.XML = _XML; } )( );