 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Thomas Werner Guest
|
Posted: Sun Aug 13, 2006 9:20 pm Post subject: Parsing TXMLDocument using prefixes, possible error in XMLDO |
|
|
Does anybody know about a possible error in XMLDOM when trying to obtain a
node value using the node name with a schema prefix?
--XML (only partly shown)--------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<Invoice xmlns="urn:sfti:documents:BasicInvoice:1:0"
xmlns:cac="urn:sfti:CommonAggregateComponents:1:0"
xmlns:cbc="urn:oasis:names:tc:ubl:CommonBasicComponents:1:0"
xmlns:ccts="urn:oasis:names:tc:ubl:CoreComponentParameters:1:0"
xmlns:cur="urn:oasis:names:tc:ubl:codelist:CurrencyCode:1:0"
xmlns:sdt="urn:oasis:names:tc:ubl:SpecializedDatatypes:1:0"
xmlns:udt="urn:oasis:names:tc:ubl:UnspecializedDatatypes:1:0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ID>15</ID>
<cbc:IssueDate>2003-09-11</cbc:IssueDate>
<InvoiceTypeCode>380</InvoiceTypeCode..........
--------------------------------------------------------------
Accessing the ID node is no problem using
var Invoice : IXMLNode;
begin
Invoice := XMLDocument1.DocumentElement;
Edit1.Text := Invoice['ID'].NodeValue;
but this fails:
Edit2.Text := Invoice['cbc:IssueDate'].NodeValue;
As far as I can see there must be an error in XMLDOM unit, in function
NodeMatches() as it seems as it only returns a match if the Nodes namespace
is the same as the parents namespace ( or empty ). As you can see in the
XML-snippet the default namespace for Invoice is different than the
namespace for the IssueDate node.
Any help appreciated
Thomas Werner |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|