add translated file

This commit is contained in:
Serban Constantin 2015-09-30 20:53:45 +03:00
parent 1b799a7299
commit 66f7710f6f

View File

@ -8,122 +8,126 @@ translators:
lang: ro-ro lang: ro-ro
--- ---
XML is a markup language designed to store and transport data. XML este un limbaj de markup ce are ca scop stocarea si transportul de date.
Unlike HTML, XML does not specify how to display or to format data, just carry it. Spre deosebire de HTML, XML nu specifica cum sa fie afisata sau formatata
informatia, ci doar o transporta.
* XML Syntax * Sintaxa XML
```xml ```xml
<!-- Comments in XML are like this --> <!-- Comentariile in XML arata asa -->
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<bookstore> <librarie>
<book category="COOKING"> <carte categorie="GATIT">
<title lang="en">Everyday Italian</title> <titlu limba="ro">Mancaruri italiene</titlu>
<author>Giada De Laurentiis</author> <autor>Giada De Laurentiis</autor>
<year>2005</year> <an>2005</an>
<price>30.00</price> <pret>30.00</pret>
</book> </carte>
<book category="CHILDREN"> <carte categorie="COPII">
<title lang="en">Harry Potter</title> <titlu limba="ro">Harry Potter</titlu>
<author>J K. Rowling</author> <autor>J K. Rowling</autor>
<year>2005</year> <an>2005</an>
<price>29.99</price> <pret>29.99</pret>
</book> </carte>
<book category="WEB"> <carte categorie="WEB">
<title lang="en">Learning XML</title> <titlu limba="ro">Invata XML</titlu>
<author>Erik T. Ray</author> <autor>Erik T. Ray</autor>
<year>2003</year> <an>2003</an>
<price>39.95</price> <pret>39.95</pret>
</book> </carte>
</bookstore> </librarie>
<!-- Above is a typical XML file. <!-- Deasupra este un fisier XML obisnuit.
It starts with a declaration, informing some metadata (optional). Incepe cu o declaratie ce adauga niste metadata (optional).
XML uses a tree structure. Above, the root node is 'bookstore', which has XML foloseste o structura arborescenta. Deasupra, nodul de baza este
three child nodes, all 'books'. Those nodes has more child nodes, and so on... 'librarie', care are trei noduri copil, toate 'carti'. Acele noduri au la
randul lor noduri copii si asa mai departe...
Nodes are created using open/close tags, and childs are just nodes between Nodurile sunt create folosind taguri deschise/inchise, iar copii sunt doar
the open and close tags.--> noduri intre tagurile de deschis si inchis.-->
<!-- XML carries two kind of data: <!-- XML transporta doua tipuri de date:
1 - Attributes -> That's metadata about a node. 1 - Atribute -> Metadata despre un nod.
Usually, the XML parser uses this information to store the data properly. In general, parserul XML foloseste aceasta informatie sa stocheze
It is characterized by appearing in parenthesis within the opening tag proprietatile datelor.
2 - Elements -> That's pure data. Este caracterizat de aparitia in paranteze in cadrul tagului deschis
That's what the parser will retrieve from the XML file. 2 - Elemente -> Date pure.
Elements appear between the open and close tags, without parenthesis. --> Asta este ceea ce parserul va extrage din documentul XML.
Elementele apar intre tagurile deschis si inchis, fara paranteze. -->
<!-- Below, an element with two attributes --> <!-- Dedesubt, un element cu doua atribute -->
<file type="gif" id="4293">computer.gif</file> <file type="gif" id="4293">computer.gif</file>
``` ```
* Well-Formated Document x Validation * Document bine formatat x Validare
A XML document is well-formated if it is syntactically correct. Un document XML este bine formatat daca este corect sintactic.
However, it is possible to inject more constraints in the document, Cu toate astea este posibil sa injectam mai multe constrangeri in document
using document definitions, such as DTD and XML Schema. folosind definitii precum DTD si XML Schema.
A XML document which follows a document definition is called valid, Un document XML ce foloseste o definitie de document este numit valid in
regarding that document. contextul documentului.
With this tool, you can check the XML data outside the application logic. Cu acest tool poti verifica datele XML in afara codului aplicatiei.
```xml ```xml
<!-- Below, you can see an simplified version of bookstore document, <!-- Dedesubt este o versiune simplificata a documentului librarie,
with the addition of DTD definition.--> cu aditia definitiei DTD.-->
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE note SYSTEM "Bookstore.dtd"> <!DOCTYPE note SYSTEM "Librarie.dtd">
<bookstore> <librarie>
<book category="COOKING"> <carte categorie="GATIT">
<title >Everyday Italian</title> <titlu >Everyday Italian</titlu>
<price>30.00</price> <pret>30.00</pret>
</book> </carte>
</bookstore> </librarie>
<!-- This DTD could be something like:--> <!-- DTD-ul poate fi ceva similar cu:-->
<!DOCTYPE note <!DOCTYPE note
[ [
<!ELEMENT bookstore (book+)> <!ELEMENT librarie (carte+)>
<!ELEMENT book (title,price)> <!ELEMENT carte (titlu,pret)>
<!ATTLIST book category CDATA "Literature"> <!ATTLIST carte categorie CDATA "Literatura">
<!ELEMENT title (#PCDATA)> <!ELEMENT titlu (#PCDATA)>
<!ELEMENT price (#PCDATA)> <!ELEMENT pret (#PCDATA)>
]> ]>
<!-- The DTD starts with a declaration. <!-- DTD-ul incepe cu o declaratie.
Following, the root node is declared, requiring 1 or more child nodes 'book'. Dupa, nodul de baza este declarat, cerand unul sau mai multe noduri copii
Each 'book' should contain exactly one 'title' and 'price' and an attribute de tipul 'carte'.
called 'category', with "Literature" as its default value. Fiecare 'carte' trebuie sa contina exact un 'titlu' si 'pret' si un atribut
The 'title' and 'price' nodes contain a parsed character data.--> numit 'categorie', cu "Literatura" ca valoare implicita.
Nodurile 'titlu' si 'pret' contin parsed character data.-->
<!-- The DTD could be declared inside the XML file itself.--> <!-- DTD-ul poate fi declara si in interiorul fisierului XML.-->
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE note <!DOCTYPE note
[ [
<!ELEMENT bookstore (book+)> <!ELEMENT librarie (carte+)>
<!ELEMENT book (title,price)> <!ELEMENT carte (titlu,pret)>
<!ATTLIST book category CDATA "Literature"> <!ATTLIST carte categorie CDATA "Literatura">
<!ELEMENT title (#PCDATA)> <!ELEMENT titlu (#PCDATA)>
<!ELEMENT price (#PCDATA)> <!ELEMENT pret (#PCDATA)>
]> ]>
<bookstore> <librarie>
<book category="COOKING"> <carte categorie="GATIT">
<title >Everyday Italian</title> <titlu >Everyday Italian</titlu>
<price>30.00</price> <pret>30.00</pret>
</book> </carte>
</bookstore> </librarie>
``` ```