<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
>
	<channel>
		<title>Dudas de Programacion &#187; Tag: XML - Recent Posts</title>
		<link>http://www.dudasprogramacion.com/tags/xml</link>
		<description>Dudas sobre lenguajes y apis de programación</description>
		<language>en-US</language>
		<pubDate>Tue, 07 Feb 2012 20:50:31 +0000</pubDate>
		<generator>bbpress 1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.dudasprogramacion.com/search.php</link>
		</textInput>
		<atom:link href="http://www.dudasprogramacion.com/rss/tags/xml" rel="self" type="application/rss+xml" />

		<item>
			<title>Torres on "Duda parseo XML"</title>
			<link>http://www.dudasprogramacion.com/topic/duda-parseo-xml#post-793</link>
			<pubDate>Wed, 24 Nov 2010 11:53:11 +0000</pubDate>
			<dc:creator>Torres</dc:creator>
			<guid isPermaLink="false">793@http://www.dudasprogramacion.com/</guid>
			<description><p>De nada y me alegro,</p>
<p>Un saludo
</p></description>
		</item>
		<item>
			<title>cascabel on "Duda parseo XML"</title>
			<link>http://www.dudasprogramacion.com/topic/duda-parseo-xml#post-792</link>
			<pubDate>Wed, 24 Nov 2010 11:40:54 +0000</pubDate>
			<dc:creator>cascabel</dc:creator>
			<guid isPermaLink="false">792@http://www.dudasprogramacion.com/</guid>
			<description><p>Buenas</p>
<p>Muchas gracias por responder...SI ayer a base de darle vueltas lo consegui. Y ahora cuando iba a postear ya vi que me habias respondido. Efectivamente gracias al metodo characters se solventa el problema.</p>
<p>Muchas gracias
</p></description>
		</item>
		<item>
			<title>Torres on "Duda parseo XML"</title>
			<link>http://www.dudasprogramacion.com/topic/duda-parseo-xml#post-791</link>
			<pubDate>Wed, 24 Nov 2010 09:45:56 +0000</pubDate>
			<dc:creator>Torres</dc:creator>
			<guid isPermaLink="false">791@http://www.dudasprogramacion.com/</guid>
			<description><p>Buenas, </p>
