<?xml version="1.0" encoding="iso-8859-1" ?>
<rss version="2.0">
  <channel>
    <title>OmniXML support forum</title>
    <link>http://www.omnixml.com/support/index.php</link>
    <description><![CDATA[]]></description>
    <language>EN</language>
    <pubDate>Mon, 28 Jul 2008 18:53:30 +0200</pubDate>
    <lastBuildDate>Mon, 28 Jul 2008 18:53:30 +0200</lastBuildDate>
    <category>OmniXML support forum</category>
    <generator>Phorum 5.1.14</generator>
    <ttl>600</ttl>
    <item>
      <title>[Help] Re: Traversing an XML file</title>
      <link>http://www.omnixml.com/support/read.php?4,154,155#msg-155</link>
      <author>gabr</author>
      <description><![CDATA[Text (node data) is represented in a XML DOM as a node with name #text and type TEXT_NODE (integer 3).

OmniXML.pas defines following node types:

const
  // element node
  ELEMENT_NODE = 1;
  // attribute node
  ATTRIBUTE_NODE = 2;
  // text node
  TEXT_NODE = 3;
  // CDATA section node
  CDATA_SECTION_NODE = 4;
  // entity reference node
  ENTITY_REFERENCE_NODE = 5;
  // entity node
  ENTITY_NODE = 6;
  // processing instruction node
  PROCESSING_INSTRUCTION_NODE = 7;
  // comment node
  COMMENT_NODE = 8;
  // document node
  DOCUMENT_NODE = 9;
  // document type node
  DOCUMENT_TYPE_NODE = 10;
  // document fragment node
  DOCUMENT_FRAGMENT_NODE = 11;
  // notation node
  NOTATION_NODE = 12; 

Most probably you're only interested in types ELEMENT_NODE and ATTRIBUTE_NODE.

As an example, following code from OmniXMLUtils finds first child node of type TEXT_NODE to extract node text:

function GetTextChild(node: IXMLNode): IXMLNode;
var
  iText: integer;
begin
  Result := nil;
  for iText := 0 to node.ChildNodes.Length-1 do
    if node.ChildNodes.Item[iText].NodeType = TEXT_NODE then begin
      Result := node.ChildNodes.Item[iText];
      break; //for
    end;
end; { GetTextChild }]]></description>
      <category>Help</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?4,154,155#msg-155</guid>
      <pubDate>Mon, 28 Jul 2008 18:53:30 +0200</pubDate>
    </item>
    <item>
      <title>[Help] Traversing an XML file</title>
      <link>http://www.omnixml.com/support/read.php?4,154,154#msg-154</link>
      <author>Stefano Bragaglia</author>
      <description><![CDATA[I'd like to read an XML file and take different actions depending on the name of the nodes I read... I don't know the structure of the file in advance, so I have to &quot;check out&quot; the structure node by node...

I read the root node of the document with:
  Root := XMLDocument.DocumentElement;

I'd like to iterate through all the children of the root and, recursively, to all the children of the children and so on...

I tryed something like:

  Current := Root.FirstChild;
  while Assigned(Current) do
    begin
      // Take an action depending on name and recurse
      Current := Current.NextChild;
    end;

or similarly with

  Root.ChildNodes.Reset;
  Current := Root.ChildNodes.NextNode;
  while Assigned(Current) do
    begin
      // Take an action depending on name and recurse
      Current := Current.NextChild;
    end;
 
but it doesn't work as I expect... the child's node name I read is always &quot;#text&quot; (without quotes) no matter the real name is...

What am i doing wrong? Can someone point me out the right code I should use?

Thanks in advance, best wishes,
     Stefano Bragaglia]]></description>
      <category>Help</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?4,154,154#msg-154</guid>
      <pubDate>Mon, 28 Jul 2008 18:30:13 +0200</pubDate>
    </item>
    <item>
      <title>[Bug Reports] LoadFromStream doesn't work</title>
      <link>http://www.omnixml.com/support/read.php?2,153,153#msg-153</link>
      <author>Lee</author>
      <description><![CDATA[Hi, 

I've tried several times to load an xml document from a stream and it doesn't work.  

Example: 

ADoc := CreateXMLDoc;
AStream.Seek(0, soFromBeginning);

ADoc.LoadFromStream(AStream); // ]]></description>
      <category>Bug Reports</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?2,153,153#msg-153</guid>
      <pubDate>Tue, 22 Jul 2008 05:05:04 +0200</pubDate>
    </item>
    <item>
      <title>[Help] Re: Self-closing tags</title>
      <link>http://www.omnixml.com/support/read.php?4,151,152#msg-152</link>
      <author>mremec</author>
      <description><![CDATA[I am not sure I understand your question. However, XML tags are always closed automatically. Parser must understand both forms but it uses short form as output.]]></description>
      <category>Help</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?4,151,152#msg-152</guid>
      <pubDate>Thu, 26 Jun 2008 16:04:09 +0200</pubDate>
    </item>
    <item>
      <title>[Help] Self-closing tags</title>
      <link>http://www.omnixml.com/support/read.php?4,151,151#msg-151</link>
      <author>Mark</author>
      <description><![CDATA[How can I set tags to be self-closing:

ie:



becomes




or



to






Cheers]]></description>
      <category>Help</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?4,151,151#msg-151</guid>
      <pubDate>Mon, 23 Jun 2008 15:28:28 +0200</pubDate>
    </item>
    <item>
      <title>[Bug Reports] Re: More support needed for xPath</title>
      <link>http://www.omnixml.com/support/read.php?2,149,150#msg-150</link>
      <author>gabr</author>
      <description><![CDATA[Noted, but currently we have no plans for extending xPath.]]></description>
      <category>Bug Reports</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?2,149,150#msg-150</guid>
      <pubDate>Thu, 13 Mar 2008 08:06:17 +0100</pubDate>
    </item>
    <item>
      <title>[Bug Reports] More support needed for xPath</title>
      <link>http://www.omnixml.com/support/read.php?2,149,149#msg-149</link>
      <author>delphiForever</author>
      <description><![CDATA[Hi,

if you do //[@withthistag]

You should get all the nodes 'withthistag'

if you do

if you do //[@withthistag and @andthisone]

you should get all nodies 'withthistag' 'andthisone'

Yet, that isn't working.

also or isn't working and

  //[@withthistag=&quot;monkey&quot; and @andthisone=&quot;ape&quot;]

should work with and/or/not/ ...

I used to use XML partners and looking for a replacement becouse xmlparners doesn't work under delphi 2007, wich sux. :|

thanx.

Kind regards.]]></description>
      <category>Bug Reports</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?2,149,149#msg-149</guid>
      <pubDate>Thu, 13 Mar 2008 00:07:28 +0100</pubDate>
    </item>
    <item>
      <title>[Announcements] OmniXML release 2008-02-15</title>
      <link>http://www.omnixml.com/support/read.php?1,148,148#msg-148</link>
      <author>mremec</author>
      <description><![CDATA[I am pleased to announce that new release of OmniXML library is available. Big thanks to all contributors and users for feedback, bugfixes and general support. 

What's new in this release: 

* OmniXML.pas, OmniXML_Dictionary.pas: Added dictionary to store tag names, attribute names and attribute values. 
* OmniXML.pas: Fixed node type in IXMLDocumentType (reported by qrbn).
* OmniXML.pas: Fixed bug in FindCharReference (thanks to Andrej Zavrsnik for bug report and fix).
* OmniXMLXPath.pas: Fix: Parser was calling 8-bit versions of Pos and PosEx. Fixed PosEx to accept 16-bit parameters and added 16-bit version of Pos. (gp)
* OmniXML_Dictionary.pas: Delphi 7 compatibility fix.
* OmniXMLXPath.pas: Deleted reference to (not used) StrUtils unit.

For a list of all changes please see ChangeLog.txt. 

To compile OmniXML with Delphi 2005 or newer, use OmniXMLCore.dpk. This single package compiles with Delphi 2005 or newer. It defines LIBSUFFIX compiler directive depending on compiler version. As a result, after compile with Delphi 2006, you'll get OmniXMLCore.dcp and OmniXMLCore_BDS4.bpl files.]]></description>
      <category>Announcements</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?1,148,148#msg-148</guid>
      <pubDate>Fri, 15 Feb 2008 10:03:46 +0100</pubDate>
    </item>
    <item>
      <title>[Help] Re: Problems installing</title>
      <link>http://www.omnixml.com/support/read.php?4,56,147#msg-147</link>
      <author>mremec</author>
      <description><![CDATA[OmniXMLXPath.pas references StrUtils which appeared in Delphi 6. However, it seems that the reference is not needed because test program compiles without any errors even if I delete this reference.

So, open OmniXMLXPath.pas, search for StrUtils and delete it. Then, it should compile in D5 also.]]></description>
      <category>Help</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?4,56,147#msg-147</guid>
      <pubDate>Fri, 15 Feb 2008 09:18:05 +0100</pubDate>
    </item>
    <item>
      <title>[Help] Re: Problems installing</title>
      <link>http://www.omnixml.com/support/read.php?4,56,146#msg-146</link>
      <author>VM</author>
      <description><![CDATA[upon installing the package at DELPHI 5, it keep on lookin the strutils.dcu

Where i can find it.

thanks

venn]]></description>
      <category>Help</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?4,56,146#msg-146</guid>
      <pubDate>Fri, 15 Feb 2008 02:36:47 +0100</pubDate>
    </item>
    <item>
      <title>[Help] Re: How access directly to these nodes ?</title>
      <link>http://www.omnixml.com/support/read.php?4,140,145#msg-145</link>
      <author>Bruno</author>
      <description><![CDATA[oh yess ! Thank's a lot

Sincerely,
Bruno]]></description>
      <category>Help</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?4,140,145#msg-145</guid>
      <pubDate>Thu, 24 Jan 2008 23:52:57 +0100</pubDate>
    </item>
    <item>
      <title>[Help] Re: How access directly to these nodes ?</title>
      <link>http://www.omnixml.com/support/read.php?4,140,144#msg-144</link>
      <author>gabr</author>
      <description><![CDATA[Better:

var
  node: IXMLNode;

node := SelectNode(nodeList.Item[iNode], './name/fullName');
if assigned(node) then
  fullName := GetTextChild(node).Text
else
  fullName := '';]]></description>
      <category>Help</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?4,140,144#msg-144</guid>
      <pubDate>Thu, 24 Jan 2008 15:25:30 +0100</pubDate>
    </item>
    <item>
      <title>[Help] Re: How access directly to these nodes ?</title>
      <link>http://www.omnixml.com/support/read.php?4,140,143#msg-143</link>
      <author>Bruno</author>
      <description><![CDATA[Just for information, the GetTextChild do an error if the node doesn't exists.

So I use :

Try
  fullName := GetTextChild(SelectNode(nodeList.Item[iNode], './name/fullName')).Text;
Except
  fullname:='';
End;]]></description>
      <category>Help</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?4,140,143#msg-143</guid>
      <pubDate>Thu, 24 Jan 2008 15:12:51 +0100</pubDate>
    </item>
    <item>
      <title>[Help] Re: How access directly to these nodes ?</title>
      <link>http://www.omnixml.com/support/read.php?4,140,142#msg-142</link>
      <author>Bruno</author>
      <description><![CDATA[You are GREAT !

Many thank's for your quick reply !

Bruno]]></description>
      <category>Help</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?4,140,142#msg-142</guid>
      <pubDate>Wed, 23 Jan 2008 18:34:26 +0100</pubDate>
    </item>
    <item>
      <title>[Help] Re: How access directly to these nodes ?</title>
      <link>http://www.omnixml.com/support/read.php?4,140,141#msg-141</link>
      <author>gabr</author>
      <description><![CDATA[The simplest way is to use OmniXMLUtils and do

  for iNode := 0 to nodeList.Length - 1 do begin
    fullName := GetTextChild(SelectNode(nodeList.Item[iNode], './name/fullName')).Text;
    country := GetTextChild(SelectNode(nodeList.Item[iNode], './address/country')).Text;
  end;]]></description>
      <category>Help</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?4,140,141#msg-141</guid>
      <pubDate>Wed, 23 Jan 2008 08:02:16 +0100</pubDate>
    </item>
    <item>
      <title>[Help] How access directly to these nodes ?</title>
      <link>http://www.omnixml.com/support/read.php?4,140,140#msg-140</link>
      <author>Bruno</author>
      <description><![CDATA[Hi all,

I've this XML structure, and I use D7. I try to extract directly the fullname and the Country. Is it a way to do that directly ?



.....

  
    
	Ericsson Inc.
    
    
       Research Triangle Park
       NC
       US
       UNITED STATES
    
  


I've done :
....
  nodeList := XPathSelect(CurrentNode, './bibliographicInformation/assignees/assignee');
  if nodeList.Length&gt;0 then
    for iNode:=0 to nodeList.Length-1 do
    Begin
       // WHAT MUST I DO HERE TO EXTRACT FULLNAME AND COUNTRY ?
    end;
......


Many thank's for your help

Bruno]]></description>
      <category>Help</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?4,140,140#msg-140</guid>
      <pubDate>Tue, 22 Jan 2008 23:58:15 +0100</pubDate>
    </item>
    <item>
      <title>[Bug Reports] Re: The unicode surrogate code points are not handled</title>
      <link>http://www.omnixml.com/support/read.php?2,124,139#msg-139</link>
      <author>alphax</author>
      <description><![CDATA[I am sorry, the last statement should be changed to:

if not Doc.Load(FN) then
  raise Exception.Create('Parse document failed');]]></description>
      <category>Bug Reports</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?2,124,139#msg-139</guid>
      <pubDate>Sat, 12 Jan 2008 13:44:06 +0100</pubDate>
    </item>
    <item>
      <title>[Help] Re: Getting the value</title>
      <link>http://www.omnixml.com/support/read.php?4,136,138#msg-138</link>
      <author>Richard S</author>
      <description><![CDATA[Thank you very much indeed, that does exactly what I want.]]></description>
      <category>Help</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?4,136,138#msg-138</guid>
      <pubDate>Sat, 12 Jan 2008 01:03:12 +0100</pubDate>
    </item>
    <item>
      <title>[Help] Re: Getting the value</title>
      <link>http://www.omnixml.com/support/read.php?4,136,137#msg-137</link>
      <author>gabr</author>
      <description><![CDATA[The simplest way:

uses OmniXML, OmniXMLUtils;

var xml: IXMLDocument;

... load the xml

s := GetTextChild(xml.SelectSingleNode('/Unit')).Text; // 'Part Ground Floor'
s := GetTextChild(xml.SelectSingleNode('/Unit/Area')).Text; // 'Retail']]></description>
      <category>Help</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?4,136,137#msg-137</guid>
      <pubDate>Fri, 11 Jan 2008 14:38:42 +0100</pubDate>
    </item>
    <item>
      <title>[Help] Getting the value</title>
      <link>http://www.omnixml.com/support/read.php?4,136,136#msg-136</link>
      <author>Richard S</author>
      <description><![CDATA[Hi - probably a silly basic question, but what's the best way to extract the values &quot;Part Ground Floor&quot; from  and &quot;Retail&quot; from  from the snippet below? I find getting attributes very straightforward, but extracting the values is currently defeating me.


  {BFB68548-81CA-4E90-A34A-B7D2324FE5CE}
  Part Ground Floor  
  
  {631A2448-7315-4183-924D-B9CFBD410A9F}
  Retail]]></description>
      <category>Help</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?4,136,136#msg-136</guid>
      <pubDate>Fri, 11 Jan 2008 13:56:25 +0100</pubDate>
    </item>
    <item>
      <title>[Bug Reports] Re: OmniXMLPath.XPathSelect() implementation should NOT use Ansi edtion Pos()</title>
      <link>http://www.omnixml.com/support/read.php?2,134,135#msg-135</link>
      <author>gabr</author>
      <description><![CDATA[I fully agree - this is a bug. I'll fix the CVS version today.]]></description>
      <category>Bug Reports</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?2,134,135#msg-135</guid>
      <pubDate>Thu, 10 Jan 2008 18:02:19 +0100</pubDate>
    </item>
    <item>
      <title>[Bug Reports] OmniXMLPath.XPathSelect() implementation should NOT use Ansi edtion Pos()</title>
      <link>http://www.omnixml.com/support/read.php?2,134,134#msg-134</link>
      <author>alphax</author>
      <description><![CDATA[The methods TXMLXPathEvaluator.GetNextExpressionPart() and TXMLXPathEvaluator.SplitExpression() both are use Ansi-edition Pos() function for locate the char index, but the input parameter are WideStrings, so, the postion returned by Pos() could not be used to access the the wide string, if some multibytes character contained in that wide string.

for example:

endElement := PosEx('/', FExpression, FPosExpression); 
...
element := Copy(FExpression, FPosExpression, endElement - FPosExpression);

endElement just the position of the ansi-edition of the FExpression, if FExpression contains multibytes character(in the attribute value expression), the Copy() call in the next statement will return incorrect result.

So, I think, all Pos() call and all PosEx() call should be replaced to the wide-edition call.

TXMLXPathEvaluator.PosEx() should be declared as:
function PosEx(ch: WideChar; const s: WideString; offset: integer = 1): integer;

and we should introduce a 
function TXMLXPathEvaluator.Pos(Ch: WideChar; const S: WideString): Integer;]]></description>
      <category>Bug Reports</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?2,134,134#msg-134</guid>
      <pubDate>Thu, 10 Jan 2008 13:51:05 +0100</pubDate>
    </item>
    <item>
      <title>[Bug Reports] Re: The unicode surrogate code points are not handled</title>
      <link>http://www.omnixml.com/support/read.php?2,124,133#msg-133</link>
      <author>alphax</author>
      <description><![CDATA[Ok, I am make a sample code which can reproduce this problem.


//Code copy from OpenXML\Utilities\cUnicodeCodecs.pas and modified
procedure UCS4CharToUTF8(const Ch: UCS4Char; const Dest: Pointer;
    const DestSize: Integer; out SeqSize: Integer);
var P : PByte;
begin
  P := Dest;
  if Ch &lt; $80 then // US-ASCII (1-byte sequence)
    begin
      SeqSize := 1;
      if not Assigned(P) or (DestSize ]]></description>
      <category>Bug Reports</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?2,124,133#msg-133</guid>
      <pubDate>Wed,  9 Jan 2008 06:35:15 +0100</pubDate>
    </item>
    <item>
      <title>[Bug Reports] Re: The unicode surrogate code points are not handled</title>
      <link>http://www.omnixml.com/support/read.php?2,124,132#msg-132</link>
      <author>mremec</author>
      <description><![CDATA[I'm sorry, I somehow forgot to answer your first mail.

Can you please send a sample document that shows this problem to mremec@gmail.com? Many thanks in advance.]]></description>
      <category>Bug Reports</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?2,124,132#msg-132</guid>
      <pubDate>Wed, 26 Dec 2007 10:54:02 +0100</pubDate>
    </item>
    <item>
      <title>[Bug Reports] Re: The unicode surrogate code points are not handled</title>
      <link>http://www.omnixml.com/support/read.php?2,124,131#msg-131</link>
      <author>alphax</author>
      <description><![CDATA[Has any plan for fix this problem?]]></description>
      <category>Bug Reports</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?2,124,131#msg-131</guid>
      <pubDate>Tue, 25 Dec 2007 13:24:36 +0100</pubDate>
    </item>
    <item>
      <title>[Help] Re: GetElementsByTagName</title>
      <link>http://www.omnixml.com/support/read.php?4,128,130#msg-130</link>
      <author>Peter Gore</author>
      <description><![CDATA[Thanks Miha, that's a lot clearer.
Regards
Peter Gore]]></description>
      <category>Help</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?4,128,130#msg-130</guid>
      <pubDate>Thu, 20 Dec 2007 17:06:04 +0100</pubDate>
    </item>
    <item>
      <title>[Help] Re: GetElementsByTagName</title>
      <link>http://www.omnixml.com/support/read.php?4,128,129#msg-129</link>
      <author>mremec</author>
      <description><![CDATA[NodeName is a property of IXMLNode and all child interfaces. IXMLElement defines additional property TagName, that returns the same value as NodeName property.
Function GetElementsByTagName does what its name tells: it returns elements (IXMLElement) by tag names.

Please open http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core.html#ID-1950641247 and navigate one or two pages down to table that describes nodeName, nodeValue and attributes return values according to node type. There you will see that NodeName for Element (IXMLElement) returns tag name.

And yes, line 2657 could (should) be better as follows:
if (ChildNode.NodeType = ELEMENT_NODE) and ((ChildNode as IXMLElement).TagName = Name) then 
Result.AddNode(ChildNode);]]></description>
      <category>Help</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?4,128,129#msg-129</guid>
      <pubDate>Thu, 20 Dec 2007 08:41:23 +0100</pubDate>
    </item>
    <item>
      <title>[Help] GetElementsByTagName</title>
      <link>http://www.omnixml.com/support/read.php?4,128,128#msg-128</link>
      <author>Peter Gore</author>
      <description><![CDATA[This function actually seems to evaluate against NodeName rather than TagName.

Line 2657 of OmniXML refers
if (ChildNode.NodeType = ELEMENT_NODE) and ((ChildNode as IXMLElement).NodeName = Name) then
          Result.AddNode(ChildNode);

TagName in my testing is read only and always equal to the root Element Name.

Should it therefore not be GetElementsByNodeName?

Regards
Peter Gore]]></description>
      <category>Help</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?4,128,128#msg-128</guid>
      <pubDate>Thu, 20 Dec 2007 08:07:26 +0100</pubDate>
    </item>
    <item>
      <title>[Help] Re: IXMLNode and IXMLElement</title>
      <link>http://www.omnixml.com/support/read.php?4,125,127#msg-127</link>
      <author>Peter Gore</author>
      <description><![CDATA[OK thanks a lot]]></description>
      <category>Help</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?4,125,127#msg-127</guid>
      <pubDate>Thu, 20 Dec 2007 05:48:03 +0100</pubDate>
    </item>
    <item>
      <title>[Help] Re: IXMLNode and IXMLElement</title>
      <link>http://www.omnixml.com/support/read.php?4,125,126#msg-126</link>
      <author>mremec</author>
      <description><![CDATA[In short, IXMLElement inherits from IXMLNode and defines additional properties and methods.]]></description>
      <category>Help</category>
      <guid isPermaLink="true">http://www.omnixml.com/support/read.php?4,125,126#msg-126</guid>
      <pubDate>Wed, 19 Dec 2007 20:02:06 +0100</pubDate>
    </item>
  </channel>
</rss>
