XML as Tree Structure (1)

  • Uploaded by: Abimanyu Fitroh Nur Cahyo
  • Size: 599.5 KB
  • Type: PDF
  • Words: 577
  • Pages: 12
Report this file Bookmark

* The preview only shows a few pages of manuals at random. You can get the complete content by filling out the form below.

The preview is currently being created... Please pause for a moment!

Description

XML as Tree Structure (Rule, Well form dan Valid) Teori dan Praktikum

Page 1

Example of an XML Document
Alice Lee [email protected] 212-346-1234 1985-03-22


XML Tree Structure .....

Page 3

Contoh : Prolog : • Everyday Italian Giada De Laurentiis 2005 30.00 Harry Potter J K. Rowling 2005 29.99 Learning XML Erik T. Ray 2003 39.95



root element element:

4 child elements: , <author rel="nofollow">, <year>, <price>. <title lang="en">Everyday Italian Giada De Laurentiis 2005 30.00 ends the book element:

Page 4

XML Syntax Rules • • • • • •

XML Documents Must Have a Root Element The XML Prolog All XML Elements Must Have a Closing Tag XML Tags are Case Sensitive XML Elements Must be Properly Nested XML Attribute Values Must Always be Quoted

• Entity References • • • • •

< > & ' "

< > & ' “

• Comments in XML • • White-space is Preserved in XML • XML → • HTML →

Hello Hello Andi

Andi

• XML Stores New Line as LF • • •

Well Formed XML

Page 5

Unix and Mac OSX use LF. Old Mac systems use CR. (\r ascii 13) XML stores a new line as LF (\n ascii 10).

Well Formed XML Documents • An XML document with correct syntax is called "Well Formed". • The syntax rules : • • • • •

XML XML XML XML XML

documents must have a root element elements must have a closing tag tags are case sensitive elements must be properly nested attribute values must be quoted

• XML Errors Will Stop You • Errors in XML documents will stop your XML applications. • HTML browsers are allowed to display HTML documents with errors (like missing end tags).

Page 6

Valid XML Documents • A "well formed" XML document is not the same as a "valid" XML document. • A "valid" XML document must be well formed. In addition, it must conform to a document type definition.

• There are two different document type definitions that can be used with XML: • DTD - The original Document Type Definition • XML Schema - An XML-based alternative to DTD

• A document type definition defines the rules and the legal elements and attributes for an XML document.

Page 7

VS code – Extensions for XML

Page 8

Ctrl + Shift + P

• Open XML Documents

• Perhatikan dan pelajari User Guide – XML Validation Page 9

Cobakan file xml berikut, capture pesan error/problem : Check1.xml Tove Jani Reminder Don't forget me this weekend!

Check2.xml Tove Jani Reminder Don't forget me this weekend! Page 10

Check3.xml

Cobakan file xml dengan validasi xtd berikut : Note.xml Tove Jani Reminder Don't forget me this weekend!

Note.dtd Tove Jani Reminder Don't forget me this weekend!

Page 11

Tugas Praktikum • Menulis Langkah instalasi extension xml di vs code (extension apa saja) • File : checkx.xml di atas dan hasil capture pesan errornya dalam word • Hasil percobaan xml dengan file validasi dtd nya. (file dan capture)

https://github.com/redhat-developer/vscode-xml/blob/master/docs/Validation.md#validation-withxsd-grammar

Page 12

Similar documents

XML as Tree Structure (1)

Abimanyu Fitroh Nur Cahyo - 599.5 KB

MATERI 1 SENTENCE STRUCTURE

Kristina - 92 KB

Atomic Structure

Margaret De Castro Racines - 1 MB

Capital Structure

Sayanti Samanta - 326.7 KB

AS familii cu copii

Gabriela Albot - 125.6 KB

Cu Artill As

jose alejandro ramos mendoza - 497 KB

Fisa Postului as Igiena

diana tudurache - 90.2 KB

Structure 30 32

Suci Prtn - 6.5 MB

HP structure - PO

Linh Do - 108.8 KB

ALDE122_5.Academic Text Structure

Goitsemodimo Senna - 1.1 MB

Lab 3 - Atomic Structure

Toni Masil - 88.8 KB

Structure 20, 21, 24, 25

Suci Prtn - 18.1 MB

© 2024 VDOCS.RO. Our members: VDOCS.TIPS [GLOBAL] | VDOCS.CZ [CZ] | VDOCS.MX [ES] | VDOCS.PL [PL] | VDOCS.RO [RO]