XML Extensible Markup Language: An Introduction The Enabling Technology for B2B eCommerce and Web Site Development - PowerPoint PPT Presentation

Loading...

PPT – XML Extensible Markup Language: An Introduction The Enabling Technology for B2B eCommerce and Web Site Development PowerPoint presentation | free to view - id: 5a74f7-NzA1N



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

XML Extensible Markup Language: An Introduction The Enabling Technology for B2B eCommerce and Web Site Development

Description:

Title: PowerPoint Presentation Author: Justin Chen Created Date: 3/10/2000 12:34:55 PM Document presentation format: On-screen Show (4:3) Company – PowerPoint PPT presentation

Number of Views:240
Avg rating:3.0/5.0
Slides: 53
Provided by: Justi108
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: XML Extensible Markup Language: An Introduction The Enabling Technology for B2B eCommerce and Web Site Development


1
XML Extensible Markup Language An Introduction
The Enabling Technology for B2B eCommerce and
Web Site Development
  • Minder Chen, Ph.D.
  • mchen_at_gmu.edu

2
References
  • XML Programming by R. Allen Wyke, Sultan Rehman,
    Brad Leup, Microsoft Press, 2002
  • Al McKinnon, Linda McKinnon, XML, Course
    Technology, July 22, 2002
  • Online resources
  • XML Poster http//www.zapthink.com/download/downl
    oad.html
  • Our XML resources
  • Microsoft XML resources
  • http//msdn.microsoft.com/xml/
  • Dedicated XMLsites
  • http//www.xml.com/ and
    http//www.xmlsoftware.com/
  • XML-Data standard
  • http//www.w3.org/TR/1998/NOTE-XML-data/
  • XML namespaces http//www.w3.org/TR/REC-xml-names
    /
  • XSL standard
  • http//www.w3.org/TR/1998/WD-xsl-19981216.pdf
  • The World Wide Web Consortium XML Workgroup
    http//www.w3.org/XML/Activity
  • Timothy Bray's (co-editor of the XML spec.) XML
    page
  • http//www.textuality.com/xml/
  • http//www.builder.com/Authoring/XmlSpot/
  • http//www.oasis-open.org/cover/xml.htmlapplicati
    ons

3
HTML and XML
Courselist.xml
Courselist.htm
Courselist.doc
HTML lthtmlgtltheadgtlttitlegtCourse Listlt/titlegtlt/headgt
ltbodygt ltolgt ltligtCourse List ltulgt ltligt AITC
offers ltligt Intr. to XML ltligt basic-level
ltligt May 29, 1999 ltligt Price 220 ltligt
Reston Lab lt/ulgt lt/olgt lt/bodygtlt/htmlgt
XML lt?xml version"1.0" ?gt ltcourselistgt ltcourse
level"basic"gt ltfirmgtAITClt/firmgt lttitlegtIntr. to
XMLlt/titlegt ltdategtMay 29, 1999 lt/dategt ltprice
currency"USD"gt 220 lt/pricegt ltlocationgtReston Lab
lt/locationgt lt/coursegt lt/courselistgt
Plain English Course List AITC offers Intr. to
XML a basic-level course on May 29, 1999 Price
220 at Reston Lab
4
Document
  • Structure
  • Content
  • Display

Simple E-mail document
5
What is XML?
  • Extensible Markup Language, abbreviated XML,
    describes a class of data objects called XML
    documents
  • and partially describes the behavior of computer
    programs which process them. XML is an
    application
  • profile or restricted form of SGML, the Standard
    Generalized Markup Language ISO8879. By
  • construction, XML documents are conforming SGML
    documents.
  • XML documents are made up of storage units called
    entities, which contain either parsed or unparsed
    data.
  • Parsed data is made up of characters, some of
    which form character data, and some of which form
    markup.
  • Markup encodes a description of the document's
    storage layout and logical structure. XML
    provides a
  • mechanism to impose constraints on the storage
    layout and logical structure.
  • A software module called an XML processor is used
    to read XML documents and provide access to their
  • content and structure. It is assumed that an XML
    processor is doing its work on behalf of another
    module,
  • called the application. This specification
    describes the required behavior of an XML
    processor in terms of
  • how it must read XML data and the information it
    must provide to the application.
  • XML stands for "Extensible Markup Language".
  • It is extensible because it is not a fixed format
    like HTML.
  • It is designed to enable the use of simplified
    SGML on the World Wide Web.
  • A language and set of rules for formally defining
    markup languages
  • A markup meta-language