<p>como te decía el problema está en que no tienes implementado el método characters, que es el que se encarga de leer el contenido de cada elemento.</p>
<p>SAX es mas eficiente que JDOM o que otras maneras de leer xml, porque no genera el arbol del xml en memoria si no que funciona por eventos. El startElement cuando comienza un elemento, el endElement cuando termina, etc.</p>
<p>En este caso te hace falta leer desde el characters hasta encontrar los números de las ventas en cada mes. No me gusta mandar código completo, pero con esto que te dejo aquí se almacena en el vector de Empleados, cada Empleado con sus ventas mensuales.</p>
<pre class="java" style="font-family:monospace;">&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Vector</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.xml.sax.Attributes</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.xml.sax.SAXException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.xml.sax.helpers.DefaultHandler</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> LectorXMLVentas <span style="color: #000000; font-weight: bold;">extends</span> DefaultHandler <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> Vector<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>Empleado<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">62</span><span style="color: #339933;">;</span> empleadosVentas<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> Empleado emp<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> Vector<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>Integer<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">62</span><span style="color: #339933;">;</span> ventas<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Método que crea el lector con un XMLReaderFactory
	 *
	 * @throws SAXException
	 */</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> LectorXMLVentas<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SAXException <span style="color: #009900;">&#123;</span>
		empleadosVentas <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
		emp <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
		ventas <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Método que determina que hay que hacer al comienzo del procesado del
	 * documento xml
	 *
	 */</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> startDocument<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SAXException <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Método que determina que hay hacer al terminar de leer una etiqueta
	 *
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> endDocument<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SAXException <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Metodo que se encarga de tratar cada elemento en el inicio de la lectura
	 * del mismo en el archivo XML.
	 */</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> startElement<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> namespace, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> sName, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> qName,
			<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aattributes+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Attributes</span></a> atrs<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SAXException <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>qName.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ventas&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #666666; font-style: italic;">// si es la linea de ventas creamos el</span>
			<span style="color: #666666; font-style: italic;">// vector</span>
			empleadosVentas <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Vector<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>Empleado<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">62</span><span style="color: #339933;">;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>qName.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;EJ_2010&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// no tenemos que hacer nada</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>qName.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;volumen&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #666666; font-style: italic;">// si es volumen aqui empieza un</span>
			<span style="color: #666666; font-style: italic;">// //nuevo empleado</span>
			<span style="color: #666666; font-style: italic;">// y creamos el vector para ir metiendo sus ventas de //cada mes</span>
			<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> codE <span style="color: #339933;">=</span> atrs.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;cod&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			emp <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Empleado<span style="color: #009900;">&#40;</span>codE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			ventas <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Vector<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>Integer<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">62</span><span style="color: #339933;">;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">// cuando terminemos de //leer</span>
			<span style="color: #666666; font-style: italic;">// este elemento volcaremos este vector al //empleado</span>
		<span style="color: #009900;">&#125;</span><span style="color: #666666; font-style: italic;">// else</span>
		<span style="color: #666666; font-style: italic;">// sino estamos leyendo valores de ventas de meses, en este caso</span>
		<span style="color: #666666; font-style: italic;">// //segun sea un mes u otro</span>
		<span style="color: #666666; font-style: italic;">// almacenaVentas(atrs);</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> characters<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">char</span> ch<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span>, <span style="color: #000066; font-weight: bold;">int</span> start, <span style="color: #000066; font-weight: bold;">int</span> length<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> num <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
		num <span style="color: #339933;">=</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span>ch, start, length<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
			<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a> ventaMensual <span style="color: #339933;">=</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>num<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			ventas.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>ventaMensual<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Anumberformatexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">NumberFormatException</span></a> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Metodo que se encarga guardar la informacion necesaria al finalizar la
	 * lectura de cada elemento del archivo XML.
	 */</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> endElement<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> namespace, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> sName, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> qName<span style="color: #009900;">&#41;</span>
			<span style="color: #000000; font-weight: bold;">throws</span> SAXException <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;volumen&quot;</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>sName<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			emp.<span style="color: #006633;">fijaVentas</span><span style="color: #009900;">&#40;</span>ventas<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">// le fijamos las ventas ya insertadas</span>
			empleadosVentas.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>emp<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">// lo añadimos al vector</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Método que devuelve el vector de empleados con los datos de las ventas
	 * cargados
	 *
	 * @return vector de empleados
	 *
	 */</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> Vector<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>Empleado<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">62</span><span style="color: #339933;">;</span> dameEmpleadosCargaVentas<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> empleadosVentas<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;</pre>
<p>Espero que te sirva,</p>
<p>Un saludo
</p></description>
		</item>
		<item>
			<title>cascabel on "Duda parseo XML"</title>
			<link>http://www.dudasprogramacion.com/topic/duda-parseo-xml#post-790</link>
			<pubDate>Tue, 23 Nov 2010 18:05:04 +0000</pubDate>
			<dc:creator>cascabel</dc:creator>
			<guid isPermaLink="false">790@http://www.dudasprogramacion.com/</guid>
			<description><p>Puedo poner el codigo completo pero pienso que no te servirá de ayuda. Lo del getValue es cierto para una linea como la primera de las que puse.</p>
