<?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>Wizard Software - All things Delphi (and some PHP) &#187; code</title>
	<atom:link href="http://wizard-soft.com/blog/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://wizard-soft.com/blog</link>
	<description>Delphi, Pascal, PHP, programming and (Wizard) Software</description>
	<lastBuildDate>Tue, 01 Dec 2009 06:36:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Sample function for reading XML node value</title>
		<link>http://wizard-soft.com/blog/2008/01/02/sample-function-for-reading-xml-node-value/</link>
		<comments>http://wizard-soft.com/blog/2008/01/02/sample-function-for-reading-xml-node-value/#comments</comments>
		<pubDate>Wed, 02 Jan 2008 10:23:10 +0000</pubDate>
		<dc:creator>Softy</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://wizard-soft.com/blog/?p=7</guid>
		<description><![CDATA[I&#8217;ve had many problems using the IXMLDocument object, mostly related to different versions of the .net redistributable installed on different machines. So, I wrote a short function that extracts a node value from the passed XML string:
function GetNodeVal(sNode, sXML : string) : string ;
{This function extracts the specified xml node's value from the XML string}

var
 [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had many problems using the IXMLDocument object, mostly related to different versions of the .net redistributable installed on different machines. So, I wrote a short function that extracts a node value from the passed XML string:</p>
<pre>function GetNodeVal(sNode, sXML : string) : string ;
{This function extracts the specified xml node's value from the XML string}

var
  iPos : integer ;
  sValue : string ;

begin
  iPos := Pos('&lt;'+ sNode + '&gt;', sXML) ;

  if iPos = 0 then
  begin
    iPos := Pos('&lt;'+ Lowercase(sNode) + '&gt;', sXML) ;

    if iPos = 0 then
    begin
      result := 'Error:Globals.GetNodeVal' ;
      exit ;
    end;
  end;

  sValue := Copy(sXML, iPos + 2 + Length(sNode), 255) ;

  iPos := Pos('&lt;/' + sNode + '&gt;', sValue) ;

  if iPos = 0 then
  begin
    iPos := Pos('&lt;/'+ Lowercase(sNode) + '&gt;', sValue) ;

    if iPos = 0 then
    begin
      result := 'Error:Globals.GetNodeVal' ;
      exit ;
    end;
  end;

  sValue := Copy(sValue, 1, iPos -1) ;
  result := sValue ;
end;</pre>
]]></content:encoded>
			<wfw:commentRss>http://wizard-soft.com/blog/2008/01/02/sample-function-for-reading-xml-node-value/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