6
XMLs Relation with HTML and SGML
  • What is HTML? HTML (HyperText Markup Language) is
    a specific application of SGML used in the World
    Wide Web.
  • SGML is the "mother tongue", used for describing
    thousands of different document types definitions
    (DTD) in many fields of human activity. HTML is
    just one of these document types.

SGML
DTD for HTML
HTML Documents
7
XMLs Relation with HTML and SGML
  • XML is an abbreviated version of SGML, to make it
    easier for you to define your own document types,
    and to make it easier for programmers to write
    programs to handle them.
  • It omits the more complex and less-used parts of
    SGML in return for the benefits of being easier
    to write applications, easier to understand, and
    more suited to delivery and interoperability over
    the Web.

XML is more "SGML--" rather than "HTML".
8
XML
  • Extensible Markup Language (XML) 1.0
  • W3C Recommendation 10-Feb-98

A meta-language for defining XML DTD. XML Schema
is a competing standard.
XML 1.0 Recommendation
For a specific type of document such as a
definition of Purchase Order's data structure.
It is used to validate XML document.
XML DTD
For a specific document such as a specific
Purchase Order.
XML Document
9
So, You Need More Than XML
Structure
DTD
XML Parser
Validation
Document with Special Format (HTML/CSS)
XML document
Processing
Content
Display
XSL
10
Well-Formed XML
  • Must start with an XML declaration
  • Non-empty tags must match and nest properly
  • Empty tags must end with /gt
  • Must have exactly one root element
  • Tag and attribute names are case-sensitive
  • Attribute values must be quoted

11
Rules for Well-Formed XML
  • A standard for encoding data
  • 4 key differences from HTML
  • First Mandatory Closing Tags
  • The set of Tags is unlimited but all container
    tags must have end tags. lttaggtlt/taggt
    ltTAGgtlt/TAGgt
  • Example of legal XML
  • ltPersongt ltNamegtAdam Smithlt/Namegt
  • ltTitlegtGeneral Managerlt/Titlegt
  • ltAgegt42lt/Agegt lt/Persongt

12
Rules for Well-Formed XML
  • Second Proper Element Nesting.
  • All tags must be nested correctly. Like HTML,
    XML can intermix tags and text, but tags may not
    overlap each other.
  • Legal XML
  • ltPersongtJohn Smith is an
  • ltrolegtadvocate
  • lt/rolegt for lttechnologygtXMLlt/technologygt
  • lt/Persongt
  • Illegal XML
  • ltPersongtltNamegtJohn lt/Namegt ltKeyPointgtltHdgtXML
    provides a data buslt/Hdgt
    lt/PersongtltMoregtlt/Moregt
    lt/KeyPointgt

13
Rules for Well-Formed XML
  • Third Double-quote value delimiters
  • All attribute values must be enclosed in single
    or double quotation marks.
  • Legal
  • lttag attribute "value"gt
  • or
  • lttag attribute 'value'gt
  • Illegal
  • ltfont size 6gt
  • XML tags are case sensitive.

ltmyTAGgt ltMytaggt are different
14
Rules for Well-Formed XML
  • Fourth Single tag elements.
  • Singleton tags (called empty element or tags
    without content) must be written in an
    abbreviated form using special XML syntax.
  • Legal
  • ltBR/gt
  • ltHR/gt
  • ltTITLEgtlt/TITLEgt is equivalent to ltTITLE/gt
  • Illegal
  • ltBRgt
  • ltHRgt

15
So What!
  • "You guys look like a bunch of geniuses, and all
    you did was say, 'Make the tags balance.' "
  • --- A Silicon
    Valley executive
  • "There is really not much technology in XML, and
    even less that is new. But there are a few
    touches that while small, have been crucial."
  • XML is text, not binary.
  • Superior error-handling
  • Internationalization

  • --- Tim Bray

