1. raghvendra choubey
  2. PowerBuilder
  3. Wednesday, 24 April 2019

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!!

 

Brad Mettee Accepted Answer Pending Moderation
0
Votes
Undo

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.
  1. Thursday, 25 April 2019
  2. PowerBuilder
  3. # 1
Olan Knight Accepted Answer Pending Moderation
1
Votes
Undo

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
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. raghvendra choubey
  2. Thursday, 25 April 2019
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. Olan Knight
  2. Thursday, 25 April 2019
There are no comments made yet.
  1. Wednesday, 24 April 2019
  2. PowerBuilder
  3. # 2
  • Page :
  • 1


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