<p> Ahora bien para una línea de estilo a la segunda no sirve debido que no se puede hacer el getValue del qName. </p>
<p>No obstante te pongo el codigo:</p>
<pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> LectorXMLVentas <span style="color: #000000; font-weight: bold;">extends</span> DefaultHandler<span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> Vector<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>Empleado<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">62</span><span style="color: #339933;">;</span> empleadosVentas<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> Empleado emp<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> Vector<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>Integer<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">62</span><span style="color: #339933;">;</span> ventas<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Método que crea el lector con un XMLReaderFactory
	 *
	 * @throws SAXException
	 */</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> LectorXMLVentas<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SAXException <span style="color: #009900;">&#123;</span>
		empleadosVentas<span style="color: #339933;">=</span><span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
		emp<span style="color: #339933;">=</span><span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
		ventas<span style="color: #339933;">=</span><span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Método que determina que hay que hacer al comienzo del procesado del documento xml
	 *
	 */</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> startDocument<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SAXException <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Método que determina que hay hacer al terminar de leer una etiqueta
	 *
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> endDocument<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SAXException <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Metodo que se encarga de tratar cada elemento en el inicio de la lectura del mismo en el
	 * archivo XML.
	 */</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> startElement<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> namespace, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> sName, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> qName, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aattributes+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Attributes</span></a> atrs<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SAXException <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>qName.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ventas&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #666666; font-style: italic;">//si es la linea de ventas creamos el vector</span>
			 empleadosVentas <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Vector<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>Empleado<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">62</span><span style="color: #339933;">;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>qName.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;EJ_2010&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #666666; font-style: italic;">//no tenemos que hacer nada</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>qName.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;volumen&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #666666; font-style: italic;">//si es volumen aqui empieza un //nuevo empleado</span>
				<span style="color: #666666; font-style: italic;">//y creamos el vector para ir metiendo sus ventas de //cada mes</span>
				<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> codE <span style="color: #339933;">=</span> atrs.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;cod&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				emp <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Empleado<span style="color: #009900;">&#40;</span>codE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				ventas <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Vector<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>Integer<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">62</span><span style="color: #339933;">;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//cuando terminemos de //leer</span>
					<span style="color: #666666; font-style: italic;">//este elemento volcaremos este vector al //empleado</span>
				<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #666666; font-style: italic;">//sino estamos leyendo valores de ventas de meses, en este caso //segun sea un mes u otro</span>
			almacenaVentas<span style="color: #009900;">&#40;</span>atrs<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Método privado que se encarga de almacenar las ventas de los distintos meses
	 *
	 * @param atrs atributos del XML
	 *
	 */</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> almacenaVentas<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aattributes+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Attributes</span></a> atrs<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">//ocgemos el valor del mes, lo convertimos a entero y lo almacenamos en el vector de ventas</span>
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> valorEne <span style="color: #339933;">=</span> atrs.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;enero&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> venEne <span style="color: #339933;">=</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>atrs.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;enero&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		ventas.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>venEne<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> venFeb <span style="color: #339933;">=</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>atrs.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;febrero&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		ventas.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>venFeb<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> venMar <span style="color: #339933;">=</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>atrs.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;marzo&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		ventas.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>venMar<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> venAbr <span style="color: #339933;">=</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>atrs.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;abril&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		ventas.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>venAbr<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> venMay <span style="color: #339933;">=</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>atrs.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;mayo&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		ventas.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>venMay<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> venJun <span style="color: #339933;">=</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>atrs.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;junio&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		ventas.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>venJun<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> venJul <span style="color: #339933;">=</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>atrs.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;julio&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		ventas.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>venJul<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> venAgo <span style="color: #339933;">=</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>atrs.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;agosto&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		ventas.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>venAgo<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> venSep <span style="color: #339933;">=</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>atrs.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;septiembre&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		ventas.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>venSep<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> venOct <span style="color: #339933;">=</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>atrs.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;octubre&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		ventas.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>venOct<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> venNov <span style="color: #339933;">=</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>atrs.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;noviembre&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		ventas.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>venNov<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> venDic <span style="color: #339933;">=</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>atrs.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;diciembre&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		ventas.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>venDic<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		emp.<span style="color: #006633;">fijaVentas</span><span style="color: #009900;">&#40;</span>ventas<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//le fijamos las ventas ya insertadas</span>
		empleadosVentas.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>emp<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//lo añadimos al vector</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Metodo que se encarga guardar la informacion necesaria al finalizar la lectura de cada elemento del
	 * archivo XML.
	 */</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> endElement<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> namespace, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> sName, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> qName<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SAXException<span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Método que devuelve el vector de empleados con los datos de las ventas cargados
	 *
	 * @return vector de empleados
	 *
	 */</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> Vector<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>Empleado<span style="color: #339933;">&amp;</span>#<span style="color: #cc66cc;">62</span><span style="color: #339933;">;</span> dameEmpleadosCargaVentas<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> empleadosVentas<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre>