16
Sample XML Document
  • lt?xml version"1.0"?gt
  • ltPLANT ZONE"3"gt
  • ltCOMMONgtColumbinelt/COMMONgt
  • ltBOTANICALgtAquilegia canadensislt/BOTANICALgt
  • lt/PLANTgt

A string literal was expected, but no opening
quote character was found. Line 3, Position 13
ltPLANT ZONE3gt ------------
17
XML Document Namespaces
  • Namespaces provide ways to mix XML tags without
    chaos
  • lt?xml version"1.0"?gt lt!-- both namespace prefixes
     are available throughout --gt ltbkbook xmlnsbk'u
    rnloc.govbooks'          xmlnsisbn'urnISBN0-
    395-36341-6'gt     ltbktitlegtCheaper by the Dozenlt/
    bktitlegt     ltisbnnumbergt1568491379lt/isbnnumber
    gt lt/bkbookgt

18
Creating XML Using XML Notepad
http//www.microsoft.com/downloads/details.aspx?fa
milyid72d6aa49-787d-4118-ba5f-4f30fe913628displa
ylangen
19
XML Document Validation
  • You can enforce rules about these tags. Two
    kinds of ways to define rules for the document.
    These rules can be used to validate an XML
    document or used by XML authoring tools to guide
    the creation of an XML document.
  • Document Type Definition (DTD) This is used to
    define a grammar for the tags and attributes.
    This syntax is supported, but deprecated by
    Microsoft. It uses a special non-XML-based
    grammar
  • XML Schema (XML-Data) This is a much richer and
    more extensible way to describe the rules for the
    content of a document and uses XML itself as a
    grammar.

20
XML Document Structure
lt?xml version"1.0"?gt lt!DOCTYPE book SYSTEM
"bookreview.dtd gt ltbookgt ltauthorgt Jane
Smith lt/authorgt ltreviewgt . . .
lt/reviewgt lt/bookgt lt!-- person is the root
element.--gt lt?imgsize size200,200 ?gt
  • Prologue
  • XML declaration
  • Document Type Declaration (DOCTYPE)
  • Processing Instructions and Comments
  • Root Element and its child nodes
  • Epilogue
  • Comments and
  • Processing Instructions

21
Anatomy of a Tag
ltH1 ALIGN"CENTER"gt XML Tutorial lt/H1gt
  • ltH1 ALIGN"CENTER"gt XML Tutorial lt/H1gt

Attribute
Closing tag
Opening tag
Element
22
flower2.dtd Put DTD and XML in One File
  • lt?xml version"1.0"?gt
  • lt!DOCTYPE PLANT
  • lt!ELEMENT PLANT (COMMON, BOTANICAL)gt
  • lt!ATTLIST PLANT ZONE CDATA IMPLIEDgt
  • lt!ELEMENT COMMON (PCDATA)gt
  • lt!ELEMENT BOTANICAL (PCDATA)gt
  • gt
  • ltPLANT ZONE"3"gt
  • ltCOMMONgtColumbinelt/COMMONgt
  • ltBOTANICALgtAquilegia canadensislt/BOTANICALgt
  • lt/PLANTgt

23
Child Element Occurrence Symbol
Symbol Meaning
Elements with this symbol next to their name must occur one or more times in the XML document.
? Elements with this symbol next to their name may occur zero times or one time in the XML document.
Elements with this symbol next to their name may occur zero times, one time, or infinitely many times in the XML document.
None One and only one
24
Element Declaration
  • Elements that contain only other elements are
    said to have element content
  • Elements that contain both other elements and
    PCDATA are said to have mixed content
  • For example, the definition for burns might be
  • lt!ELEMENT burns (PCDATA quote)gt
  • The vertical bar indicates an or
    relationship, the asterisk indicates that the
    content is optional (may occur zero or more
    times) therefore, by this definition, burns may
    contain zero or more characters and quote tags,
    mixed in any order. All mixed content models must
    have this form PCDATA must come first, all of
    the elements must be separated by vertical bars,
    and the entire group must be optional.

25
Attribute-list Declaration
52 AttlistDecl 'lt!ATTLIST' S Name
AttDef S? 'gt' 53 AttDef S Name S
AttType S DefaultDecl Example
lt!ATTLIST termdef           id      
ID       REQUIRED           name    CDATA    IMP
LIEDgt lt!ATTLIST list           type    (bulletsor
deredglossary)  "ordered"gt lt!ATTLIST form        
   method  CDATA   FIXED "POST"gt If an
