Foros del Web » Programación para mayores de 30 ;) » Programación General »

xml con etiquetas css??

Estas en el tema de xml con etiquetas css?? en el foro de Programación General en Foros del Web. Hola, estuve consultando este tema en el foro de flash, pero creo que ya excede el mismo, por eso me pase aca para hacer una ...
  #1 (permalink)  
Antiguo 12/07/2007, 08:55
 
Fecha de Ingreso: octubre-2006
Mensajes: 70
Antigüedad: 17 años, 6 meses
Puntos: 0
xml con etiquetas css??

Hola, estuve consultando este tema en el foro de flash, pero creo que ya excede el mismo, por eso me pase aca para hacer una pregunta similar a quienes estan más cancheros en xml.

Tengo que relacionar xml, css y flash. Tengo los tres archivos, pero al cargar el xml en flash, este se carga en cualquier campo de texto a partir de la primera etiqueta, como si no reconociera los cierres de etiqueta o se confundiera con las etiquetas css. ¿como se soluciona esto? tiene que haber alguna forma!

Les muestro mis códigos por si algo estoy haciendo mal (que es muy probable):

XML

Código:
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="estilo.css" type="text/css"?> //esta línea no se si hace falta??

<learningpath>
    <meetingtitle><pt>Meeting/contact with TenarisUniversity Representative</pt></meetingtitle>
    <meetingtext1><pp>Tenaris University Regional Representative addresses new hires to explain area's contribution to the organization and involves them into their Academic Programs.</pp></meetingtext1>
    <healthtitle><pt>Health, Safety and Environment course (HSE), Quality Management course, Production Process overview and mill visit.</pt></healthtitle>
	<healthtext1><pp>HSE and Quality courses involve e-learning and classroom training and should be accomplished as soon as they enter the company specially taking into consideration local regulations and requirements. Everyone should see and understand the production process at their own facilities before. Those far from a mill will participate in case they travel.</pp></healthtext1>
	<startertitle><pt>Starter Program</pt></startertitle>
	<startertext1><pp>The Starter Program is a package of e-learning courses to be taken by new hired employees before the Core Program. The courses included in the Starter Program are:<br><b>Tenaris Institutional:</b> 45 minutes<br><b>Business Ethics:</b> 3 hours<br><b>Organization, Normative System & Controls:</b> 1,5 hour<br><b>SAP basics:</b> 1,5 hour<br><b>Intranet and IT Tools:</b> 3 hours<br><b>Sarbanes-Oxley & Internal Control (for PC 55 and up):</b> 2 hours</pp></startertext2>
</learningpath>
Bueno, este contenido en realidad es mas largo. pero como muestra...


CSS

Código:
/* CSS Document */

pt {
  color: #000000;
  font-family: Verdana,Arial,Helvetica,sans-serif;
  font-size: 12pt;
}

pp {
  color: #000000;
  font-family: Verdana,Arial,Helvetica,sans-serif;
  font-size: 11pt;
}

b {
  font-weight: bold
}

s {
  text-indent: 5em
}
no creo que con eso haya mayor problema.


ACTION SCRIPT

Código:
System.useCodepage = true;
var obj_xml:XML = new XML();
obj_xml.ignoreWhite = true;
obj_xml.load("texto.xml");
obj_xml.onLoad = function(exito) {
	if (exito) {
		meetingtitle.text = obj_xml.firstChild.childNodes[0].firstChild.nodeValue;
	} else {
		meetingtitle.text = "Error";
	}
};
var myCSS = new TextField.StyleSheet();
var cssURL = "estilo.css";
myCSS.load(cssURL);
myCSS.onLoad = function(exito) {
	if (exito) {
		meetingtitle.styleSheet = myCSS;
		meetingtitle.html = true;
		meetingtitle.htmlText = obj_xml;
	}
};

ahora...cual sería el problema?? Si leen el xml y las etiquetas que puse se van a dar cuenta de lo que necesito que pase en el flash.. cual es la forma??

Espero respuestas con ansias!!! tengo que hacer esto para el trabajo y ya estoy tan mareada!!
mil gracias!!
mariana.
  #2 (permalink)  
Antiguo 12/07/2007, 12:21
Avatar de monoswim
$moderador{'Esteban'}
 
Fecha de Ingreso: febrero-2002
Ubicación: Buenos Aires - Argentina
Mensajes: 8.762
Antigüedad: 22 años, 3 meses
Puntos: 90
Re: xml con etiquetas css??