<p>Todo el proceso funciona perfectamente hasta que llegar al metodo almacenaVentas y claro como ya comente las lineas no son iguales y es ahí donde casca(porque probe a solo devolver el vector con los codigos de los empleados y los saca todos bien...lo que si soy capaz de leer). A ver si ahora me explique un poco mejor y alguien da con la solucion.</p>
<p>Muchas gracias de antemano y gracias por responder.</p>
<p>Un saludo.
</p></description>
		</item>
		<item>
			<title>Torres on "Duda parseo XML"</title>
			<link>http://www.dudasprogramacion.com/topic/duda-parseo-xml#post-789</link>
			<pubDate>Tue, 23 Nov 2010 17:43:20 +0000</pubDate>
			<dc:creator>Torres</dc:creator>
			<guid isPermaLink="false">789@http://www.dudasprogramacion.com/</guid>
			<description><p>Creo que es esto...</p>
<p><a href="http://download.oracle.com/javase/1.4.2/docs/api/org/xml/sax/helpers/DefaultHandler.html#characters%28char,%20int,%20int%29" rel="nofollow">http://download.oracle.com/javase/1.4.2/docs/api/org/xml/sax/helpers/DefaultHandler.html#characters%28char,%20int,%20int%29</a></p>
<p>Aquí tienes un tutorial con un ejemplo:</p>
<p><a href="http://www.saxproject.org/quickstart.html" rel="nofollow">http://www.saxproject.org/quickstart.html</a>
</p></description>
		</item>
		<item>
			<title>Torres on "Duda parseo XML"</title>
			<link>http://www.dudasprogramacion.com/topic/duda-parseo-xml#post-788</link>
			<pubDate>Tue, 23 Nov 2010 16:56:11 +0000</pubDate>
			<dc:creator>Torres</dc:creator>
			<guid isPermaLink="false">788@http://www.dudasprogramacion.com/</guid>
			<description><p>Si pones el código completo puede ser de ayuda, pero básicamente algo representará al elemento en cuestión y tendrá un getValue().</p>
<p>Algo por el estilo nodo.getValue()...
</p></description>
		</item>
		<item>
			<title>cascabel on "Duda parseo XML"</title>
			<link>http://www.dudasprogramacion.com/topic/duda-parseo-xml#post-786</link>
			<pubDate>Tue, 23 Nov 2010 16:22:29 +0000</pubDate>
			<dc:creator>cascabel</dc:creator>
			<guid isPermaLink="false">786@http://www.dudasprogramacion.com/</guid>
			<description><p>Ya lo solvente.</p>
<p>Ahora lo que me trae un poco de cabeza es que no soy capaz de leer los datos de cada uno de los meses...</p>
<p>Si tienes que leer una linea de este estilo: &#60;volumen cod="M0976"&#62; con algo de este estilo lo puedes conseguir:</p>
<pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> startElement<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> namespace, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> sName, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> qName, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aattributes+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Attributes</span></a> atrs<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SAXException <span style="color: #009900;">&#123;</span>
...
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>qName.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;volumen&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> codE <span style="color: #339933;">=</span> atrs.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;cod&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
...
<span style="color: #009900;">&#125;</span></pre>
<p>pero la linea es asi: &#60;enero&#62;32&#60;/enero&#62;<br />
y si intento hacer algo del tipo:</p>
<pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> startElement<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> namespace, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> sName, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> qName, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aattributes+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Attributes</span></a> atrs<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SAXException <span style="color: #009900;">&#123;</span>
...
<span style="color: #000066; font-weight: bold;">int</span> venEne <span style="color: #339933;">=</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>atrs.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;enero&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
...
<span style="color: #009900;">&#125;</span></pre>
<p>No consigo nada...porque no esta "dentro" de la etiqueta...</p>
<p>A ver si alguien me echa un cable...</p>
<p>Muchas gracias a todos.</p>
<p>Un saludo
</p></description>
		</item>
		<item>
			<title>cascabel on "Duda parseo XML"</title>
			<link>http://www.dudasprogramacion.com/topic/duda-parseo-xml#post-785</link>
			<pubDate>Tue, 23 Nov 2010 13:59:51 +0000</pubDate>
			<dc:creator>cascabel</dc:creator>
			<guid isPermaLink="false">785@http://www.dudasprogramacion.com/</guid>
			<description><p>Tengo que utilizar el SAX por motivos de eficiencia...</p>