attribute has a default value declared with the
FIXED keyword, instances of that attribute must
match the default value.
26
DefaultDecl
Keyword Implication
REQUIRED The element must have a value for the attribute specified. If the value is not specified, the document will not be processed
FIXED The attribute has a value that does not change throughout the document.
IMPLIED The attribute may have a value declared, or it could be left empty.
Default Value This value is specified in place of a keyword in the lt!ATTLISTgt tag. If a value is specified in the document, the default value is replaced. However, if the document leaves the attribute value blank, then the default value is assumed.
27
Attribute type
Description
CDATA
Indicates to the processor to expect text as the
attribute value.
ID
Specifies a unique identifier to the attribute.
ID names must start with a letter or underscore
and cannot contain a white space.
NMTOKEN
Specifies that the attribute must start with a
letter or an underscore and cannot contain a
white space. However, in the case of a NMTOKEN,
duplicate values are allowed.
Enumerated
This type does not have a keyword. It consists of
a list of all possible values placed inside
parentheses and separated by the "" symbol, as
in the following example
lt!ATTLIST Book Binding (soft hard) REQUIREDgt
28
flower3.xml Plant List
  • lt?xml version"1.0"?gt
  • lt!DOCTYPE PLANTLIST
  • lt!ELEMENT PLANTLIST (PLANT)gt
  • lt!ELEMENT PLANT (COMMON, BOTANICAL)gt
  • lt!ELEMENT COMMON (PCDATA)gt
  • lt!ELEMENT BOTANICAL (PCDATA)gt
  • lt!ATTLIST PLANT ZONE (ewsn) "e"
  • KEY ID
    REQUIREDgt
  • gt
  • ltPLANTLISTgt
  • ltPLANT ZONE"w" KEY"A123"gt
  • ltCOMMONgtColumbinelt/COMMONgt
  • ltBOTANICALgtAquilegia canadensislt/BOTANICALgt
  • lt/PLANTgt
  • ltPLANT ZONE"e" KEY"A124"gt
  • ltCOMMONgtColumbinelt/COMMONgt
  • ltBOTANICALgtAquilegia canadensislt/BOTANICALgt
  • lt/PLANTgt
  • lt/PLANTLISTgt

29
The Node Structure of XML Document
Document
Attributes
Processing Instruction
comment
(Root) Element
Attributes
Document Type
Entities
Notations
childNodes
EntityReference
CDATASection
Element
Processing Instruction
Text
Comment
30
Well-Formed XML and Valid XML
  • Well-Formed XML
  • A well-formed XML document does not necessarily
    include a DTD or a schema.
  • Valid XML
  • XML that conforms to the vocabulary specified in
    a DTD or schema.

31
XML- Data Type
flower_schema.xml
  • ltSchema name"PLANTLIST"
  • xmlns"urnschemas-microsoft-comxml-data"
  • xmlnsdt"urnschema-microsoft-comdatatypes"gt
  • ltElementType name"COMMON" content"textOnly"/gt
  • ltElementType name"BOTANICAL"
    content"textOnly"/gt
  • ltAttributeType name"BESTSELLER"
    dttype"enumeration" dtvalues"yes no"
    default"no" /gt
  • ltElementType name"PLANT"gt
  • ltelement type"COMMON"/gt
  • ltelement type"BOTANICAL"/gt
  • ltattribute type"BESTSELLER"/gt
  • lt/ElementTypegt
  • ltElementType name"PLANTLIST" content"eltOnly"
    model"closed"gt
  • ltelement type"PLANT" minOccurs"1"
    maxOccurs"" /gt
  • lt/ElementTypegt
  • lt/Schemagt

32
XSL
  • A CSS (Cascading Style Sheet) defines the
    specification for an HTML document's presentation
    and appearance.
  • Similarly, XSL (Extensible Style Language)
    defines the specification for an XML documents
    presentation and appearance.
  • XSL is used to transform XML-based data into HTML
    or other presentation formats.
  • XSL is a subset of DSSSL (Document Style
    Semantics and Specification Language). DSSL is a
    style language used primarily with SGML.
  • XML is a subset of SGML.
  • XSL is the proposed style language for XML
    documents.

