Questions tagged [txmldocument]

The wrapper class for process XML documents in Embarcadero Delphi programming environment. Dangerous for novices! Read the documentation!

The class is a front-end to several existing XML engines, depending on the operating system and other environment factors.

The class works in both reference-counted and explicit programmer-controlled memory management schemes at the same time.

This is very contrast to the usual behavior of Delphi stock and 3rd-party libraries and drives not yet bitten developers into repeating the same old faux pas endless times.

etc.

Hopefully with this wiki page created, at least that specific trouble would be less often repeated. At least for those developers, caring to fill the tags.

47 questions
19
votes
1 answer

XPath and TXmlDocument

In Delphi XE is it possible to use XPath with a TXmlDocument component? I'm aware I can use late binding to access the MSXML2 and then use XPath: XML := CreateOleObject('MSXML2.DOMDocument.3.0') ; XML.async :=…
Salvador
  • 16,132
  • 33
  • 143
  • 245
12
votes
3 answers

XML parsing, TXMLDocument

I have a problem with parsing XML. How to get field values se_url and phrase? I need to get link1_1, link1_2, key1, link2_1, link2_2, key2... which are in se_url and phrase. I did not find in Google how to do it (also did not find a manual on how…
dedoki
  • 709
  • 4
  • 14
  • 24
9
votes
2 answers

Delphi - TXMLDocument created at run-time generates AV, with component on the form is working

I'm creating an instance of TXMLDocument at runtime, to load and parse a XML file. You can check the code below: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, xmldom,…
RBA
  • 12,337
  • 16
  • 79
  • 126
9
votes
2 answers

How to make TXMLDocument (with the MSXML Implementation) always include the encoding attribute?

I have legacy code (I didn't write it) that always included the encoding attribute, but recompiling it to D2010, TXMLDocument doesn't include the encoding anymore. Because the XML data have accented characters both on tags and data,…
Fabricio Araujo
  • 3,810
  • 3
  • 28
  • 43
8
votes
3 answers

Issue building an XML document using TXMLDocument

I'm new to delphi and now I have to read create an xml. my code is the following: function foo.createXMLDocument(): TXMLDocument; var res: TXMLDocument; rootNode: IXMLNode; sl : TStringList; begin res := TXMLDocument.Create(nil); …
Sambatyon
  • 3,316
  • 10
  • 48
  • 65
6
votes
3 answers

C++ Builder XE2, TXMLDocument 'DTD is prohibited'

When I try to read an XML document (eagle file) with an DTD I get the error: Project xx raised exception class EDOMParserError with message 'DTD is prohibited' The XML header looks like this:
Max Kielland
  • 5,627
  • 9
  • 60
  • 95
5
votes
1 answer

XMLNode with more values and same name

I must create xml document with node that has more values with same name SI Gosposvetska 12 Kranj With oNode.ChildValues['AdrLine'] := ... it is not possible - only one…
Branko
  • 1,384
  • 1
  • 16
  • 35
5
votes
2 answers

string to xmlNode delphi (or how to add an xml fragment to TXMLDocument)

I Have a few text strings that contain well formed XML. I would like to be able to (1) turn these strings into IXMLNodes then (2) append them to an existing XMLDocument. Preferably without declaring a new XMLDocument first. This doesn't seem…
sse
  • 987
  • 1
  • 11
  • 30
5
votes
1 answer

How compare Two XML Node Structures Delphi

Is there a way to compare two xml nodes in Delphi? I am using the MSXML parser and loading the xml into an IXmlDOMDocument2. The nodes are stored in an IXmlDOMNode. I would be ok using Delphi's TXMLDocument if it helps. I do not want to…
sse
  • 987
  • 1
  • 11
  • 30
5
votes
3 answers

Alternative to TXMLDocument?

Recently we upgraded our code from Delphi 2009 to Delphi XE and updated our Indy components (not sure if this is relevant). But ever since then we have had errors on Windows Server 2003 machines when loading and saving XML…
Trevor
  • 16,080
  • 9
  • 52
  • 83
4
votes
2 answers

Accessing IXMLDOMDocument2 via TXMLDocument?

I have some working code using Delphi's TXMLDocument class, and using the TransformNode method to perform XSLT translation. But, I need to enable XSLT Javascript functions ( tags) and - after much googling - this means I need to set…
Roddy
  • 66,617
  • 42
  • 165
  • 277
4
votes
2 answers

Is this XML valid, and how to create it with TXMLDocument

Is this XML "valid"?

Todd . R . Colas

I've never seen an XML doc with multiple "values" for a node like this does…
user1498879
  • 59
  • 1
  • 4
3
votes
1 answer

Delphi Win32 TXMLDocument can't be instantiated and used from a thread?

I've been working with an Indy TIdTCPServer object and instantiating a TXMLDocument object instance during the TIdTCPServer.OnExecute event. I find it quite surprising that I get an exception when xml.Active is set to true: Microsoft MSXML is not…
X-Ray
  • 2,816
  • 1
  • 37
  • 66
3
votes
1 answer
3
votes
5 answers

How do I add a namespace prefix to each node using TXMLDocument

I used the XML Binding Wizard to create a descendant of TXMLDocument. The files generated by this class would declare the namespace in the root node and create just plain, unadorned nodes for the rest of the document.
Kenneth Cochran
  • 11,954
  • 3
  • 52
  • 117
1
2 3 4