pues el problema de que el flash no te tome bien el XML, es para el foro de flash...ahora bien, creo que desde flash no necesitas el css porque solo toma la información y no los estilos...el CSS es para un navegador por ejemplo...

Saludos
__________________
Esteban Quintana
  #3 (permalink)  
Antiguo 12/07/2007, 12:43
 
Fecha de Ingreso: octubre-2006
Mensajes: 70
Antigüedad: 17 años, 6 meses
Puntos: 0
Re: xml con etiquetas css??

hola monoswim,
no entendi bien, pero flash los estilos css sí me los respeta, y si al archivo xml le saco las etiquetas css, en flash se carga sin problemas. El problema que tengo es cuando quiero hacer todo... agrego las etiquetas css al xml pero pareciera como que el xml no interpretara los cierres de etiquetas xml y me tomara varios nodos como 1 solo. Por eso pregunte en este foro, porque me parece que el problema se da en el xml cuando agrego las etiquetas css. A ver si alguien me sabe decir si hay algun error en mi código, o quizas estoy equivocada en general porque esto quizas no se pueda hacer...
muchas gracias!!
saludos!!
mariana.
  #4 (permalink)  
Antiguo 12/07/2007, 14:25
Avatar de monoswim
$moderador{'Esteban'}
 
Fecha de Ingreso: febrero-2002
Ubicación: Buenos Aires - Argentina
Mensajes: 8.762
Antigüedad: 22 años, 3 meses
Puntos: 90
Re: xml con etiquetas css??

abrilo con el explorer, tira error...

Whitespace is not allowed at this location. Error processing resource

Primero hacelo andar en el explorer, luego en el flash debería de andar...
__________________
Esteban Quintana
  #5 (permalink)  
Antiguo 12/07/2007, 15:08
 
Fecha de Ingreso: octubre-2006
Mensajes: 70
Antigüedad: 17 años, 6 meses
Puntos: 0
Re: xml con etiquetas css??

si me aparece esto

Meeting/contact with TenarisUniversity Representative Tenaris University Regional Representative addresses new hires to explain area's contribution to the organization and involves them into their Academic Programs. Health, Safety and Environment course (HSE), Quality Management course, Production Process overview and mill visit. HSE and Quality courses involve e-learning and classroom training and should be accomplished as soon as they enter the company specially taking into consideration local regulations and requirements. Everyone should see and understand the production process at their own facilities before. Those far from a mill will participate in case they travel. Starter Program The Starter Program is a package of e-learning courses to be taken by new hired employees before the Core Program. The courses included in the Starter Program are:Tenaris Institutional: 45 minutesBusiness Ethics: 3 hoursThe XML page cannot be displayed
Cannot view XML input using CSS style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

Whitespace is not allowed at this location. Error processing resource 'file:///C:/Documents and Settings/Mariana.Pascucci/D...

<startertext1><body>The Starter Program is a package of e-learning courses to be taken by new hired employees b...


la primera parte es la primera parte del contenido xml, pero falta la otra mitad. casualmente en flash se carga todo, pero hasta ahi!
que significa??
gracias!
mariana
  #6 (permalink)  
Antiguo 13/07/2007, 05:52
Avatar de monoswim
$moderador{'Esteban'}
 
Fecha de Ingreso: febrero-2002
Ubicación: Buenos Aires - Argentina
Mensajes: 8.762
Antigüedad: 22 años, 3 meses
Puntos: 90
Re: xml con etiquetas css??

mirando bien el XML mi di cuenta de algo...jeje

<startertext1><pp>......</pp></startertext2>

abres un startertext2 y cierras un 2 jaja

Saludos
__________________
Esteban Quintana
  #7 (permalink)  
Antiguo 13/07/2007, 13:49
 
Fecha de Ingreso: octubre-2006
Mensajes: 70
Antigüedad: 17 años, 6 meses
Puntos: 0
Re: xml con etiquetas css??

gracias monoswim, tenias razón, estaban mal escritas algunas etiquetas...!
Pero además el problema eran también las etiquetas <br> que en html no hace falta cerrarlas pero en xml parece que si!...
Habiendo finalmente, con tu ayuda y con la que me dieron en el foro de flash, logrado que funcione todo...me surge una nueva duda.. la plantearé como otro tema asi que mejor clasificada! Pero no queria dejar de agradecer!
Saludos,
mariana.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 08:58.