Skip to content

Commit 7fa013b

Browse files
committed
Primeiro commit
0 parents  commit 7fa013b

37 files changed

+3148
-0
lines changed

.classpath

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
5+
<classpathentry kind="output" path="bin"/>
6+
</classpath>

.project

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>xml2lua</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#Sat Jun 25 18:10:26 BRT 2011
2+
eclipse.preferences.version=1
3+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
4+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
5+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6+
org.eclipse.jdt.core.compiler.compliance=1.6
7+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
9+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12+
org.eclipse.jdt.core.compiler.source=1.6

README

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Aplicação e classe Java para converter arquivos XML para o formato Lua, para uso em aplicações
2+
NCL/Lua do Sistema Brasileiro de TV Digital.
3+
4+
Mais informações em http://manoelcampos.com/?p=2480
5+
6+
Licença:
7+
Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)
8+
http://creativecommons.org/licenses/by-nc-sa/3.0/

bin/app.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---Aplicação para carregar arquivos lua convertidos a partir de um XML e exibir os dados no terminal.
2+
--@author Manoel Campos da Silva Filho - http://manoelcampos.com
3+
local produtos = dofile("produtos.lua")
4+
local destaques = dofile("destaques.lua")
5+
6+
local prod = {}
7+
for i, dest in pairs(destaques) do
8+
prod = produtos[dest.id]
9+
print("Id: ", dest.id, "Marca:", prod.marca, "Preço:", prod.preco, "Descrição:", prod.descricao)
10+
end

bin/com/manoelcampos/Xml2Lua.class

5.39 KB
Binary file not shown.
811 Bytes
Binary file not shown.

bin/destaques.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
return {
2+
{
3+
id=150
4+
},
5+
{
6+
id=17
7+
},
8+
{
9+
id=198
10+
},
11+
}

bin/destaques.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<destaques>
2+
<destaque id="150" />
3+
<destaque id="17" />
4+
<destaque id="198" />
5+
</destaques>

bin/produtos.lua

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
return {
2+
[12]={
3+
descricao = "TV 32''", marca = "Samsung", preco = "1200",
4+
},
5+
[150]={
6+
descricao = "Netbook", marca = "Asus", preco = "900",
7+
},
8+
[198]={
9+
descricao = "Impressora Laser", marca = "Samsung", preco = "399",
10+
},
11+
[201]={
12+
descricao = "Resma de Papel A4 (500 folhas)", marca = "Office", preco = "9",
13+
},
14+
[17]={
15+
descricao = "Resma de Papel A4 (100 folhas)", marca = "Office", preco = "3",
16+
},
17+
}

0 commit comments

Comments
 (0)