<p>Probablemente sea lo que tu dices...pero no se como hacerlo...
</p></description>
		</item>
		<item>
			<title>Torres on "Duda parseo XML"</title>
			<link>http://www.dudasprogramacion.com/topic/duda-parseo-xml#post-784</link>
			<pubDate>Tue, 23 Nov 2010 13:25:57 +0000</pubDate>
			<dc:creator>Torres</dc:creator>
			<guid isPermaLink="false">784@http://www.dudasprogramacion.com/</guid>
			<description><p>Buenas!</p>
<p>Partir la linea? tendrás que acceder a cod que un atributo no un elemento en si mismo.</p>
<p>Te recomiendo JDOM, es muy sencillo de usar</p>
<p><a href="http://www.jdom.org/docs/faq.html" rel="nofollow">http://www.jdom.org/docs/faq.html</a>
</p></description>
		</item>
		<item>
			<title>cascabel on "Duda parseo XML"</title>
			<link>http://www.dudasprogramacion.com/topic/duda-parseo-xml#post-783</link>
			<pubDate>Tue, 23 Nov 2010 13:19:14 +0000</pubDate>
			<dc:creator>cascabel</dc:creator>
			<guid isPermaLink="false">783@http://www.dudasprogramacion.com/</guid>
			<description><p>Buenas a todos!</p>
<p>Tengo un problemilla de cara a parsear un fichero XML.</p>
<p>La estructura del fichero es la siguiente:</p>
<pre class="xml" style="font-family:monospace;"><span style="color: #ddbb00;">&amp;#60;</span>?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>ventas<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>EJ_2010<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>volumen cod=&quot;M0976&quot;<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>enero<span style="color: #ddbb00;">&amp;#62;</span>32<span style="color: #ddbb00;">&amp;#60;</span>/enero<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>febrero<span style="color: #ddbb00;">&amp;#62;</span>23<span style="color: #ddbb00;">&amp;#60;</span>/febrero<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>marzo<span style="color: #ddbb00;">&amp;#62;</span>13<span style="color: #ddbb00;">&amp;#60;</span>/marzo<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>abril<span style="color: #ddbb00;">&amp;#62;</span>23<span style="color: #ddbb00;">&amp;#60;</span>/abril<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>mayo<span style="color: #ddbb00;">&amp;#62;</span>40<span style="color: #ddbb00;">&amp;#60;</span>/mayo<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>junio<span style="color: #ddbb00;">&amp;#62;</span>21<span style="color: #ddbb00;">&amp;#60;</span>/junio<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>julio<span style="color: #ddbb00;">&amp;#62;</span>18<span style="color: #ddbb00;">&amp;#60;</span>/julio<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>agosto<span style="color: #ddbb00;">&amp;#62;</span>15<span style="color: #ddbb00;">&amp;#60;</span>/agosto<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>septiembre<span style="color: #ddbb00;">&amp;#62;</span>21<span style="color: #ddbb00;">&amp;#60;</span>/septiembre<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>octubre<span style="color: #ddbb00;">&amp;#62;</span>34<span style="color: #ddbb00;">&amp;#60;</span>/octubre<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>noviembre<span style="color: #ddbb00;">&amp;#62;</span>56<span style="color: #ddbb00;">&amp;#60;</span>/noviembre<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>diciembre<span style="color: #ddbb00;">&amp;#62;</span>49<span style="color: #ddbb00;">&amp;#60;</span>/diciembre<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>/volumen<span style="color: #ddbb00;">&amp;#62;</span>
...
...
<span style="color: #ddbb00;">&amp;#60;</span>volumen cod=&quot;M1245&quot;<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>enero<span style="color: #ddbb00;">&amp;#62;</span>33<span style="color: #ddbb00;">&amp;#60;</span>/enero<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>febrero<span style="color: #ddbb00;">&amp;#62;</span>56<span style="color: #ddbb00;">&amp;#60;</span>/febrero<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>marzo<span style="color: #ddbb00;">&amp;#62;</span>59<span style="color: #ddbb00;">&amp;#60;</span>/marzo<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>abril<span style="color: #ddbb00;">&amp;#62;</span>46<span style="color: #ddbb00;">&amp;#60;</span>/abril<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>mayo<span style="color: #ddbb00;">&amp;#62;</span>54<span style="color: #ddbb00;">&amp;#60;</span>/mayo<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>junio<span style="color: #ddbb00;">&amp;#62;</span>43<span style="color: #ddbb00;">&amp;#60;</span>/junio<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>julio<span style="color: #ddbb00;">&amp;#62;</span>12<span style="color: #ddbb00;">&amp;#60;</span>/julio<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>agosto<span style="color: #ddbb00;">&amp;#62;</span>16<span style="color: #ddbb00;">&amp;#60;</span>/agosto<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>septiembre<span style="color: #ddbb00;">&amp;#62;</span>26<span style="color: #ddbb00;">&amp;#60;</span>/septiembre<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>octubre<span style="color: #ddbb00;">&amp;#62;</span>48<span style="color: #ddbb00;">&amp;#60;</span>/octubre<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>noviembre<span style="color: #ddbb00;">&amp;#62;</span>53<span style="color: #ddbb00;">&amp;#60;</span>/noviembre<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>diciembre<span style="color: #ddbb00;">&amp;#62;</span>63<span style="color: #ddbb00;">&amp;#60;</span>/diciembre<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>/volumen<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>/EJ_2010<span style="color: #ddbb00;">&amp;#62;</span>
<span style="color: #ddbb00;">&amp;#60;</span>/ventas<span style="color: #ddbb00;">&amp;#62;</span></pre>
<p>El fichero viene reflejando las ventas en cada mes de distintos emplea<br />
dos de la empresa. El problema que me surge es que no se como "partir" la linea de ya que volumen simboliza el nuevo empleado y luego cod simoliza cual es el código del mismo.</p>
<pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> startElement<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> namespace, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> sName, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> qName, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aattributes+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Attributes</span></a> atrs<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SAXException <span style="color: #009900;">&#123;</span>
...
<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>qName.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;volumen&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>qName.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;cod&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
....
&nbsp;
<span style="color: #009900;">&#125;</span></pre>
<p>Pero esta opcion de anidar el if no funciona, lo comprobe tras depurar por lo que el problema viene ahí y claro...luego ya se parsea mal y salta una excepción. Pero el problema viene de ahí seguro. ¿Se podria solucionar quizas utilizando alguno de los parametros que se llegan por cabecera a este método?¿Alguien me podría ayudar?</p>
<p>Muchas gracias de antemano.Un saludo a tod@s
</p></description>
		</item>
		<item>
			<title>Skuarex on "Problema Estructura XML y Adobe Flex"</title>
			<link>http://www.dudasprogramacion.com/topic/problema-estructura-xml-y-adobe-flex#post-546</link>
			<pubDate>Tue, 20 Jul 2010 11:35:10 +0000</pubDate>
			<dc:creator>Skuarex</dc:creator>
			<guid isPermaLink="false">546@http://www.dudasprogramacion.com/</guid>
			<description><p>Buenas, </p>
