Download presentation
Presentation is loading. Please wait.
1
Create Your First XML Document
2
XML Directive to create an XML document e.g. Define data data
3
Test XML file Validating parsers –check XML document syntax –Confirm that XML data matches predefined validation rules Document type definitions (DTDs) Schemas –Scholarly Technology Group at Brown Univ. www.stg.brown.edu/service/xmlvalid –Textuality’s Larval www.textuality.com/Lark/.www.textuality.com/Lark/ –IBM’s XML Parser for Java www.alphaworks.ibm.com/tech/xml4j
4
Test XML file Non-Validating parsers –Check XML document syntax –Do not confirm that XML data matches predefined validation rules –XML.com RUWF www.xml.com/pub/tools/ruwf/check.html www.xml.com/pub/tools/ruwf/check.html –James Clark’s expat www.jclark.com/xml/expat.html
5
Hello, world!
6
Hello, world!
9
Create a Simple XML Processor Cascading style sheets –The easiest type and the most limited XSL style sheet –Dynamic XML data display Data island plus script –Incorporate XML data into am HTML presentation and performs some processing in addition to display Data Object Model Plus Script or Client-side Program –Create full-blown XML application
10
A CSS file GREETING { display: block; color: red }
11
Hello, world!
12
Create an XML Document Declaration <?xml version=“versionNumber” [encoding=“encodingValue”] [standalone=“yes | no”] ?> versionNumber – the number of the XML specification encodingValue – an optional value. XML processors assuem that XML documents are written in the UTF-8 character set. Standalone – can be set to either no or yes, depending on whether the document depends on other XML files in order to be valid or not respectively. (default is yes)
13
Declare Root Element Every valid XML document contains one – and only one – root element. –An element that contains all the other elements in a document –The top of the XML data hierarchy, both conceptually and syntactically …
14
Comment of A XML file Use Must be placed after the XML delcaration Cannot be placed inside XML tags Cannot be nested
15
Declare Non-root Data Elements containerElement – Name of the data element containing one or more data elements containedElement – optional, name of the data element that is contained by other data element attributeInfo – a string of attribute-value pairs that specify the attributes associated with a given data element
16
An example
20
Declare a Repeating Data Element The syntax to declare a repeating data element is the same as the required to declare non-root XML data elements
22
Describe Data Elements with Attributes The syntax required to declare attributes in XML elementName – the name of the element attributeName – the name of the attribute name attributeValue – the value to associate with that attribute
23
Describe Data Elements with Attributes
25
Define a Name Space
26
Name Space
28
Predifined XML Entities Problem –Need to include a left angle bracket in an element’s value
29
Predifined XML Entities Five predefined entities
33
Include Special Processing Instructions Declare a Processing Instruction spaceDelimitedInstructions – the name of any valid executable, followed by any required parameters
35
Include Non-standard Text
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.