You are on page 1of 1

Well-Behaved XML Document TLA Hell (Three Lettered Acronyms) XML versus HTML SOAP Data Type

beam outside of document


yes = no external streams
no = parser may need to
1. Every element has a start and and an end tag B2B Business to Business XML C++ VB Description
2. Single, unique root element B2C Business to Consumer byte signed char Not supported 1-byte signed integer, VT_I1
short short Integer 2-byte signed integer, VT_I2
3. Element and attributes names are case sensitive DOM Document object model XML HTML integer int Long 4-byte signed integer, VT_I4
4. Proper nesting, no overlaps. DTD Document type definition Subset of SGML SGML application float float Single 4-byte floating point number, VT_R4
5. Attribute values must be in quotes EDI Electronic Data Interchange Extensible double double Double 8-byte floating point number, VT_R8
Fixed
HTML Hypertext Markup Language string BSTR String Automation string, VT_BSTR
Data technology Presentation boolean BOOL Boolean Boolean, VT_BOOL
SAX Simple Api for XML
XML Syntax SDL Service Description Language Standard Generalised Markup Language
SGML Structured Generalised Markup Language
<?xml version="1.0" encoding="EBCDIC" standalone="no"?> SOAP Simple Object Access Protocol XML is a simple but flexible data format.
W3C World Wide Web Consortium XML has a standardized programming API.
An object has properties, i.e. element name. XML Extended Markup Language
Tag defines start and end of an element: XQL XML Query Language XML parsers and other tools are available for all major

UTF-8 8-bit Unicode (def)


<alias>Neptune</alias> XSL Extensible Stylesheet language operating systems and programming languages

UTF-16 16-bit Unicode


Name: Begin with letter or "_" XLL XML linking language
XSD W3C Schema syntax World Wide Web Consortium (W3C) Create Schemas
Special characters:
&lt; < less than
&gt;
&amp;
&apos;
> greater than
& ampersand
' apostrophe or single quote <?xml version=“1.0” ?> XML
e Xtensible Markup Language Describing Data

&quot; " double quotes Declaration


&#… decimal character code
&#x… hexadecimal character code <!DOCTYPE name [
<P> The dollar is &gt; than the Ramd</P>
… Document
Attributes: ]> Definition
<name attribute="value">...
<WPSchaub alias="Neptune>
Comments:
<!-- This is a simple comment -->
<doc_root_element>
<data_element>
… Data
XDR Syntax (XML Data Reduced)
</data_element>
<Schema name="Rocket"
<ElementType name="Fin" content="eltOnly" order="one"> </doc_root_element>
<AttributeType name="Trian" type="string" required="yes"/
> HTTP is the data
<attribute type="Fin"/>
<element type ="weight"/>
request and response
</ElementType> protocol
</Schema>

eltonly
-----------------------
Contains elements only
document
document A node can contain child nodes or text
Invoke Procedures on
Simple Object Access Protocol
empty Can not have content Remote Systems
textOnly Can have text content only
mixed Can contain text and other elements root
rootnode
node Node lists
one Contain only one of the subelements listed
node
node
ElementType Declares an element and indicates content
AttributeType Declares an attribute node node
node
node Select a single child node with the specified ID
type Indicates type of data
node.nodeFromId( "3" ) SOAP Request (Example)
(boolean, string, float, int, number, date, char) node
node
required Indicates if attribute is required Select the first child node with the specified name POST /SomeAction HTTP/1.1
node.selectSingleNode( "weather" ) HOST: www.my-url.com
node
node Namespaces
DOM (Document Object Model) node Select all child nodes with the specified name Content-Type: text/xml
node node.selectNodes( "weather") Content-Length: nnnn
var objDoc = new ActiveXDocument("MSXML2.DOMDocument")
objDoc.async = false;
DOM node
node Select all child nodes
Namespaces are declared in the prolog of the XML document SOAPAction: SomeAction

node.childNodes <?xml:namespace ns="http://invent/schema/ns" prefix="inv"?> <SOAP-ENV:Envelope


xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/_
objDoc.loadXML("</news nuo="1">Movies are great!</news>");
if ( objDoc.parseError.errorCode != 0 ) envelope/"
“inv” is namespace prefix that is used to make document tags unique SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/_
{
soap/encoding/">
result += objDoc.parseError.errorCode + "\n"; XSL (Extensible Stylesheet Language) DTD Syntax <?xml version="1.0"?> <SOAP-ENV:Header>
result += objDoc.documentElement.nodeName + "\n"; <?xml:namespace ns=http://orders/schemaA/ns prefix=“a"?> <!-- The SOAP header element is optional... -->
result += objDoc.documentElement.text + "\n"; <!-- Process any XML document creating a hierarchical -- Elements <!ELEMENT … > </SOAP-ENV:Header>
<?xml:namespace ns=http://shipping/schemaB/nsprefix=“b"?>
} > Attributes <!ATTLIST …>
<example> <SOAP-ENV:Body>
<!-- view --> Entities <!ENTITY>
<a:quantity>100</a:quantity > <!-- Serialized object information... -->
result = rootElem.attributes.getNamedItem('no').nodeValue; 1 <?xml version="1.0" ?> Comments <!-- … -->
<b:quantity>50</b:quantity > </SOAP-ENV:Body>
2 <xsl:stylesheet </example>
var colScenes = rootElem.selectNodes("scene") 3 version="1.0" <!-- Optional sub-elements... -->
for ( i=0; i < colScenes.length; i++ ) 4 xml:space="default" </SOAP-ENV:Envelope>
{ 5 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> Internal DTD (Document Type Definition) Apply Style Sheet
result = colScenes.item(i).text; 6
} 7 <xsl:template match="node()"> <?xml version=“1.0”?> 'XML variables SOAP Response (Example)
8 <DIV STYLE="margin-left:12pt;"> Dim source As new MSXML.DomDocument
Dim srcroot As new MSXML. IXMLDOMElement 200 OK
9 [start <xsl:value-of select="name()"/>] <!DOCTYPE WEATHER [
Content-Type: text/xml
10 <xsl:apply-templates select="@*"/> <!ELEMENT WEATHER (DEGREES, DATE)> 'XSL variables Content-Length: nnnn
11 <xsl:apply-templates/> <!ELEMENT DEGREES (#PCDATA)> Dim style As new MSXML.DomDocument SOAPAction: SomeAction
12 [end <xsl:value-of select="name()"/>] <!ELEMENT DATE (#PCDATA) Dim styleroot As new MSXML. IXMLDOMElement
13 </DIV> ]> 'Load both documents and get roots Response content goes here ...
14 </xsl:template> source.load( "xmldata.xml" )
15 < WEATHER > Set srcroot = xmldoc.documentElement
16 <xsl:template match="@*"> <DEGREES>20.5</DEGREES> style.load(“xsldata.xsl”)
SOAP Tools
17 [attr <xsl:value-of select="name()"/>: <DATE>1999-08-17</DATE> Set styleroot = xsldoc.documentElement
18 <xsl:value-of select="."/>] </ WEATHER > ‘Transformed data as string to response X-Ray XML Editor by archiTAG.
19 </xsl:template> Response.write srcroot.transformNode( styleroot XML Authority Schema maintenance, www.extensibility.com
20 ) BizTalk Editor Schema maintenance

XML 21
22
23
<xsl:template match="text()">
<xsl:value-of select="."/>
</xsl:template>
External DTD (Document Type Definition)
BizTalk Mapper Map records (element) and fields (attribute)

BizTalk BizTalk Management Desk


BizTalk Server Administration Console
24 <<!DOCTYPE WEATHER SYSTEM “weather.dtd”>
BizTalk Document Tracking
25 </xsl:stylesheet> <!DOCTYPE catalog PUBLIC “-//weather//DTD Standard //EN” “http://www.weather.com/dtd/weather.dtd”> BizTalk Workflow Designer
BARONE BUDGE & DOMINICK (PTY) Ltd

You might also like