<p>Estoy desarrollando aplicaciones con Adobe Flex Builder 3 y me gustaría crear un árbol (Tree) que pudiera representar un documento XML, lo que he visto es que por cada fichero XML que quiera representar necesito una aplicación Flex diferente ya que se le tienen que configurar antes las etiquetas del archivo XML. </p>
<p>Lo he probado con archivos XML sencillos y me funciona bien, pero cuando pruebo de representar un archivo XML con una estructura más compleja me salen cosas raras en el árbol. </p>
<p>Mi objetivo sería conseguir una aplicación flex que permitiera representar cualquier fichero XML en un árbol, y a poder ser, que no requiriera una aplicación para cada archivo XML. </p>
<p>Muchas gracias por adelanto </p>
<p>Saludos
</p></description>
		</item>
		<item>
			<title>hluna88 on "propiedades de imagen con css en flash"</title>
			<link>http://www.dudasprogramacion.com/topic/propiedades-de-imagen-con-css-en-flash#post-536</link>
			<pubDate>Fri, 25 Jun 2010 16:48:02 +0000</pubDate>
			<dc:creator>hluna88</dc:creator>
			<guid isPermaLink="false">536@http://www.dudasprogramacion.com/</guid>
			<description><p>Saludos amigos, necesito ayuda con un problema que no me deja concluir mi trabajo, estoy haciendo un banner en flash, el cual carga datos de texto e imagenes desde un archivo xml, el problema es que al cargar las imagenes no las escala al tamaño del movieclip donde las inserto, en otros foros solo me han sugerido que el tamaño de la imagen se la determine antes, pero el asunto es que este banner se va a conectar a un sistema, en el cual el usuario subirá la imagen, no importando el tamaño, por eso es importante que el flash o el xml la escale, la verdad no se mucho de xml, y no tengo idea de como asignarle esas propiedades y en el AS no pude hacerlo ya que la variable de donde importo la imagen es de tipo string, me imagino que por eso no la escala.<br />
