Faced with the problem of removing the XML attributes from the file, if the attribute is written in Cyrillic (format from Tax inspection). For example, the contents of the XML:
<?xml version="1.0" encoding="windows-1251" ?> <Файл gtVer="1" ВерсПрог="1С:ПРЕДПРИЯТИЕ 8.2 УПП 1.3.51.3;СБиС в.2" ВерсФорм="5.03" ИдФайл="" ПКПК="1" ПркЛ="2"> </Файл>
ABL code:
DEF VAR xDoc AS HANDLE NO-UNDO. DEF VAR xNode AS HANDLE NO-UNDO. CREATE X-DOCUMENT xDoc. xDoc:LOAD("file","NO_NDS.XML",false). CREATE x-noderef xNode. xDoc:GET-DOCUMENT-ELEMENT(xNode). xNode:REMOVE-ATTRIBUTE("ПКПК"). xDoc:SAVE("file","no_nds1.XML").
How to fix, what to look for something to read?
That`s true both OpenEdge 10.2B and OpenEdge 11.5
Thanks for any help.
xml.p
<?xml version="1.0" encoding="windows-1251" ?>
<?xml version="1.0" encoding="UTF-8" ?>
Faced with the problem of removing the XML attributes of the file, if the attribute is written in Cyrillic (format from Tax inspection). For example, the contents of the XML:
<?xml version="1.0" encoding="windows-1251" ?>
<Файл gtVer="1" ВерсПрог="1С:ПРЕДПРИЯТИЕ 8.2 УПП 1.3.51.3;СБиС в.2" ВерсФорм="5.03" ИдФайл="" ПКПК="1" ПркЛ="2">
</Файл>
ABL code:
DEF VAR xDoc AS HANDLE NO-UNDO.
DEF VAR xNode AS HANDLE NO-UNDO.
CREATE X-DOCUMENT xDoc.
xDoc:LOAD("file","NO_NDS.XML",false).
CREATE x-noderef xNode.
xDoc:GET-DOCUMENT-ELEMENT(xNode).
xNode:REMOVE-ATTRIBUTE("ПКПК").
xDoc:SAVE("file","no_nds1.XML").
How to fix what to look for something to read?
That`s true both OpenEdge 10.2B and OpenEdge 11.5
Thanks for any help.
Flag this post as spam/abuse.
Hi,
Thank you for your reply.
I converted the XML file to UTF-8 as you wrote and changed the first line to, but the problem still present :(
Then I replaced the attribute "ПКПК" by english transcription "PKPK" - it`s work fine.
Are there any other variants?
Are your cpstream and cpinternal set to UTF-8?
Hi,
[quote user="bronco"]
Are your cpstream and cpinternal set to UTF-8?
pro -b -p xmlutf8.p -cpinternal utf-8 -cpstream utf-8 -cpcoll basic
Hi Valeriy,
Please contact TS to log a bug for this.
When I used -cpinternal UTF-8 -cpstream UTF-8 -cpcoll BASIC(and converting xml.p to UTF-8) , this worked for me. I was using Win32 with the latest 11.6 build to test. However, I do understand your concern that you are not able to use -cpinternal UTF-8 with CHUI clients.
Thanks,
Garry.
This is registered as defect PSC00326413.
In waiting for HotFix.