33
Sample XSL and XML
  • greeting.xml
  • lt?xml version"1.0" standalone"yes"?gt
  • lt?xml-stylesheet href"greeting.xsl"
    type"text/xsl" ?gt
  • ltgreetinggt
  • Hello World!
  • lt/greetinggt
  • greeting.xsl
  • ltxslstylesheet xmlnsxsl"http//www.w3.org/TR/WD
    -xsl"gt
  • ltxsltemplate match"/"gt
  • ltH1gt ltxslvalue-of /gt lt/H1gt
  • lt/xsltemplategt
  • lt/xslstylesheetgt

34
XML and XSL
XML deals only with the data structures and
contents of a document XSL specifies rules to
convert XML patterns to HTML tags and contents
XML
Client-Side
XML
Web server
XML and XSL processor
display
Internet
HTML
(Browser)
XSL
Extensible Stylesheet Language
(Browser-side add-on or building functions)
35
Integrating XML and XSL product_xsl3.xml
  • lt?xml version'1.0'?gt
  • lt?xmlstylesheet type"text/xsl"
    href"product_xsl3.xsl" ?gt
  • ltPRODUCTLISTgt
  • ltPRODUCTgt
  • ltIDgthtml100lt/IDgt
  • ltNAMEgtIntroduction to HTMLlt/NAMEgt
  • ltPRICEgt200lt/PRICEgt
  • lt/PRODUCTgt
  • ltPRODUCTgt
  • ltIDgtxml100lt/IDgt
  • ltNAMEgtIntroduction to XMLlt/NAMEgt
  • ltPRICEgt250lt/PRICEgt
  • lt/PRODUCTgt
  • lt/PRODUCTLISTgt

36
product_xsl3.xsl
  • lt?xml version"1.0"?gt
  • ltHTML xmlnsxsl
  • "http//www.w3.org/TR/WD-xsl"gt
  • ltBODYgt
  • ltH1gt Course Listing lt/H1gt
  • ltxslfor-each select"PRODUCTLIST/PRODUCT"gt
  • ltxslvalue-of select"ID"/gt
  • ltbgtltxslvalue-of select"NAME"/gtlt/bgt
    ltbr/gt
  • ltigt Price ltxslvalue-of
    select"PRICE"/gtlt/igt lthr/gt
  • lt/xslfor-eachgt
  • lt/BODYgt
  • lt/HTMLgt

37
Server-side XML XSL Processing
  • Advantages Browser independent client only
    requires HTML support
  • Server is tasked with XSL transformation

Servlet or Server-side scripting
http//java.sun.com/xml/
38
simple.xml
You dont need this for the XML_ServerControl.asp
x
  • lt?xml version'1.0'?gt
  • lt?xmlstylesheet type"text/xsl"
    href"simple.xsl" ?gt
  • ltbreakfast-menugt
  • ltfoodgt
  • ltnamegtBelgian Waffleslt/namegt
  • ltpricegt5.95lt/pricegt
  • ltdescriptiongttwo of our famous Belgian
    Waffles with plenty of real maple
    syruplt/descriptiongt
  • ltcaloriesgt650lt/caloriesgt
  • lt/foodgt
  • ltfoodgt
  • ltnamegtStrawberry Belgian Waffleslt/namegt
  • ltpricegt7.95lt/pricegt
  • ltdescriptiongtlight Belgian waffles coverred
    with strawberrys and whipped creamlt/descriptiongt
  • ltcaloriesgt900lt/caloriesgt
  • lt/foodgt
  • ltfoodgt
  • ltnamegtBerry-Berry Belgian Waffleslt/namegt

39
XML_ServerControl.aspx
40
BookStore.xml
  • ltBookstoregt
  • ltgenre name"Business"gt
  • ltbook ISBN"BU1032" Title"The Busy
    Executive's Database Guide" Price"19.99"gt
  • ltchapter num"1" name"Introduction"gt
  • Abstract...
  • lt/chaptergt
  • ltchapter num"2" name"Body"gt
  • Abstract...
  • lt/chaptergt
  • ltchapter num"3" name"Conclusion"gt
  • Abstract...
  • lt/chaptergt
  • lt/bookgt
  • ltbook ISBN"BU2075" Title"You Can Combat
    Computer Stress!" Price"2.99"gt
  • ltchapter num"1" name"Introduction"gt
  • Abstract...
  • lt/chaptergt
  • ltchapter num"2" name"Body"gt
  • Abstract...

