1. Matt Balent
  2. PowerBuilder
  3. Friday, 30 April 2021 07:57 AM UTC

So I have the following XML string:

<Result><Status><ReplyStatus>1</ReplyStatus><ReplyText>Success</ReplyText></Status><Data /></Result>

With the following PowerScript I create a PBDOM document from it:

PBDOM_Builder idom_Builder //instance variable on nvo

// method code
boolean lb_root
PBDOM_Document ldom_Doc

TRY

   ldom_Doc = idom.Builder.BuildFromString(as_xml) // using xml string from above

   //bunch of error checking and etc here.

CATCH (blah, blah, blah)

END TRY


lb_root = ldom_Doc.HasRootElement() //returns FALSE

Now in 2019R2 the root element is 'Result'

Has this functionality changed in R3?

Matt Balent Accepted Answer Pending Moderation
  1. Friday, 30 April 2021 15:56 PM UTC
  2. PowerBuilder
  3. # 1

Well it all boiled down to the basics.

Apparently at some point in the past some developer copied the pbdom objects from the pbdomxxx.pbd file into another application .pbl.  Since this pbl was before the pbdom.pbd file in the newly upgraded library list the proper object was not being called.  Once I removed these duplicates from the pbl file and rebuilt, the application runs properly and the root node is found from the example XML.

Thanks Chris!

Comment
  1. Chris Pollach @Appeon
  2. Friday, 30 April 2021 16:04 PM UTC
Hi Matt ... Ahhh - PB Poltergeists - LOL!

Welcome .. glad that you found the issue! ;-)
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Friday, 30 April 2021 16:12 PM UTC
Thanks for sharing the solution!
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 30 April 2021 15:05 PM UTC
  2. PowerBuilder
  3. # 2

Hi Matt;

  No problem in my PBDOM testing with your XML and basic code flow ...

Did you grab the latest PB2019R3 MR and then after that the newest PBDOM.pbd file?

Regards ... Chris

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 30 April 2021 14:08 PM UTC
  2. PowerBuilder
  3. # 3

Hi Matt;

  Your XML is not well formed ... what is the lone "<Data />" element?

regards ... Chris

Comment
  1. Matt Balent
  2. Friday, 30 April 2021 14:32 PM UTC
I see that. However, if you strip off that portion of the XML you still don't get a root element.
  1. Helpful
  1. Matt Balent
  2. Friday, 30 April 2021 14:40 PM UTC
The XML in the example is valid per this validator (https://www.w3schools.com/xml/xml_validator.asp).
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.