Jump to content

Tommi Prami

Members
  • Content Count

    62
  • Joined

  • Last visited

Community Reputation

10 Good

Technical Information

  • Delphi-Version
    Delphi 10.2 Tokyo

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Tommi Prami

    Design Packages list is not resizable

    That windows desperately needs an filtering, it is very hard to find stuff from it. Adn sometimes important info is not at beginning nor end of the line.
  2. If got link to Bugreport, would be more than willing to vote. -Tee-
  3. Tommi Prami

    Trouble with (very) simple XML-parsing

    Did test with Xml.XMLIntf.pas IXMLDocument also. OmniXML as vendor or not. Made own recursive routine, based on OmniXML implementation, it'll find nodes just fine, but not node Values, which seems to be super weird. function GetElementsByTagName(const ADocumentElement: IDOMElement; const AElementName: string): TList<IDOMNode>; procedure InternalGetElementsByTagName(const ANode: IDOMNode; const AElementName: string; const ANodeList: TList<IDOMNode>); var I: Integer; LChildNode: IDOMNode; begin if ANode.HasChildNodes then for I := 0 to ANode.ChildNodes.Length - 1 do begin LChildNode := ANode.ChildNodes.Item[I]; if (LChildNode.NodeType = ELEMENT_NODE) and ((LChildNode as IDOMElement).NodeName = AElementName) then ANodeList.Add(LChildNode); InternalGetElementsByTagName(LChildNode, AElementName, ANodeList); end; end; begin Result := TList<IDOMNode>.Create; InternalGetElementsByTagName(ADocumentElement, AElementName, Result); end;
  4. Tommi Prami

    Trouble with (very) simple XML-parsing

    First test was there just to get an idea is there one and which it'll use. IT seems to depend on something. Done so many tests so can't really give specifics on that. At least that xpath down work, because structure of XML is not always same. It has to be more structure agnostic.
  5. Tommi Prami

    Trouble with (very) simple XML-parsing

    At least all the documentation I've found tells that it should. find others also. m$xml docs and also more generic DOM ones. What ever is the implementation is totally different story. -Tee-
  6. Tommi Prami

    Trouble with (very) simple XML-parsing

    With OmniXML dom I got slightly closer procedure TForm10.Button2Click(Sender: TObject); var LXMlDocument: IXMLDocument; LDomList: IDOMNodeList; LValueNode: IDOMNode; I: Integer; begin DefaultDOMVendor := sOmniXmlVendor; LXMlDocument := LoadXMLData(Memo1.Lines.Text); LDomList := LXMlDocument.DOMDocument.documentElement.getElementsByTagName(TAG_IBAN); for I := 0 to LDomList.length - 1 do begin LValueNode := LDomList[I]; Memo2.Lines.Add(LValueNode.nodeName + ': ' + LValueNode.nodeValue); end; end; it find the tags, but nodeValue returns empty. -Tee-
  7. (I use 10.3.1) If got an code : uses Winapi.msxml, Winapi.MSXMLIntf; procedure TForm10.Button1Click(Sender: TObject); var LDocument: IXMLDomDocument3; LCurrrentValueNode: IXMLDOMNode; LNodeList: IXMLDOMNodeList; I: Integer; begin LDocument := CoDOMDocument60.Create; LDocument.async := False; LDocument.validateOnParse := False; LDocument.ResolveExternals := False; LDocument.PreserveWhiteSpace := True; LDocument.loadXML(Memo1.Lines.Text); if LDocument.parseError.errorCode <> 0 then raise Exception.CreateFmt('XML parsing error : %s at row %d position %d', [LDocument.parseError.reason, LDocument.parseError.Line, LDocument.parseError.linepos]); if Assigned(LDocument.documentElement) then LNodeList := LDocument.documentElement.getElementsByTagName('IBAN') else LNodeList := LDocument.getElementsByTagName('IBAN'); for I := 0 to LNodeList.Length - 1 do begin LCurrrentValueNode := LNodeList.Item[I]; Memo2.Lines.Add(LCurrrentValueNode.nodeValue); end; repeat LCurrrentValueNode := LNodeList.nextNode; if Assigned(LCurrrentValueNode) then Memo2.Lines.Add(LCurrrentValueNode.nodeValue) else Break; until True; end; and XML <?xml version="1.0" encoding="UTF-8"?> <Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.053.001.02"> <BkToCstmrStmt> <Stmt> <Acct> <Id> <IBAN>FI0434270410003403</IBAN> </Id> </Acct> </Stmt> <Stmt> <Acct> <Id> <IBAN>FI7542316072000169</IBAN> </Id> </Acct> </Stmt> </BkToCstmrStmt> </Document> Any idea why getElementsByTagName does not return Tags it should (I think). Once you're set to do something pretty simple and nothing works. I remember now why I do not enjoy the M$Xml too much. Also if you can recommend better replacement XML libraries, feel free to do so.
  8. Tommi Prami

    Troubled relationship with m$Xml

    Wrong Group... Sorry
  9. Tommi Prami

    Troubled relationship with m$Xml

    If got an code : uses Winapi.msxml, Winapi.MSXMLIntf; procedure TForm10.Button1Click(Sender: TObject); var LDocument: IXMLDomDocument3; LCurrrentValueNode: IXMLDOMNode; LNodeList: IXMLDOMNodeList; I: Integer; begin LDocument := CoDOMDocument60.Create; LDocument.async := False; LDocument.validateOnParse := False; LDocument.ResolveExternals := False; LDocument.PreserveWhiteSpace := True; LDocument.loadXML(Memo1.Lines.Text); if LDocument.parseError.errorCode <> 0 then raise Exception.CreateFmt('XML parsing error : %s at row %d position %d', [LDocument.parseError.reason, LDocument.parseError.Line, LDocument.parseError.linepos]); if Assigned(LDocument.documentElement) then LNodeList := LDocument.documentElement.getElementsByTagName('IBAN') else LNodeList := LDocument.getElementsByTagName('IBAN'); for I := 0 to LNodeList.Length - 1 do begin LCurrrentValueNode := LNodeList.Item[I]; Memo2.Lines.Add(LCurrrentValueNode.nodeValue); end; repeat LCurrrentValueNode := LNodeList.nextNode; if Assigned(LCurrrentValueNode) then Memo2.Lines.Add(LCurrrentValueNode.nodeValue) else Break; until True; end; and XML <?xml version="1.0" encoding="UTF-8"?> <Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.053.001.02"> <BkToCstmrStmt> <Stmt> <Acct> <Id> <IBAN>FI0434270410003403</IBAN> </Id> </Acct> </Stmt> <Stmt> <Acct> <Id> <IBAN>FI7542316072000169</IBAN> </Id> </Acct> </Stmt> </BkToCstmrStmt> </Document> Any idea why getElementsByTagName doews not return Tags it should (I think). Once you're set to do something pretty simple and nothing works. I remember now why I do not enjoy the M$Xml too much. Also if you can recommend better replacement XML libraries, feel free to do so.
  10. Tommi Prami

    Rapid generics

    Please don't hijack the conversation to offtopic.
  11. "Our current LTS release is 1.0.2, and it will be supported until the end of 2019." Seems that 1.0.x is close at its end of life. -Tee-
  12. My experience is that, if you are unlucky, bugs can lurk in multithreaded code way longer than in single threaded code. I have encountered (own and others) code, even single threaded, that should never have worked, but for reason or other, it always has been. Until it'll present it self in worst possible, time, place and way :D -Tee-
  13. Tommi Prami

    IDE Fix pack for Rio

    Added: -x-fpr generates 3 times faster stack memory page probing code (RSP-19826) Added: Options -x-O1, -x-O2, -x-O3, -x-Ox that enable other optimization options More info.... Hope these optimizations would come to Delphi compiler directly. https://andy.jgknet.de/blog/2017/10/ide-fix-pack-6-1-released/ https://andy.jgknet.de/blog/2018/06/ide-fix-pack-6-3-released/
  14. Tommi Prami

    Solution(s) for coder with quite poor eyesight

    As stated above, using other Dpi than 100% is not good. Because it'll affect into Dfm-files. And you just can't know is there true changes between two, if edited with environments with different Dpi. If Delphi woulöd normalize the dfm into 100% font sizes, and Form editor would be totally Dpi agnostic, at design time, it would be way easier to work in a team with different Dpi environments, -Tee-
  15. Tommi Prami

    Solution(s) for coder with quite poor eyesight

    How sharp was the text in that situation? -Tee-
×