41
BookList.aspx
  • lt_at_ Page Language"VB" gt
  • lt!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "http//www.w3.org/TR/xhtml1/DTD
    /xhtml1-transitional.dtd"gt
  • lthtml xmlns"http//www.w3.org/1999/xhtml"gt
  • lthead id"Head1" runat"server"gt
  • lttitlegtDataList Bound to XMLlt/titlegtlt/headgtltbody
    gt
  • ltform runat"server"gt
  • lth1gtBookstore Businesslt/h1gt
  • ltaspXmlDataSource id"MySource"
    DataFile"/App_Data/Bookstore.xml"
  • XPath"Bookstore/genre_at_name'Business'/bo
    ok" runat"server"/gt
  • ltaspDataList id"MyDataList"
    DataSourceId"MySource" runat"server"gt
  • ltItemTemplategt
  • lttablegtlttrgtlttdgt
  • ltimg alt"Cover Image"
    src'lt"images/" Eval("ISBN")
    ".gif"gt'gtlt/tdgt
  • lttdgtlth4gtlt Eval("Title") gtlt/h4gt
  • ltbgtISBNlt/bgt lt Eval("ISBN")
    gtltbrgt
  • ltbgtPricelt/bgt lt Eval("Price")
    gtltbrgtlt/tdgt
  • lt/trgtlt/tablegt
  • lt/ItemTemplategt
  • lt/aspDataListgt
  • XPath http//msdn2.microsoft.com/en-us/library/ms
    256471.aspx
  • http//quickstarts.asp.net/QuickStartv20/aspnet/sa
    mples/data/DataListXml_vb.aspx

42
simple.xsl
  • lt?xml version"1.0" encoding"utf-8"?gt
  • ltxslstylesheet version"1.0
    xmlnsxsl"http//www.w3.org/1999/XSL/Transform"gt
  • ltxsltemplate match"/"gt
  • lthtmlgt
  • ltBODY STYLE"font-familyArial, helvetica,
    sans-serif font-size12pt background-colorEEEE
    EE"gt
  • ltxslfor-each select"breakfast-menu/food"
    gt
  • ltDIV STYLE"background-colorteal
    colorwhite padding4px"gt
  • ltSPAN STYLE"font-weightbold
    colorwhite"gt
  • ltxslvalue-of select"name"/gt
  • lt/SPANgt
  • - ltxslvalue-of select"price"/gt
  • lt/DIVgt
  • ltDIV STYLE"margin-left20px
    margin-bottom1em font-size10pt"gt
  • ltxslvalue-of select"description"/gt
  • ltSPAN STYLE"font-styleitalic"gt
  • (ltxslvalue-of select"calories"/gt
    calories per serving)
  • lt/SPANgt
  • lt/DIVgt
  • lt/xslfor-eachgt

43
XML_ServerControl.aspx
  • lt_at_ Page Language"VB" gt
  • lt!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN"
  • "http//www.w3.org/TR/xhtml1/DTD/xhtml1-tra
    nsitional.dtd"gt
  • lthtml xmlns"http//www.w3.org/1999/xhtml" gt
  • lthead runat"server"gt
  • lttitlegtUntitled Pagelt/titlegt
  • lt/headgt
  • ltbodygt
  • ltform id"form1" runat"server"gt
  • ltdivgt
  • ltaspXml ID"Xml1" runat"server"
  • DocumentSource"Menu.xml"
  • TransformSource"Menu.xsl" gtlt/aspXmlgt
  • lt/divgt
  • lt/formgt
  • lt/bodygt
  • lt/htmlgt

