Skip to main content

Hi Unifacers,

I need to convert to a struct a not fully well-formed xml (it is originated from a web page I do not control neither I have possibility to correct).
The error causing the not well-formed condition is not bothering my current needs: it is related to external web page layout while I am interested in data included into this page.
Detailing the specific condition I am confronting with: into this page a field is formatted using a "qualified name" and this qualified name has structure: prefix:value:value. The double colon syntax is the error because as far as i know xml is accepting only a single column in qualified names. The detailed error is:

-1503 Attribute qname beginning with 'data-reviews:filter-action' is invalid!

xmltostruct requires to have well-formed xml otherwise is throwing this -1503 error.

Is there ANY possibility to have xmltostruct completing (with warnings!) its work in a condition like the one described? In other words: is it possible somehow to declass this error to a warning?

Any suggestion is welcome!

Regards,
Gianni

Hi Unifacers,

I need to convert to a struct a not fully well-formed xml (it is originated from a web page I do not control neither I have possibility to correct).
The error causing the not well-formed condition is not bothering my current needs: it is related to external web page layout while I am interested in data included into this page.
Detailing the specific condition I am confronting with: into this page a field is formatted using a "qualified name" and this qualified name has structure: prefix:value:value. The double colon syntax is the error because as far as i know xml is accepting only a single column in qualified names. The detailed error is:

-1503 Attribute qname beginning with 'data-reviews:filter-action' is invalid!

xmltostruct requires to have well-formed xml otherwise is throwing this -1503 error.

Is there ANY possibility to have xmltostruct completing (with warnings!) its work in a condition like the one described? In other words: is it possible somehow to declass this error to a warning?

Any suggestion is welcome!

Regards,
Gianni

Does the name change, or can you simply $replace it out before the xmltostruct? 


Hi Unifacers,

I need to convert to a struct a not fully well-formed xml (it is originated from a web page I do not control neither I have possibility to correct).
The error causing the not well-formed condition is not bothering my current needs: it is related to external web page layout while I am interested in data included into this page.
Detailing the specific condition I am confronting with: into this page a field is formatted using a "qualified name" and this qualified name has structure: prefix:value:value. The double colon syntax is the error because as far as i know xml is accepting only a single column in qualified names. The detailed error is:

-1503 Attribute qname beginning with 'data-reviews:filter-action' is invalid!

xmltostruct requires to have well-formed xml otherwise is throwing this -1503 error.

Is there ANY possibility to have xmltostruct completing (with warnings!) its work in a condition like the one described? In other words: is it possible somehow to declass this error to a warning?

Any suggestion is welcome!

Regards,
Gianni

Hi Iain,

thanks for your quick answer!
Yes, there could be more wrong references: in the page currently under test there are 3 of them.

I feel you are proposing to add a cleanup phase to the XML code before converting it to struct; I've already tried to follow this path before posting but considering I am not an hero about XML management I did not reach a point where I was fully convinced this solution would consistently work out. It should also be considered that following this path each single page could require a dedicated cleanup phase, a very technical issue while the application I am writing should be at the end for end users.

My gotfeel was a more relaxed convert phase could be a better choice and I decided to post; I am currently searching for something with this kind of functionality outside Uniface.

Gianni


Hi Unifacers,

I need to convert to a struct a not fully well-formed xml (it is originated from a web page I do not control neither I have possibility to correct).
The error causing the not well-formed condition is not bothering my current needs: it is related to external web page layout while I am interested in data included into this page.
Detailing the specific condition I am confronting with: into this page a field is formatted using a "qualified name" and this qualified name has structure: prefix:value:value. The double colon syntax is the error because as far as i know xml is accepting only a single column in qualified names. The detailed error is:

-1503 Attribute qname beginning with 'data-reviews:filter-action' is invalid!

xmltostruct requires to have well-formed xml otherwise is throwing this -1503 error.

Is there ANY possibility to have xmltostruct completing (with warnings!) its work in a condition like the one described? In other words: is it possible somehow to declass this error to a warning?

Any suggestion is welcome!

Regards,
Gianni

Hi Gianni
Maybe UXMLREADER will parse the not well formed XML ?
Then you can convert the XML by parsing with UXMLREADER and write it directly back to another XML
Each time a item look weird, you can replace it

Give it a try 🙂
Ingo