<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Integration Engineer &#187; XML</title>
	<atom:link href="http://www.theintegrationengineer.com/category/xml/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.theintegrationengineer.com</link>
	<description>When it just has to work.</description>
	<lastBuildDate>Tue, 27 Jul 2010 17:33:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Understanding X Path</title>
		<link>http://www.theintegrationengineer.com/understanding-x-path/</link>
		<comments>http://www.theintegrationengineer.com/understanding-x-path/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 13:56:45 +0000</pubDate>
		<dc:creator>Roy</dc:creator>
				<category><![CDATA[Xpath]]></category>
		<category><![CDATA[X path]]></category>
		<category><![CDATA[X query]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[xquery]]></category>

		<guid isPermaLink="false">http://www.theintegrationengineer.com/?p=135</guid>
		<description><![CDATA[If you are going to work with XML, you will need to understand Xpath.  Xpath is the syntax by which elements or data inside an XML file are referenced.  Parsers and XSLT use Xpath so that they can find the data that needs to be parsed or transformed.  If you understand the fundamentals of XML [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-681" title="path_pzl" src="http://www.theintegrationengineer.com/wp-content/uploads/2009/09/path_pzl.JPG" alt=" Understanding X Path" width="188" height="125" />If you are going to work with XML, you will need to understand Xpath.  Xpath is the syntax by which elements or data inside an XML file are referenced.  Parsers and XSLT use Xpath so that they can find the data that needs to be parsed or transformed.  If you understand the fundamentals of XML and how it is formed, understanding Xpath is a logical next step.  This is a brief explanation of how Xpath works and how it is used.<span id="more-135"></span></p>
<p><strong>Xpath</strong></p>
<p>Xpath is positional in its syntax.  This means that an Xpath expressions walks the parser from node to sub-node to the point where the data is located.  Xpath expressions can look like this $data = /header/doc/date so that the parser knows that whatever is found in the relational location is assigned to the variable $date.</p>
<p>Here is an example XML file that I made up for this discussion:</p>
<address>&lt;?XML&gt;</address>
<address style="padding-left: 30px;">&lt;Header&gt;</address>
<address style="padding-left: 60px;">&lt;Doc&gt;</address>
<address style="padding-left: 90px;">&lt;Date&gt;September 1, 2004&lt;/Date&gt;</address>
<address style="padding-left: 90px;">&lt;Time&gt;11:00:00&lt;/Time&gt;</address>
<address style="padding-left: 90px;">&lt;Sender&gt;</address>
<address style="padding-left: 120px;">&lt;Ident&gt;999999999&lt;/Ident&gt;</address>
<address style="padding-left: 90px;">&lt;/Sender&gt;</address>
<address style="padding-left: 90px;">&lt;Receiver&gt;</address>
<address style="padding-left: 120px;">&lt;Ident&gt;111111111&lt;/Ident&gt;</address>
<address style="padding-left: 90px;">&lt;/Receiver&gt;</address>
<address style="padding-left: 60px;">&lt;/Doc&gt;</address>
<address style="padding-left: 60px;">&lt;PayloadID&gt;1481094801384021384&lt;/PayloadID&gt;</address>
<address style="padding-left: 30px;">&lt;/Header&gt;</address>
<address style="padding-left: 30px;">&lt;Body&gt;</address>
<address style="padding-left: 60px;">&lt;LineItem&gt;</address>
<address style="padding-left: 90px;">&lt;LineNumber&gt;1&lt;/LineNumber&gt;</address>
<address style="padding-left: 90px;">&lt;PartNumber&gt;123ABC&lt;/PartNumber&gt;</address>
<address style="padding-left: 90px;">&lt;Price&gt;1.00&lt;/Price&gt;<br />
</address>
<address style="padding-left: 60px;">&lt;/LineItem&gt;</address>
<address style="padding-left: 60px;">&lt;LineItem&gt;</address>
<address style="padding-left: 90px;">&lt;LineNumber&gt;2&lt;/LineNumber&gt;</address>
<address style="padding-left: 90px;">&lt;PartNumber&gt;!VC456&lt;/PartNumber&gt;</address>
<address style="padding-left: 90px;">&lt;Price&gt;2.00&lt;/Price&gt;</address>
<address style="padding-left: 60px;">&lt;/LineItem&gt;</address>
<address style="padding-left: 60px;">&lt;LineItem&gt;</address>
<address style="padding-left: 90px;">&lt;LineNumber&gt;3&lt;/LineNumber&gt;</address>
<address style="padding-left: 90px;">&lt;PartNumber&gt;8675309&lt;/PartNumber&gt;</address>
<address style="padding-left: 90px;">&lt;Price&gt;4.00&lt;/Price&gt;</address>
<address style="padding-left: 60px;">&lt;/LineItem&gt;</address>
<address style="padding-left: 30px;">&lt;/Body&gt;</address>
<address>&lt;/XML&gt;</address>
<address> </address>
<address> </address>
<p>Using this example, we can illustrate using Xpath with and expression that says, &#8220;Total of item prices&#8221; and we can say that with Xpath like this, &#8220;$total = sum(/XML/Body/LineItem/Price)&#8221; where each value fitting the path, will be totalled and then assigned to the &#8220;$total&#8221; variable.  In our example file this would be 7.00.  (Those familiar with XML will notice that none of my nodes have any attributes.  This is just the beginning.  And those with no familiarity with XML will still notice that our price has no curency.  This would normally be held in an attribute.)</p>
<p><strong>Sounds Easy</strong></p>
<p>This is supposed to be an easy example.  We haven&#8217;t talked about attributes where some tags will not just delimit data, but contain it.  (for example what if we changed the schema of the line to look like this. &#8220;&lt;LineItem LineNumber=&#8221;"&gt; and thus eliminated the need for the &lt;LineNumber&gt; tagged value?  How does this help us use XM?)  And we haven&#8217;t talked about DTD or Schema files that help a parser understand the XML file layout.  And we haven&#8217;t talked about validation, or scope, or a few other nice and powerful parts of XML that you will run into.  (Maybe next time.)</p>
<address> </address>
<address> </address>
]]></content:encoded>
			<wfw:commentRss>http://www.theintegrationengineer.com/understanding-x-path/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is XML</title>
		<link>http://www.theintegrationengineer.com/what-is-xml/</link>
		<comments>http://www.theintegrationengineer.com/what-is-xml/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 13:45:24 +0000</pubDate>
		<dc:creator>Roy</dc:creator>
				<category><![CDATA[XML]]></category>
		<category><![CDATA[DTD]]></category>
		<category><![CDATA[Extensible Mark-up Language]]></category>
		<category><![CDATA[hiarchy]]></category>
		<category><![CDATA[Node]]></category>
		<category><![CDATA[schema]]></category>
		<category><![CDATA[Tag]]></category>

		<guid isPermaLink="false">http://www.theintegrationengineer.com/?p=104</guid>
		<description><![CDATA[One of the common data formats that we encounter today is XML.  This could be just plane XML, or any of the standardized versions; cXML, ebXML, etc.  But there are some basic commonalities between these.  And if you haven&#8217;t dealt with XML much, you will need to know something about it sooner or later.  This [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-130" title="xml-tag" src="http://www.theintegrationengineer.com/wp-content/uploads/2009/05/xml-tag.jpg" alt="xml tag What is XML" width="125" height="87" />One of the common data formats that we encounter today is XML.  This could be just plane XML, or any of the standardized versions; cXML, ebXML, etc.  But there are some basic commonalities between these.  And if you haven&#8217;t dealt with XML much, you will need to know something about it sooner or later.  This post is a brief introduction.<span id="more-104"></span><br />
<br /><strong>What is XML</strong>:   XML stands for Extensible Mark-up Language.  Unlike Delimited Files, Fixed Width Files or EDI, XML data is defined by Nodes and or Tags.  Tags look like this:  &lt;TAG&gt;<em>some data here</em>&lt;/TAG&gt;  and in this way the tags indicate the beginning and ending of the data.  Tags have a beginning and and ending tag with the exception of usage like this: &lt;TAG/&gt; that indicates that this tag is just holding the place for a node that has no data, but is required to be present.</p>
<p><strong>Basic Structure of XML files: </strong>The basic structure is simple.  There are tags .  Tags surround data,  or other tags.  Like this:</p>
<p>&lt;xml&gt;</p>
<p style="padding-left: 30px;">&lt;header&gt;This is the Header Data&lt;/header&gt;</p>
<p style="padding-left: 30px;">&lt;body&gt;This is the body.&lt;/body&gt;</p>
<p>&lt;/xml&gt;</p>
<p>Tags are used to define the data that they contain.  And by using tags in a hierarchical manger we can have simple definitions for data, that are grouped to create more complex structures.  Like this:</p>
<p>&lt;xml&gt;</p>
<p style="padding-left: 30px;">&lt;sender&gt;</p>
<p style="padding-left: 60px;">&lt;name&gt;</p>
<p style="padding-left: 90px;">&lt;first&gt;John&lt;/first&gt;</p>
<p style="padding-left: 90px;">&lt;last&gt;Doe&lt;/last&gt;</p>
<p style="padding-left: 90px;">&lt;middle&gt;C&lt;/middle&gt;</p>
<p style="padding-left: 60px;">&lt;/name&gt;</p>
<p style="padding-left: 60px;">&lt;address/&gt;</p>
<p style="padding-left: 30px;">&lt;/sender&gt;</p>
<p>&lt;/xml&gt;</p>
<p>We could have done this:</p>
<p>&lt;xml&gt;</p>
<p style="padding-left: 30px;">&lt;senderFirstName&gt;John&lt;/senderFirstName&gt;</p>
<p style="padding-left: 30px;">&lt;senderLastName&gt;Doe&lt;/senderLastName&gt;</p>
<p style="padding-left: 30px;">&lt;senderMiddleName&gt;C&lt;/senderMiddleName&gt;</p>
<p>&lt;xml&gt;</p>
<p>But this seems like an odd way to do it.  By having a tag that is just &lt;name&gt; we can define the definition for that tag once, and then everywhere we use &lt;name&gt; we know there can be a &lt;first&gt; &lt;last&gt; and &lt;middle&gt; that contain text.  And we can reuse name not only for the sender, but in other places as well.  The definition for the tag can be held in a DTD or Schema document that defines the structure and contents of the XML file.  The DTD or Schema document lets a parser or validator know how to read the file, and what tags contain numbers, text, currency, etc. <em> We&#8217;ll get into DTDs and Schemas more in a later post.</em></p>
<p><strong>Types and Usage</strong></p>
<p>We mentioned a couple of types of XML.  XML itself can be freely defined just like a flat file.  There is no body of standards for XML like there is on X12 EDI.  You can make up your own format and tags for your XML files as you go along, and in the way that best fits your business processes and data storage needs.</p>
<p>And with this you need to understand what XML does.  XML doesn&#8217;t do anything.  It just stores data.  HTML, another &#8220;Mark-up Language&#8221; does something.  It presents data.  But XML does not, it only stores the data.  (Just like a flat file or EDI file.  They just sit and hold the data that we put into them.)  Some XML is used to transport data,  but the XML is only the container, it does not do any transport work.  Thus creating an ebXML file used to transport data, doesn&#8217;t make it go anywhere.</p>
<p><strong>E-commerce</strong></p>
<p>Due to its flexibility, XML and its various versions are getting a lot of attention in the e-commerce world.  There is no doubt that used with internal applications, XML can become far superior to Flat File, and standards like X12 EDI.  <strong> </strong>A greater challenge is in its use between companies.</p>
<p>Many supply chain partners have adopted an XML standard, but aren&#8217;t able to communicate with people that have a different XML standard.  As time goes on, there will be some more solid standards of usage for XML that will help solve this problem.  And of course, that well defined standard of XML will no longer be as flexible as XML is today.</p>
<p><strong>Things to know.</strong></p>
<ul>
<li>You will need to know the basics of XML, how it works and be able to eveluate if it is a good fit for a solution to your integration challenge.</li>
<li>XML is called a &#8220;human readable format&#8221; mostly because the data is structured in tags that use english.  Thus you don&#8217;t have to have the standard memorized or handy to find phone numbers, names and prices where they are in tags like &lt;phoneNumber&gt;, &lt;name&gt; and &lt;unitPrice&gt;.</li>
<li>XML is not a slim format.  Using Tags as structure and delimiter makes data bigger, and sometimes makes it look more complex that it would in a simple set of rows.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.theintegrationengineer.com/what-is-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