44
RSS Really Simple Syndication
  • ltrss version"0.91"gt
  • ltchannelgt
  • lttitlegtXML.comlt/titlegt
  • ltlinkgthttp//www.xml.com/lt/linkgt
  • ltdescriptiongtXML.com features a rich mix of
    information and services for the XML
    community.lt/descriptiongt
  • ltlanguagegten-uslt/languagegt
  • ltitemgt
  • lttitlegtNormalizing XML, Part 2lt/titlegt
  • ltlinkgthttp//www.xml.com/pub/a/2002/12/04/no
    rmalizing.htmllt/linkgt
  • ltdescriptiongtIn this second and final look
    at applying relational normalization techniques
    to W3C XML Schema data modeling, Will Provost
    discusses when not to normalize, the scope of
    uniqueness and the fourth and fifth normal
    forms.lt/descriptiongt
  • lt/itemgt
  • ltitemgt
  • lttitlegtThe .NET Schema Object Modellt/titlegt
  • ltlinkgthttp//www.xml.com/pub/a/2002/12/04/so
    m.htmllt/linkgt
  • ltdescriptiongtPriya Lakshminarayanan
    describes in detail the use of the .NET Schema
    Object Model for programmatic manipulation of W3C
    XML Schemas.lt/descriptiongt
  • lt/itemgt
  • ltitemgt
  • lttitlegtSVG's Past and Promising
    Futurelt/titlegt
  • ltlinkgthttp//www.xml.com/pub/a/2002/12/04/sv
    g.htmllt/linkgt

45
RSS_GenerateSimple.aspx
  • lt_at_ Page Language"VB" ContentType"text/XML" gt
  • lt_at_ import Namespace"System" gt
  • lt_at_ import Namespace"System.Configuration" gt
  • lt_at_ import Namespace"System.Data" gt
  • lt_at_ import Namespace"System.Data.OleDB" gt
  • lt_at_ import Namespace"System.Web" gt
  • lt_at_ import Namespace"System.Web.UI" gt
  • lt_at_ import Namespace"System.IO" gt
  • lt_at_ import Namespace"System.Text" gt
  • lt_at_ import Namespace"System.Xml" gt
  • lt_at_ import Namespace"System.Data.Common" gt
  • lt_at_ OutputCache Duration"300" VaryByParam"None"
    gt
  • ltscript runat"server"gt
  • Protected Sub Page_Load(ByVal sender As
    Object, ByVal e As System.EventArgs)
  • Response.ContentType "text/xml"
  • GenerateRSS()
  • Response.End()
  • End Sub
  • Public Function GetArticles() As
    OleDbDataReader