La idea es importar un css al flash, el cual asigne las propiedades de la imagen, pero no se como importarlo, alguien me puede ayudar???</p>
<p>por favor denme sugerencias de antemano se los agradezco
</p></description>
		</item>
		<item>
			<title>Mortimer Brewster II on "Incrustar imágenes"</title>
			<link>http://www.dudasprogramacion.com/topic/incrustar-imagenes#post-499</link>
			<pubDate>Sat, 12 Jun 2010 13:02:52 +0000</pubDate>
			<dc:creator>Mortimer Brewster II</dc:creator>
			<guid isPermaLink="false">499@http://www.dudasprogramacion.com/</guid>
			<description><p>Hola.-</p>
<p>Hace tiempo leí en un sitio que gracias al XML se podían incrustar imágenes en un documento XML y pasar esa información en HTML o algo parecido.</p>
<p>LLevo ya varios días buscando en Internet y no encuentro nada al respecto. ¿Sabeis algo de como se pueden añadir, incrustar o algo así imágenes en XML?</p>
<p>Gracias por adelantado.
</p></description>
		</item>
		<item>
			<title>lineadecodigo on "Comunicacion java con servidor Web"</title>
			<link>http://www.dudasprogramacion.com/topic/comunicacion-java-con-servidor-web#post-313</link>
			<pubDate>Tue, 09 Feb 2010 14:52:28 +0000</pubDate>
			<dc:creator>lineadecodigo</dc:creator>
			<guid isPermaLink="false">313@http://www.dudasprogramacion.com/</guid>
			<description><p>@ditron77, </p>
<p>Para realizar las consultas sobre una base de datos te recomiendo que le eches un ojo al ejemplo <a href="http://lineadecodigo.com/java/conectarnos-a-una-base-de-datos-con-jdbc/" rel="nofollow">http://lineadecodigo.com/java/conectarnos-a-una-base-de-datos-con-jdbc/</a></p>
<p>Te explica paso a paso como puedes conectarte con JDBC.</p>
<p>En cuanto al tema del XML. ¿Quieres devolver XML al usuario final? En ese caso puedes manejar el content-type de respuesta y devolver XML. </p>
<p>Quizás este artículo <a href="http://lineadecodigo.com/java/servlet-que-devuelve-xml/" rel="nofollow">http://lineadecodigo.com/java/servlet-que-devuelve-xml/</a> Pueda guiarte en como hacerlo.
</p></description>
		</item>
		<item>
			<title>Torres on "Comunicacion java con servidor Web"</title>
			<link>http://www.dudasprogramacion.com/topic/comunicacion-java-con-servidor-web#post-312</link>
			<pubDate>Tue, 09 Feb 2010 12:53:34 +0000</pubDate>
			<dc:creator>Torres</dc:creator>
			<guid isPermaLink="false">312@http://www.dudasprogramacion.com/</guid>
			<description><p>Buenas!, </p>
<p>Te conectas al servidor de la universidad o a la BD de la universidad? si te conectas a la BD solo necesitas que te den acceso y luego conectarte desde tu aplicación Java.</p>
<p><a href="http://www.chuidiang.com/java/mysql/BasicDataSource-Pool-Conexiones.php" rel="nofollow">http://www.chuidiang.com/java/mysql/BasicDataSource-Pool-Conexiones.php</a></p>
<p>No entiendo que quieres decir con lo de archivos html, si accedes a su BD directamente obtienes la información no necesitas ficheros xml ni html...</p>
<p>Usas algún framework de desarrollo o Java puro? es una aplicación web o de escritorio?
</p></description>
		</item>

	</channel>
</rss>

