login
|
join
professional documents
home
Profile
docsters
request
Blogs
Upload
all docs
legal
business
financial
technology
educational
creative
BUZZ
mayurck291
about me
contact me
Mayur
In order to send a message you need to be logged in.
Dot Net Presentation 6
Categories
technology
Tags
Dot Net Presentation
be first to review
XML SGML Standard Formal generalized markup language system designed for building test markup languages. recognized standard for text information processing that provide an organized way to structure the content for broad use. Internationally XML A tag-based meta language for structured data representation data hierarchically (in a tree) Designed Represents Provides context to data (makes it meaningful) presentation (HTML) from data (XML) Self-describing data Separates An A open W3C standard vs. HTML, which is an implementation of SGML subset of SGML XML and Structured Data Pre-XML representation of data: “PO-1234”,”CUST001”,”X9876”,”5”,”14.98” XML representation of the same data:
PO-1234
CUST001
X9876
5
14.98
Components of an XML Document Elements Each element has a beginning and ending tag
...
Elements can be empty (
) Attributes Describes an element; e.g. data type, data range, etc. Can only appear on beginning tag An XML Document
The Autobiography of Benjamin Franklin
Benjamin
Franklin
8.99
The Confidence Man
Herman
Melville
11.99
Rules For Well-Formed XML There must be one, and only one, root element be properly nested Sub-elements must A tag must end within the tag in which it was started Attributes are optional Defined by an optional schema Attribute values must be enclosed in “” or „‟ instructions are optional Processing XML is case-sensitive
and
are not the same type of element Well-Formed XML? No, CHILD2 and CHILD3 do not nest properly.
This is element 1
Number 3
No, there are two root elements
This is element 1
This is another element 1
Well-Formed XML? Yes.
This is element 1
Namespaces: Overview Part of XML’s extensibility Allow authors to differentiate between tags of the same name (using a prefix) by a URI (Uniform Resource Identifier) Identified Namespace declaration examples: xmlns: bk = “http://www.example.com/bookinfo/” Namespace declaration Prefix URI (URL) Namespaces: Examples
All About XML
Joe Developer
19.99
An XML namespace declared without a prefix becomes the default namespace for all sub-elements. All elements without a prefix will belong to the default namespace.
All About XML
Joe Developer
CDATA, PCDATA AND Entity Ref. Actual data : 0 < x < 100 < [CDATA [ 0 < x < 100 ] ] > Or
0 < x < 100
XML Parsers SAX ( Simple API for XML) API to allow developers to read/write XML data Event based Uses a “push” model StartDocument StartElement Characters ----------------EndElement EndDocument Sequential access only (data not cached) Requires less memory to process XML data SAX has less overhead (uses small input, work and output buffers) than the DOM The XML DOM XML Document Object Model (DOM) Provides a programming interface for manipulating XML documents in memory a set of objects and interfaces that represent the content and structure of an XML document a program to traverse an XML tree Includes Enables Allows elements, attributes, etc., to be added/deleted in an XML tree new XML documents to be created programmatically Allows XPath XML Path Language Uses: General purpose query language for identifying nodes in an XML document In XSL transformation Supports standard comparison, Boolean and mathematical operators (=, <, and, or, *, +, etc.) Contextual – the results depend on current node XPath Query Examples ./author (finds all author elements within current context) /bookstore (find the bookstore element at the root) /* //author (find the root element) (find all author elements anywhere in document) /bookstore[@specialty = “textbooks”] (find all bookstores where the specialty attribute = “textbooks”) /author/* (find all elements of author element) //author/@* (find all attributes of author element) XSL Language Specifies for expressing document styles the presentation of XML of: More powerful than CSS Consists XSLT XPath XSL Formatting Objects (XSL-FO) Transformations: Overview XSLT – a language used to transform XML data into a different form (commonly XML or HTML) XML, HTML, … XSLT Transformations: Example
Scootney Publishing
Regional Sales Report
Sales Report
West Coast
...
/> /> /> /> Transformations: Example
...
Region\Quarter
Q
...
color:red;
color:green;
...
Transformations: Example .NET & XML XML Namespaces in .NET System.Xml .Xsl .XPath .Schema .Serialization System.Xml Namespace Overall namespace for classes that provide XML support Classes for creating, editing, navigating XML documents Reading, writing and manipulating documents via the DOM Use the XmlDocument class for XML documents Use the XmlDataDocument class relational or XML data XmlElement, XmlAttribute, XmlComment, etc Used by the XmlDocument and XmlDataDocument classes Classes that correspond to every “type” of XML “element”: XmlDocument Properties of Interest: ChildNodes: Returns all the children of the current node DocumentType: Gets the DOCTYPE declaration node DocumentElement: Returns the root XmlElement XmlResolver: Used to resolve DTD & schema references FirstChild: Returns the first child of the current node ParentNode: Returns the parent of the current node Value: Returns the (string) value of the current node Methods of Interest CreateComment: Creates a comment node CreateElement: Creates an element node Load: Loads XML data using a URL, file, Stream, etc Save: Saves the XML document to a file, Stream, or writer ReadXML.cs using System; using System.Xml; class MyApp { static void Main() { XmlDocument doc = new XmlDocument(); doc.Load("E:\\Workshop\\book.xml"); XmlNodeList nodes = doc.GetElementsByTagName("book"); foreach(XmlNode node in nodes) { Console.WriteLine("{0}",node["author"].InnerText); } } }
Public Domain
views:
295
downloads:
63
rating:
6(1)
reviews:
0
posted:
4/17/2008
language:
English
related docs
other docs by this user
search analytics
search term
page on Google
times searched
Dot Net Presentation 2
shared by:
mayurck291
on:
4/17/2008
|
views:
230
|
downloads:
59
|
comments:
0
|
category:
technology
Dot Net Presentation 4
shared by:
mayurck291
on:
4/17/2008
|
views:
510
|
downloads:
58
|
comments:
0
|
category:
technology
Dot Net Presentation 1
shared by:
mayurck291
on:
4/17/2008
|
views:
469
|
downloads:
61
|
comments:
1
|
category:
technology
Dot Net Presentation 3
shared by:
mayurck291
on:
4/17/2008
|
views:
259
|
downloads:
55
|
comments:
0
|
category:
technology
Dot Net Presentation 5
shared by:
mayurck291
on:
4/17/2008
|
views:
751
|
downloads:
66
|
comments:
0
|
category:
technology
Designated Copyright Agent - PALACE dot NET,
shared by:
CopyrightAgent
on:
3/30/2008
|
views:
17
|
downloads:
0
|
comments:
0
|
category:
legal
net_notes
shared by:
sanyam
on:
6/1/2008
|
views:
99
|
downloads:
15
|
comments:
0
|
category:
educational
Microsoft_Net
shared by:
sanyam
on:
6/1/2008
|
views:
95
|
downloads:
5
|
comments:
0
|
category:
educational
Designated Copyright Agent - alpha dot net, corp.
shared by:
CopyrightAgent
on:
3/30/2008
|
views:
100
|
downloads:
0
|
comments:
0
|
category:
legal
Designated Copyright Agent - Brazoria Dot Net, Inc.
shared by:
CopyrightAgent
on:
3/30/2008
|
views:
89
|
downloads:
0
|
comments:
0
|
category:
legal
Designated Copyright Agent - Voxel Dot Net, Inc.
shared by:
CopyrightAgent
on:
3/30/2008
|
views:
17
|
downloads:
0
|
comments:
0
|
category:
legal
Wharton Presentation - Monetizing the Net - Supernova 2008
shared by:
MissPowerPoint
on:
6/30/2008
|
views:
59
|
downloads:
3
|
comments:
0
|
category:
business
Wrox - Beginning Visual Basic .NET Database Programming
shared by:
sanyam
on:
6/1/2008
|
views:
249
|
downloads:
1354
|
comments:
0
|
category:
educational
Groups and electron dot diagrams
shared by:
LisaB1982
on:
5/30/2008
|
views:
34
|
downloads:
0
|
comments:
0
|
category:
educational
WORLD_TIME[1]
shared by:
mayurck291
on:
4/24/2008
|
views:
118
|
downloads:
35
|
comments:
0
|
category:
creative
TRAINS_INDIA
shared by:
mayurck291
on:
4/24/2008
|
views:
413
|
downloads:
24
|
comments:
0
|
category:
creative
TaxCalc_2006
shared by:
mayurck291
on:
4/24/2008
|
views:
316
|
downloads:
14
|
comments:
0
|
category:
creative
STD
shared by:
mayurck291
on:
4/24/2008
|
views:
145
|
downloads:
20
|
comments:
0
|
category:
creative
ringtones
shared by:
mayurck291
on:
4/24/2008
|
views:
160
|
downloads:
15
|
comments:
0
|
category:
creative
PICNIC_SPOTS
shared by:
mayurck291
on:
4/24/2008
|
views:
1093
|
downloads:
24
|
comments:
1
|
category:
creative
NAME___ITS_MEANING
shared by:
mayurck291
on:
4/24/2008
|
views:
228
|
downloads:
48
|
comments:
0
|
category:
creative
life_time_calender
shared by:
mayurck291
on:
4/24/2008
|
views:
135
|
downloads:
22
|
comments:
0
|
category:
creative
clock
shared by:
mayurck291
on:
4/24/2008
|
views:
140
|
downloads:
20
|
comments:
0
|
category:
creative
celldecoder
shared by:
mayurck291
on:
4/24/2008
|
views:
135
|
downloads:
19
|
comments:
0
|
category:
creative
dotnet xml attribute optional
1
1
xml sax in dot
1
1
dotnet meta tree
2
1
adding cdata xml dotnet
3
1
getelementsbytagname !doctype vb
1
1
presentation
1
1
xml api in dotnet
1
1
brazoria dot net
1
1
"system
1
1