46
Continued
  • Private Sub GenerateRSS()
  • Dim reader As OleDbDataReader
  • ' Create XmlWriter which will generate
    RSS output
  • Dim xmlOut as StringBuilder New
    StringBuilder()
  • xmlOut.Append("lt?xml version'1.0'
    encoding'ISO-8859-1'?gt")
  • xmlOut.Append("ltrss version'2.0'gt")
  • xmlOut.Append("ltchannelgt")
  • xmlOut.Append("lttitlegtXML.comlt/titlegt"
    )
  • xmlOut.Append("ltlinkgthttp//www.xml.co
    m/lt/linkgt")
  • xmlOut.Append("ltdescriptiongtXML.com
    features a rich mix of information and services
    for the XML community.lt/descriptiongt")
  • reader GetArticles()
  • While (reader.Read())
  • xmlOut.Append("ltitemgt")
  • xmlOut.Append("lttitlegt"
    reader("Title").ToString() "lt/titlegt")
  • xmlOut.Append("ltlinkgt"
    reader("Link").ToString() "lt/linkgt")
  • xmlOut.Append("ltdescriptiongt"
    reader("description").ToString()
    "lt/descriptiongt")
  • xmlOut.Append("ltpubDategt"
    DateTime.Parse(reader("PublishDate")).ToString()
    "lt/pubDategt")
  • xmlOut.Append("lt/itemgt")
  • End While

47
RSS_Feed.aspx
  • lt_at_ Page Language"VB" gt
  • lt!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "http//www.w3.org/TR/xhtml1/DTD
    /xhtml1-transitional.dtd"gt
  • ltscript runat"server"gt
  • Protected Sub ddRSS_SelectedIndexChanged(ByVal
    sender As Object, ByVal e As System.EventArgs)
  • Dim DataFileName as String
  • DataFileName ddRSS.SelectedValue
  • If DataFileName.Substring(0, 7).ToLower
    _
  • "http//" or DataFileName.Substring(DataFileName
    .Length-3, 3).ToLower "xml" Then
  • xdsRSS.DataFile ddRSS.SelectedValue
  • Else
  • DIm origin as Uri
    HttpContext.Current.Request.Url
  • DIm relative as String
    ddRSS.SelectedValue
  • DIm newUri as URI new Uri(origin,
    relative)
  • xdsRSS.DataFile newUri.ToString()
  • End If

48
Continued
  • lthtml xmlns"http//www.w3.org/1999/xhtml" gt
  • lthead runat"server"gt
  • lttitlegtUntitled Pagelt/titlegt
  • lt/headgt
  • ltbodygt
  • ltform id"form1" runat"server"gt
  • lth2gtUsing the XmlDataSource Controllt/h2gt
  • ltdivgt
  • ltbgtRSS Feednbsp lt/bgt
  • ltaspDropDownList ID"ddRSS" runat"server"
    AutoPostBack"True"
  • OnSelectedIndexChanged"ddRSS_SelectedIndexChange
    d" gt
  • ltaspListItem Value""gtSelect
    Onelt/aspListItemgt
  • ltaspListItem Value"/RSS/cnn_tech
    .xml"gtCNN Technologies Newslt/aspListItemgt
  • ltaspListItem Value"/RSS/XMLForA
    SP.NET.xml"gtXML for ASP.NET RSSlt/aspListItemgt
  • ltaspListItem Value"/RSS/RSS_Sam
    ple.xml"gtRSS Samplelt/aspListItemgt
  • ltaspListItem Value"http//msdn.m
    icrosoft.com/asp.net/rss.xml"gtMSDN ASP.NET
    RSSlt/aspListItemgt
  • ltaspListItem Value"/RSS/XMLDB.x
    ml"gtStatic RSS generated from RSS.mdb
  • lt/aspListItemgt
  • ltaspListItem Value"RSS_Generate.
    aspx"gt1a. Relative URL Dynamic RSS generated

49
Continued
  • ltbr /gt
  • ltbr /gt
  • ltaspDataList ID"dlRSS" runat"server"
    BackColor"White"
  • BorderColor"E7E7FF"
  • BorderStyle"None" BorderWidth"1px"
    CellPadding"3"
  • GridLines"Horizontal" EnableViewState"False"
    DataSourceID"xdsRSS"gt
  • ltFooterStyle BackColor"B5C7DE"
    ForeColor"4A3C8C" /gt
  • ltSelectedItemStyle BackColor"738A9C"
    Font-Bold"True"
  • ForeColor"F7F7F7" /gt
  • ltAlternatingItemStyle
    BackColor"F7F7F7" /gt
  • ltItemStyle BackColor"E7E7FF"
    ForeColor"4A3C8C" /gt
  • ltItemTemplategt
  • lta href'lt XPath("link") gt'
    style"text-decorationnone"gtlt XPath("title")
    gtlt/agt
  • lt/ItemTemplategt
  • ltHeaderStyle BackColor"4A3C8C"
    Font-Bold"True" ForeColor"F7F7F7" /gt
  • lt/aspDataListgt
  • ltaspXmlDataSource ID"xdsRSS"
    runat"server" XPath"/rss/channel/item"
    DataFile"http//www.xmlforasp.net/XML/RssGenerato
    r.aspx" CacheDuration"60"gtlt/aspXmlDataSourcegt
  • lt/divgt
  • lt/formgt

50
Existing methods - EDI messages
  • UN standard format (EDIFACT) or X.12
  • Compact strings, with numeric qualifiers. Strict
    limitation on the number of characters and
    position of data in a document.
  • Example
  • UNH900576ORDERSD93AUNEAN007BGM220H940568
    DTM13719940201102 NADBY54123450001769NAD
    SU40123450000949LIN2PIA5_1857990455IB IMD
    FBAUFarell J GIMDFBTIThe Singapore
    GripQTY211 PRIXXX7.99UNSSCNT22UNT159
    00576
  • Rules for data type control

51
EDI and XML
EDI VAN
EDI
EDI
XML
XML
52
BizTalk
About PowerShow.com