What is the correct way to check for an optional node? I disabled my XML:
<Antenna > <Mount Model="text" Manufacture="text"> <BirdBathMount/> </Mount> </Antenna>
But it could also be:
<Antenna > <Mount Model="text" Manufacture="text"> <AzEl/> </Mount> </Antenna>
The Antenna child can be either BirdBath or AzEl, but not both ...
In Delphi XE, I tried:
if (MountNode.ChildNodes.Nodes['AzEl'] <> unassigned then //Does not work if (MountNode.ChildNodes['BirdBathMount'].NodeValue <> null) then // Does not work if (MountNode.BirdBathMount.NodeValue <> null) then // Does not work
I use XMLSpy to create the XML schema and example, and they parse correctly. I use Delphi XE to create bindings and works great with most other combinations.
This should have a simple answer that I just forgot - but what? Thanks ... Jim
source share