<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Gulsin 2.0rg - El hermano feo de tux</title>
	<link>http://gulsin.org</link>
	<description>Espacio de tecnologia, software libre y sus derivados. Una horda de monos entrenados escriben de vez en cuando por aqui algunas noticias, opiniones e incluso alguna que otra cosa fuera del tema. Maqueros, favor de abstenerse que no somos lo suficientemente guapos.</description>
	<pubDate>Wed, 18 Aug 2010 04:43:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>
	<language>en</language>
			<item>
		<title>mod_python sobre NetBSD 5.X</title>
		<link>http://gulsin.org/2010/08/17/mod_python-sobre-netbsd-5x/</link>
		<comments>http://gulsin.org/2010/08/17/mod_python-sobre-netbsd-5x/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 04:43:51 +0000</pubDate>
		<dc:creator>Edwin Plauchu</dc:creator>
		
		<category><![CDATA[NetBSD]]></category>

		<category><![CDATA[Programacion]]></category>

		<guid isPermaLink="false">http://gulsin.org/2010/08/17/mod_python-sobre-netbsd-5x/</guid>
		<description><![CDATA[Mod_python es un modulo Apache que embebe el Interprete de Python dentro del el servidor. Con mod_python tu podras escribir aplicaciones webs basada en aplicaciones Python que correran mucho mas rapido que las aplicaciones tradicionales de CGI  ademas de tener acceso a las caracteristicas avanzadas de retener conecciones a bases de datos y acceso [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Mod_python</strong> es un modulo Apache que embebe el Interprete de Python dentro del el servidor. Con mod_python tu podras escribir aplicaciones webs basada en aplicaciones Python que correran mucho mas rapido que las aplicaciones tradicionales de CGI  ademas de tener acceso a las caracteristicas avanzadas de retener conecciones a bases de datos y acceso a funciones internas de Apache.</p>
<p>Instalando el Port en NetBSD 5.X<br />
# cd /usr/pkgsrc/www/ap2-python &#038;&#038; make &#038;&#038; make install</p>
<p>Luego hay que editar el httpd.conf, agregando la siguiente línea para cargar el módulo. </p>
<pre>
LoadModule python_module /usr/pkg/lib/httpd/mod_python.so
</pre>
<p><strong>Mod_python handlers</strong></p>
<p>Apache procesa las requests en fases. Un Handler es una funcion que procesas una particular parte del request. Los Handlers son proporcionados por  Apache y por sus modulos como , mod_python.</p>
<p>El Handler Publisher permite accesar a funciones y variables dentro de un modulo  via URLs. Evitandoce asi el codigo spagetthi.</p>
<p>Para probar el funcionamiento del módulo debemos hacer lo siguiente. En primer lugar, vamos a necesitar definir un handler de python para los requests en un .htaccess. Allí escribimos algo como lo siguiente:</p>
<p>AddHandler mod_python .py<br />
PythonHandler mod_python.publisher<br />
PythonOption session DbmSession<br />
PythonOption session_dbm /home/user/domains/test.com/session.dbm<br />
PythonOption ApplicationPath /<br />
PythonDebug On ## Turn this off when done with debugging</p>
<p>DirectoryIndex index.py</p>
<p>Por supuesto, habrá que ajustar los datos a lo que sea necesario.<br />
Luego, creamos el índice de nuestro sitio, en este caso en /home/user/domains/test.com/public_html/index.py con el siguiente código:</p>
<pre>
## index.py
from mod_python import apache

def index(req):
     req.content_type = 'text/plain'
     req.write('Hello from mod_pythonn')
     return apache.OK
</pre>
<p>Luego accedemos a http://test.com/ y si vemos “Hello from mod_python”, es que hemos instalado correctamente mod_python.</p>
]]></content:encoded>
			<wfw:commentRss>http://gulsin.org/2010/08/17/mod_python-sobre-netbsd-5x/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Instalando Subversion &#038; Apache 2.2 &#038; TRAC sobre NetBSD 5</title>
		<link>http://gulsin.org/2010/07/05/instalando-subversion-apache-22/</link>
		<comments>http://gulsin.org/2010/07/05/instalando-subversion-apache-22/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 05:07:38 +0000</pubDate>
		<dc:creator>Edwin Plauchu</dc:creator>
		
		<category><![CDATA[NetBSD]]></category>

		<guid isPermaLink="false">http://gulsin.org/2010/07/05/instalando-subversion-apache-22/</guid>
		<description><![CDATA[

# cd /usr/pkgsrc/www/ap2-subversion &#038;&#038; make &#038;&#038; make install

# cp /usr/pkg/share/examples/rc.d/apache /etc/rc.d

# echo "apache=YES" >>   /etc/rc.conf

# cd /usr/ports/www/trac &#038;&#038; make &#038;&#038; make install

]]></description>
			<content:encoded><![CDATA[<pre>

# cd /usr/pkgsrc/www/ap2-subversion &#038;&#038; make &#038;&#038; make install

# cp /usr/pkg/share/examples/rc.d/apache /etc/rc.d

# echo "apache=YES" >>   /etc/rc.conf

# cd /usr/ports/www/trac &#038;&#038; make &#038;&#038; make install
</pre>
]]></content:encoded>
			<wfw:commentRss>http://gulsin.org/2010/07/05/instalando-subversion-apache-22/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Tutorial Hello world para principiantes de desarrollo iphone</title>
		<link>http://gulsin.org/2010/06/28/tutorial-hello-worl-para-principiantes-de-desarrollo-iphone/</link>
		<comments>http://gulsin.org/2010/06/28/tutorial-hello-worl-para-principiantes-de-desarrollo-iphone/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 18:59:42 +0000</pubDate>
		<dc:creator>Edwin Plauchu</dc:creator>
		
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://gulsin.org/2010/06/28/tutorial-hello-worl-para-principiantes-de-desarrollo-iphone/</guid>
		<description><![CDATA[Introduccion:
Les mostrare la manera mas simple de crear un programa Hello World sobre IphoneI am going to show you the simplest way to create hello world iPhone tutorial. Para probar el codigo sobre un dispositivo  (iPhone) necesitaras comprar una licencia de desarrollador la cual tiene un costo de 99$ para ti y de 299$ [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduccion:</strong></p>
<p>Les mostrare la manera mas simple de crear un programa Hello World sobre IphoneI am going to show you the simplest way to create hello world iPhone tutorial. Para probar el codigo sobre un dispositivo  (iPhone) necesitaras comprar una licencia de desarrollador la cual tiene un costo de 99$ para ti y de 299$ para una empresa.</p>
<p><strong><br />
Iniciando el Desarrollo con Iphone:</strong></p>
<p>Lo primero que necesitaras es conocer c-objetive &#8230;  te recomiendo bajarte algunos libros de rapidlibrary.<br />
O tambien podrias leer &#8220;getting started with iPhone&#8221;, este tutorial cubre las cosas que tu requieres saber antes de iniciar el desarrollo para iPhone( Tambien puedes mirar el video tutorial de &#8220;Getting Started with iPhone&#8221; ). </p>
<p><strong>La Idea de este tutorial</strong><br />
Ya existen muchos tutorial sobre Hellos Wolrd in Iphone pero se me antojo escribir uno muy muy basico sobre el iPhone sdk el cual cubre xcode, y interface builder.</p>
<p><strong>Simples pasos creae aplicacion hello world iPhone</strong></p>
<p><em>Paso 1</em>:Abre el  Xcode y da click sobre File > New Project. Select &#8220;View-Based Application&#8221; y da click sobre &#8220;Choose..&#8221; button. El nombre de este proyecto sera  &#8220;Hello World&#8221; y da click sobre el boton &#8220;Save&#8221;. Ahora ya tienes una plantillapara tu proyecto iphone hello world.</p>
<p><em>Step 2</em>:Ahora pulsa el botton Build and Go para corre esta aplicacion plantilla. Esto iniciara el simulador iPhone y podras ver una pantalla gris en este. Da click sobre el boton Home button and este te mostrara HelloWorld icon sobre el dash board del iPhone simulator. </p>
<p><a href='http://gulsin.org/wp-content/uploads/2010/06/screen-shot-2010-06-28-at-24437-pm.png' title='P1'><img src='http://gulsin.org/wp-content/uploads/2010/06/screen-shot-2010-06-28-at-24437-pm.thumbnail.png' alt='P1' /></a><br />
Salida de nuestra primera aplicacion iphone</p>
<p><em>Paso 3</em>:Ahora abre tu  Xcode project y selecciona el archivo HelloWorldViewController.h y escribe el siguiente codigo:</p>
<pre>
IBOutlet UITextField *txtUserName;
IBOutlet UILabel *lblUserTypedName;
Also write this method before end of this class
- (IBAction) submitYourName;?
</pre>
<p><em>Paso 4</em>:Entonces tu archivo HelloWorldViewController.h lucira como esto:</p>
<pre>
#import <UIKit/UIKit.h>

@interface HelloWorldViewController : UIViewController {
IBOutlet UITextField *txtUserName;
IBOutlet UILabel *lblUserTypedName;
}

- (IBAction) submitYourName;
@end
</pre>
<p><em>Paso 5</em>:Ahora abriremos el archivo HelloWorldViewController.m y escribiremos este metodo antes de @end?</p>
<pre>
- (IBAction) submitYourName;
{lblUserTypedName.text = txtUserName.text;}
</pre>
<p><em>Paso 6</em>:Ahora iniciermos con algo de diseño sobre el (constructor de interfaces) interface builder. Ejecuta un doble click sobre el archivo MainWindow.xib el cual es la principal ventana o punto de entrada hacia tu aplicacion.</p>
<p><a href='http://gulsin.org/wp-content/uploads/2010/06/picture-28.png' title='p02'><img src='http://gulsin.org/wp-content/uploads/2010/06/picture-28.thumbnail.png' alt='p02' /></a><br />
Estructura de tu aplicacion iphone</p>
<p><a href='http://gulsin.org/wp-content/uploads/2010/06/picture-8.png' title='picture-8.png'><img src='http://gulsin.org/wp-content/uploads/2010/06/picture-8.thumbnail.png' alt='picture-8.png' /></a><br />
Interface builder apariencia</p>
<p><em>Paso 7</em>:Clickea sobre Herramientas y selecctiona Library (cmd + shift + L) y arrastra el campo de texto a tu vista. Como el campo de texto esta ya seleccionado, clickea sobre Tools>Inspector (cmd + 1) y en el campo de Texto teclea &#8220;Tu nombre&#8221;.</p>
<p><a href='http://gulsin.org/wp-content/uploads/2010/06/picture-9.png' title='picture-9.png'><img src='http://gulsin.org/wp-content/uploads/2010/06/picture-9.thumbnail.png' alt='picture-9.png' /></a><br />
Agrega etiqueta a tu primer aplicacion iPhone</p>
<p><a href='http://gulsin.org/wp-content/uploads/2010/06/picture-10.png' title='picture-10.png'><img src='http://gulsin.org/wp-content/uploads/2010/06/picture-10.thumbnail.png' alt='picture-10.png' /></a><br />
Cambiando texto en tu UILabel</p>
<p><em>Paso 8</em>:Ahora arrastra el componente TextField de tu Library hacia tu vista (cmd+shift+L)  y tambien arrastra otra  Label dentro de la vista.<br />
<a href='http://gulsin.org/wp-content/uploads/2010/06/screen-shot-2010-06-28-at-31351-pm.png' title='screen-shot-2010-06-28-at-31351-pm.png'><img src='http://gulsin.org/wp-content/uploads/2010/06/screen-shot-2010-06-28-at-31351-pm.thumbnail.png' alt='screen-shot-2010-06-28-at-31351-pm.png' /></a><br />
Agregando un componente  Text field a tu primera aplicacion iPhone</p>
<p><a href='http://gulsin.org/wp-content/uploads/2010/06/picture-12.png' title='picture-12.png'><img src='http://gulsin.org/wp-content/uploads/2010/06/picture-12.thumbnail.png' alt='picture-12.png' /></a><br />
Agregando otra Label a tu primera aplicacion iPhone</p>
<p><em>Paso 9</em>:Lo ultimo por hacer es arrastrar un boton hacia la vista y entonces abrir el Inspector de nuevo mediante el menu superior selecting tools>Inspector. En Title teclee &#8220;Submit&#8221;.<br />
<a href='http://gulsin.org/wp-content/uploads/2010/06/picture-19.png' title='picture-19.png'><img src='http://gulsin.org/wp-content/uploads/2010/06/picture-19.thumbnail.png' alt='picture-19.png' /></a></p>
<p><em>Paso 10</em>:Ahora mapea la variable controller clase funcion y metodos con el interface builder. Seleccione File’s Owner en Interface builder y seleccione inspector de coneccion desde Tools cmd + 2</p>
<p><a href='http://gulsin.org/wp-content/uploads/2010/06/picture-13.png' title='picture-13.png'><img src='http://gulsin.org/wp-content/uploads/2010/06/picture-13.thumbnail.png' alt='picture-13.png' /></a><br />
Mapea tu controller con el Interface Builder</p>
<p><em>Paso 11</em>:Ahora tu puedes ver 2 nuevas variables son agregadas in el connection inspector txtUserName y lblUserTypedName. Clickea sobre txtUserName radio button y arrastra este a el text field en la vista (como tu puedes ver en la imagen)<br />
<a href='http://gulsin.org/wp-content/uploads/2010/06/picture-14.png' title='picture-14.png'><img src='http://gulsin.org/wp-content/uploads/2010/06/picture-14.thumbnail.png' alt='picture-14.png' /></a><br />
Mapea tu text field con Interface builder</p>
<p><em>Paso 12</em>:Haz lo mismo con el lblUserTypedName, selecciona su radio y arrastra es hacia abajo de la label.<br />
<a href='http://gulsin.org/wp-content/uploads/2010/06/picture-15.png' title='picture-15.png'><img src='http://gulsin.org/wp-content/uploads/2010/06/picture-15.thumbnail.png' alt='picture-15.png' /></a><br />
Mapea tu label field con Interface builder</p>
<p><em> Paso 13</em>:Ahora el ultimo paso es, click sobre submitYourName radio y arrastra este a el botton y selecciona touch down de la lista.<br />
<a href='http://gulsin.org/wp-content/uploads/2010/06/picture-21.png' title='picture-21.png'><img src='http://gulsin.org/wp-content/uploads/2010/06/picture-21.thumbnail.png' alt='picture-21.png' /></a><br />
Mapea tu button con Interface builder</p>
<p><a href='http://gulsin.org/wp-content/uploads/2010/06/picture-23.png' title='picture-23.png'><img src='http://gulsin.org/wp-content/uploads/2010/06/picture-23.thumbnail.png' alt='picture-23.png' /></a><br />
Establecer tipo de accion al boton</p>
<p><em>Paso 14</em>:Ahora cierra la interface y abre xcode. And press &#8220;build and go&#8221;.</p>
<p><strong>Salida final</strong></p>
<p><a href='http://gulsin.org/wp-content/uploads/2010/06/picture-25.png' title='picture-25.png'><img src='http://gulsin.org/wp-content/uploads/2010/06/picture-25.thumbnail.png' alt='picture-25.png' /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://gulsin.org/2010/06/28/tutorial-hello-worl-para-principiantes-de-desarrollo-iphone/feed/</wfw:commentRss>
		</item>
		<item>
		<title>We are the world Japones</title>
		<link>http://gulsin.org/2010/05/02/we-are-the-world-japones/</link>
		<comments>http://gulsin.org/2010/05/02/we-are-the-world-japones/#comments</comments>
		<pubDate>Mon, 03 May 2010 01:03:13 +0000</pubDate>
		<dc:creator>Edwin Plauchu</dc:creator>
		
		<category><![CDATA[Varios]]></category>

		<guid isPermaLink="false">http://gulsin.org/2010/05/02/we-are-the-world-japones/</guid>
		<description><![CDATA[

We are the world - Imitacion en television Japonesa
]]></description>
			<content:encoded><![CDATA[<p><object type="application/x-shockwave-flash" data="http://zappinternet.com/v/JiSrBafMap" height="331" width="400">
<param name="movie" value="http://zappinternet.com/v/JiSrBafMap" />
<param name="allowFullScreen" value="true" /></object><br /><a href="http://www.zappinternet.com/video/JiSrBafMap/We-are-the-world-Imitacion-en-television-Japonesa">We are the world - Imitacion en television Japonesa</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gulsin.org/2010/05/02/we-are-the-world-japones/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Lista en twitter para los maestros de unix-masters</title>
		<link>http://gulsin.org/2010/05/02/unix-masters/</link>
		<comments>http://gulsin.org/2010/05/02/unix-masters/#comments</comments>
		<pubDate>Sun, 02 May 2010 06:18:57 +0000</pubDate>
		<dc:creator>Edwin Plauchu</dc:creator>
		
		<category><![CDATA[Varios]]></category>

		<guid isPermaLink="false">http://gulsin.org/2010/05/02/unix-masters/</guid>
		<description><![CDATA[http://twitter.com/pianodaemon/unix-masters
]]></description>
			<content:encoded><![CDATA[<p>http://twitter.com/pianodaemon/unix-masters</p>
]]></content:encoded>
			<wfw:commentRss>http://gulsin.org/2010/05/02/unix-masters/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Lista en twitter para los maestros de jquery &#8212; Jquery Master&#8217;s list on twitter</title>
		<link>http://gulsin.org/2010/05/01/lista-en-twitter-para-los-maestros-de-jquery-jquery-masters-list-on-twitter/</link>
		<comments>http://gulsin.org/2010/05/01/lista-en-twitter-para-los-maestros-de-jquery-jquery-masters-list-on-twitter/#comments</comments>
		<pubDate>Sat, 01 May 2010 19:03:21 +0000</pubDate>
		<dc:creator>Edwin Plauchu</dc:creator>
		
		<category><![CDATA[Programacion]]></category>

		<guid isPermaLink="false">http://gulsin.org/2010/05/01/lista-en-twitter-para-los-maestros-de-jquery-jquery-masters-list-on-twitter/</guid>
		<description><![CDATA[http://twitter.com/pianodaemon/jquery-masters
]]></description>
			<content:encoded><![CDATA[<p>http://twitter.com/pianodaemon/jquery-masters</p>
]]></content:encoded>
			<wfw:commentRss>http://gulsin.org/2010/05/01/lista-en-twitter-para-los-maestros-de-jquery-jquery-masters-list-on-twitter/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Helio + Chicle (Do not repeat it yourself!)</title>
		<link>http://gulsin.org/2010/04/28/helio-chicle-do-not-repeat-it-yourself/</link>
		<comments>http://gulsin.org/2010/04/28/helio-chicle-do-not-repeat-it-yourself/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 18:18:26 +0000</pubDate>
		<dc:creator>Edwin Plauchu</dc:creator>
		
		<category><![CDATA[Varios]]></category>

		<guid isPermaLink="false">http://gulsin.org/2010/04/28/helio-chicle-do-not-repeat-it-yourself/</guid>
		<description><![CDATA[



]]></description>
			<content:encoded><![CDATA[<p><object width="480" height="385">
<param name="movie" value="http://www.youtube.com/v/28XI7F8XmvI&#038;hl=en_US&#038;fs=1&#038;"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/28XI7F8XmvI&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://gulsin.org/2010/04/28/helio-chicle-do-not-repeat-it-yourself/feed/</wfw:commentRss>
		</item>
		<item>
		<title>TwwetDeck fabuloso cliente para tweeter</title>
		<link>http://gulsin.org/2010/04/26/twwetdeck-fabuloso-cliente-para-tweeter/</link>
		<comments>http://gulsin.org/2010/04/26/twwetdeck-fabuloso-cliente-para-tweeter/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 03:49:51 +0000</pubDate>
		<dc:creator>Edwin Plauchu</dc:creator>
		
		<category><![CDATA[Varios]]></category>

		<guid isPermaLink="false">http://gulsin.org/2010/04/26/twwetdeck-fabuloso-cliente-para-tweeter/</guid>
		<description><![CDATA[http://www.tweetdeck.com/desktop/
@pianodaemon
Este es mi usuario de tweeter ahi los veo
]]></description>
			<content:encoded><![CDATA[<p>http://www.tweetdeck.com/desktop/</p>
<p>@pianodaemon</p>
<p>Este es mi usuario de tweeter ahi los veo</p>
]]></content:encoded>
			<wfw:commentRss>http://gulsin.org/2010/04/26/twwetdeck-fabuloso-cliente-para-tweeter/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Como validar la estructura de un Comprobante fiscal Digital usando el esquema cfv2.xsd</title>
		<link>http://gulsin.org/2010/04/23/como-validar-la-estructura-de-un-comprobante-fiscal-digital-usando-el-esquema-cfv2xsd/</link>
		<comments>http://gulsin.org/2010/04/23/como-validar-la-estructura-de-un-comprobante-fiscal-digital-usando-el-esquema-cfv2xsd/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 21:05:17 +0000</pubDate>
		<dc:creator>Edwin Plauchu</dc:creator>
		
		<category><![CDATA[Programacion]]></category>

		<guid isPermaLink="false">http://gulsin.org/2010/04/23/como-validar-la-estructura-de-un-comprobante-fiscal-digital-usando-el-esquema-cfv2xsd/</guid>
		<description><![CDATA[De las pocas cosas que me gustan de java&#8230; esta su parser SAX&#8230;..que tambien valida esquemas&#8230;. 


import javax.xml.parsers.DocumentBuilderFactory;
import java.io.File;
import javax.xml.parsers.DocumentBuilder;
import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.w3c.dom.Document;

public class ValidateXmlWithSchema{

	public boolean validate(String file_path){

		boolean valor_retono = true;

		final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
	    final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
		final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
		final String MY_SCHEMA = new OsVars().getSchemaDir() + "cfdv2.xsd";
		final [...]]]></description>
			<content:encoded><![CDATA[<p>De las pocas cosas que me gustan de java&#8230; esta su parser SAX&#8230;..que tambien valida esquemas&#8230;. </p>
<pre>

import javax.xml.parsers.DocumentBuilderFactory;
import java.io.File;
import javax.xml.parsers.DocumentBuilder;
import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.w3c.dom.Document;

public class ValidateXmlWithSchema{

	public boolean validate(String file_path){

		boolean valor_retono = true;

		final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
	    final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
		final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
		final String MY_SCHEMA = new OsVars().getSchemaDir() + "cfdv2.xsd";
		final String MY_XML= file_path;

		// Creando la factoria e indicando que hay validacion
		DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
		documentBuilderFactory.setNamespaceAware(true);
		documentBuilderFactory.setValidating(true);

		try {

			//Configurando el Schema de validacion
			documentBuilderFactory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
			documentBuilderFactory.setAttribute(JAXP_SCHEMA_SOURCE, new File(MY_SCHEMA));
			// Parseando el documento
			DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
			documentBuilder.setErrorHandler(new ParserErrorHandler());

			@SuppressWarnings("unused")
			Document parse = documentBuilder.parse(new File(MY_XML));

		} catch (SAXException saxEx){
			valor_retono =  false;
			System.out.println(saxEx.toString());
		} catch (Exception ex) {
			valor_retono =  false;
			System.out.println(ex.toString());
		}

		return valor_retono;
	}

	private class ParserErrorHandler extends DefaultHandler {

		@Override
		public void warning(SAXParseException e) throws SAXException {
			System.out.println("Warning: ");
			printInfo(e);
		}

		@Override
		public void error(SAXParseException e) throws SAXException {
			System.out.println("Error: ");
			printInfo(e);
		}

		@Override
		public void fatalError(SAXParseException e) throws SAXException {
			System.out.println("Error Fatal: ");
			printInfo(e);
		}
		private void printInfo(SAXParseException e) {
			System.out.println("   Publico ID: "+e.getPublicId());
			System.out.println("   Sistema ID: "+e.getSystemId());
			System.out.println("   Linea numero: "+e.getLineNumber());
			System.out.println("   Columna number: "+e.getColumnNumber());
			System.out.println("   Mensaje: "+e.getMessage());
		}
	}

}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://gulsin.org/2010/04/23/como-validar-la-estructura-de-un-comprobante-fiscal-digital-usando-el-esquema-cfv2xsd/feed/</wfw:commentRss>
		</item>
		<item>
		<title>De JSON a java</title>
		<link>http://gulsin.org/2010/04/23/de-json-a-java/</link>
		<comments>http://gulsin.org/2010/04/23/de-json-a-java/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 21:01:06 +0000</pubDate>
		<dc:creator>Edwin Plauchu</dc:creator>
		
		<category><![CDATA[Programacion]]></category>

		<guid isPermaLink="false">http://gulsin.org/2010/04/23/de-json-a-java/</guid>
		<description><![CDATA[Para vivir tengo que escribir kilometros y kilometros de codigo en este mugre lenguaje (oseace java)&#8230;.
Para que ustedes no pasen por lo mismo&#8230; ahi les dejo algo hecho para pasar de JSON a java


import java.util.List;
import java.util.ArrayList;

import java.util.Map;
import java.util.Iterator;

import net.sf.json.JSONObject;
import net.sf.json.JSONArray;
import java.util.HashMap;

public class Json2Java {

	/**
	* getList provides a List representation of the JSON Object
	* @param jsonResponse [...]]]></description>
			<content:encoded><![CDATA[<p>Para vivir tengo que escribir kilometros y kilometros de codigo en este mugre lenguaje (oseace java)&#8230;.<br />
Para que ustedes no pasen por lo mismo&#8230; ahi les dejo algo hecho para pasar de JSON a java</p>
<pre>

import java.util.List;
import java.util.ArrayList;

import java.util.Map;
import java.util.Iterator;

import net.sf.json.JSONObject;
import net.sf.json.JSONArray;
import java.util.HashMap;

public class Json2Java {

	/**
	* getList provides a List representation of the JSON Object
	* @param jsonResponse The JSON array string
	* @return List of JSONObject.
	**/
	public List<Object> getList(String jsonResponse) throws Exception {
	  List<Object> listResponse = new ArrayList<Object>();
	  if (jsonResponse.startsWith(&#8221;[&#8221;)) {
	    JSONArray jsonArray = JSONArray.fromObject(jsonResponse);
	    toJavaList(jsonArray, listResponse);
	  } else {
	    throw new Exception(&#8221;MalFormed JSON Array Response.&#8221;);
	  }

	  return listResponse;
	}

	/**
	* getMap provides a Map representation of the JSON Object
	* @param jsonResponse The JSON object string
	* @return Map of JSONObject.
	**/
	public Map<String, Object> getMap(String jsonResponse ) throws Exception {
	  Map<String, Object> mapResponse = new HashMap<String, Object>();
	  if (jsonResponse.startsWith(&#8221;{&#8221;)) {
	    JSONObject jsonObj = JSONObject.fromObject(jsonResponse);
	    toJavaMap(jsonObj, mapResponse);
	  } else {
	    throw new Exception(&#8221;MalFormed JSON Array Response.&#8221;);
	  }
	  return mapResponse;
	}

	/**
	* toJavaMap converts the JSONObject into a Java Map
	* @param o
	* JSONObject to be converted to Java Map
	* @param b
	* Java Map to hold converted JSONObject response.
	**/
	@SuppressWarnings(&#8221;unchecked&#8221;)
	private static void toJavaMap(JSONObject o, Map<String, Object> b) {
	  Iterator ji = o.keys();
	  while (ji.hasNext()) {
	    String key = (String) ji.next();
	    Object val = o.get(key);
	    if (val.getClass() == JSONObject.class) {
	      Map<String, Object> sub = new HashMap<String, Object>();
	      toJavaMap((JSONObject) val, sub);
	      b.put(key, sub);
	    } else if (val.getClass() == JSONArray.class) {
	      List<Object> l = new ArrayList<Object>();
	      JSONArray arr = (JSONArray) val;
	      for (int a = 0; a < arr.size(); a++) {
	        Map<String, Object> sub = new HashMap<String, Object>();
	        Object element = arr.get(a);
	        if (element instanceof JSONObject) {
	          toJavaMap((JSONObject) element, sub);
	          l.add(sub);
	        } else {
	          l.add(element);
	        }
	      }
	      b.put(key, l);
	    } else {
	      b.put(key, val);
	    }
	  }
	}

	/**
	* toJavaList converts JSON&#8217;s array response into Java&#8217;s List
	* @param ar
	* JSONArray to be converted to Java List
	* @param ll
	* Java List to hold the converted JSONArray response
	**/
	private static void toJavaList(JSONArray ar, List<Object> ll) {
	  int i = 0;
	  while (i < ar.size()) {
	    Object val = ar.get(i);
	    if (val.getClass() == JSONObject.class) {
	      Map<String, Object> sub = new HashMap<String, Object>();
	      toJavaMap((JSONObject) val, sub);
	      ll.add(sub);
	    } else if (val.getClass() == JSONArray.class) {
	      List<Object> l = new ArrayList<Object>();
	      JSONArray arr = (JSONArray) val;
	      for (int a = 0; a < arr.size(); a++) {
	        Map<String, Object> sub = new HashMap<String, Object>();
	        Object element = arr.get(a);
	        if (element instanceof JSONObject) {
	          toJavaMap((JSONObject) element, sub);
	          ll.add(sub);
	        } else {
	          ll.add(element);
	        }
	      }
	      l.add(l);
	    } else {
	      ll.add(val);
	    }
	    i++;
	  }
	}

}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://gulsin.org/2010/04/23/de-json-a-java/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
