1. raghvendra choubey
  2. PowerBuilder
  3. Wednesday, 24 April 2019 14:46 PM UTC

I have an XML whose element contains an attribute with a name starting as XML.., So while calling getattribute function on this element I got following exception message. Is there any workaround for this.

--------------------------
error
---------------------------
An invalid name is used.
Extra Information :
Function Name : pbdom_element::GetAttribute(string strName)
Name starts with "xml".
---------------------------
OK
---------------------------

 

Thanks in advance!!

 

Accepted Answer
Brad Mettee Accepted Answer Pending Moderation
  1. Thursday, 25 April 2019 12:46 PM UTC
  2. PowerBuilder
  3. # Permalink

XML as an attribute name is not allowed. It's a reserved word according to the XML Document specs.

https://www.w3schools.com/xml/xml_elements.asp

Look in the middle of the page under XML Naming Rules for more info.

Comment
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Wednesday, 24 April 2019 19:26 PM UTC
  2. PowerBuilder
  3. # 1

Can you parse the string manually BEFORE you start to process it?

Search for strings of "XML", and if you find them then replace the "XML" with something else, like "RPL".

 

Olan

Comment
  1. raghvendra choubey
  2. Thursday, 25 April 2019 08:25 AM UTC
Hi Olan,

I have changed the xml with cml and it worked fine. But I was hoping if there is any other way.

Thanks for the help.



Raghvendra

  1. Helpful
  1. Olan Knight
  2. Thursday, 25 April 2019 14:44 PM UTC
Nope, that's the only way I know how to handle a reserved word in the XML string.

Glad you got it working!



Olan
  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.