Problems with XML in xlets

Hi I've implemented a xlet that places panels in different placesm takes images from files, resizes video stream.... and I want take this arguments (coordinates, path from fles...) from an XML file. I'm a litlle bit confused about this. I don't know how start. What's the best way? SAX, DOM?

This is part of de XML file

<panelTituloPpal>

<panel>

<x> 50 </x>

<y> 35 </y>

<ancho> 610 </ancho>

<alto> 100 </alto>

<color>

<red> 238 </red>

<green> 130 </green>

<blue> 238 </blue>

<transparencia> 255 </transparencia>

</color>

</panel>

<imagen x ='515' y ='15'>

<path>"imagenes/logoUPNA_sinFondo.png" </path>

</imagen>

<HTitulo>

<panel>

<x> 10 </x>

<y> 10 </y>

<ancho> 590 </ancho>

<alto> 80 </alto>

<color>

<red> 0 </red>

<green> 130 </green>

<blue> 238 </blue>

<transparencia> 50 </transparencia>

</color>

</panel>

<titulo>"&nbsp&nbsp&nbspBienvenido al Teletexto de la UPNA" </titulo>

<fuente>

<tipo> Tiresias </tipo>

<opciones> Bold </opciones>

<tamanno> 30 </tamanno>

<color> black</color>

<separacion> 30 </separacion>

<alineacionHorizontal> HORIZONTAL_START_ALIGN</alineacionHorizontal>

<alineacionVertical> VERTICAL_CENTER </alineacionVertical>

</fuente>

</HTitulo>

</panelTituloPpal>

How can my xlet have access to these data? For example, in start() method I have this:

panelTituloPpal =new MiContenedor(50,35,610,100);

panelTituloPpal.setColorBack(new DVBColor(238, 130, 238, 255));

and I want that this parameters are taken from the XML file, not set directly

I need help.Thanks in advance

[2374 byte] By [leireurrizaa] at [2007-10-3 4:53:09]
# 1
You could use or a SAX parser (nanoxml or minml) or if XML is not mandatory java.util.Properties.You can find those parser at : nanoxml --> http://nanoxml.sourceforge.net/orig/minml --> http://www.wilson.co.uk/xml/minml.htm
MarcoFraa at 2007-7-14 22:57:59 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 2
Thanks.In Java Technology & XML dvohra09 has told me I must use XPath but I don't know where download javax.xml.xpath package.What do you think? What way is better? Thanks again
leireurrizaa at 2007-7-14 22:57:59 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 3

I've never used XPath, but given the memory restrictions on a typical STB, you'd wan to make sure that the XML parser is as small as possible.

Every time I've wanted to read XML on the box I've used the nanoXML. parser. It's always worked well and the licence is very flexible.

Roger

_Roger_a at 2007-7-14 22:57:59 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 4

Thanks Roger.

Sorry but I'm confused with all the information I've read. I'm new in XML proccessing.

I'm working with a STB and I want that some data from my xlet are taken from an XML file so I need a small XML parser. It seems that nanoXML is the best but, what version to work with a STB? In http://nanoxml.cyberelf.be/ there are three: NanoXML/Java, NanoXML/SAX and NanoXML/Lite

Do you know where can I get any examples of nanoXML use? Do you have anyone? For the moment I only get to read the XML file and watch it in the console, but I don't know how can I access to a specific node to get his value. Can you help me please?

Thanks again

leireurrizaa at 2007-7-14 22:57:59 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 5
Hi,In my project I use nanoXml and I haven't any problem but i have made few test. If don't use DTD declaration You can use lite version..Sorry for my English..
Daniele_Ka at 2007-7-14 22:57:59 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 6

I agree with Daniele_K - nanoXLM works fine in all of my applications.

You can find it at:

http://nanoxml.sourceforge.net/orig/

As you say, there are various implementations of the parser. You can choose which one you want to use, but as the source code is freely available, I'd be inclined to just pick one and remove the bits you don't need. Given that you've said you only want to read XML, you'll be able to remove all the code to write data, thus making your code even smaller.

Roger

null

_Roger_a at 2007-7-14 22:57:59 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 7
Thank you very much. Finally I'm using NanoXML/Java2.2 parser and it works fine
leireurrizaa at 2007-7-14 22:58:00 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 8
Hi!I try to read xhtml files into a xlet! As i understand nanoXML could read xml files. Could it also read xhtml pages? Which version of nanoXML would be the best?How do you read xml files? A example code would be very cool!Best regards,Bernhard
bsteindla at 2007-7-14 22:58:00 > top of Java-index,Java Mobility Forums,Consumer and Commerce...