Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi: XML Node goes EInvalidPointer When I try to Access It

I try to load a node only to face the EInvalidPointer error on Delphi.

My "xml" goes this way:

<RYCFile>
    <GeneralInfo>
        <SystemName/>
        <NSpecies>1</NSpecies>
        <NMaxCriterias>2</NMaxCriterias>
    <MaxRating>1</MaxRating>
        <SystemType>0</SystemType>
        <EvolutivePointCost>1</EvolutivePointCost>
    </GeneralInfo>
    <Race Index="1">
        <RaceName>Race #1</RaceName>
        <NumCriterias>2</NumCriterias>
        <Criteria Index="1">
            <Name>Criteria #1</Name>
                <NSubCriterias>0</NSubCriterias>
                <Limiter>0</Limiter>
            </Criteria>
            <Criteria Index="2">
                <Name>Criteria #2</Name>
                <NSubCriterias>0</NSubCriterias>
                <Limiter>0</Limiter>
            </Criteria>
        </Race>
</RYCFile>

I can't even read the DocumentElement.

I've googled everywhere but I'm at wit's end, it seems. Can't seem to find a solution remotely adapted to what I'm enduring.

Code used to "read":

FormSkeletonMaker.XMLDocumentFile.LoadFromFile(FileName);
FormSkeletonMaker.XMLDocumentFile.Active := True;
iNode := FormSkeletonMaker.XMLDocumentFile.ChildNodes.FindNode('GenInfo');

right now it goes this way. I'm barely testing the ability for this document to get loaded (it was made on the same program).

like image 656
AdelC Avatar asked Aug 01 '26 16:08

AdelC


1 Answers

If the DocumentElement property fails, then either the FormSkeletonMaker or XMLDocumentFile object pointer is invalid.

like image 122
Remy Lebeau Avatar answered Aug 03 '26 05:08

Remy Lebeau



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!