revxml

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, LCMark

Locked
LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1206
Joined: Thu Apr 11, 2013 11:27 am

Re: revxml

Post by LCMark » Wed Sep 11, 2013 2:30 pm

The revxml xpath additions @mwieder has contributed will appear in 6.5-dp-1 which we're hoping to get out asap :)

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: revxml

Post by mwieder » Wed Sep 11, 2013 5:15 pm

That isn't a typo? We're going from 6.1 straight to 6.5? I'll have to change the doc files in that case.

You cannot make another post so soon after your last.

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1206
Joined: Thu Apr 11, 2013 11:27 am

Re: revxml

Post by LCMark » Wed Sep 11, 2013 5:31 pm

@mwieder: Already done :)

You cannot make another post so soon after your last.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: revxml

Post by mwieder » Wed Sep 11, 2013 5:43 pm

Thanks. Yes, I'm pawing through the changes now, and I see those done.

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: revxml

Post by malte » Thu Feb 06, 2014 7:24 pm

Folks,

I could swear there was one command that was called

revPutIntoXMLNode

obviously now it is called

revXMLPutIntoNode

When did that change? The old call appears to crash the engine now (at least on the Mac) Any hints there?

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3990
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: revxml

Post by bn » Thu Feb 06, 2014 10:02 pm

Hi Malte,

apparently it was changed in 6.5 and they omitted the old forms/ or they are broken.

from the release notes 6.5

The following xpath functions were added to the engine:
'revXMLEvaluateXPath' 'revXMLDataFromXPathQuery'

In addition, several synonyms for existing commands are now available for consistency:
'revXMLCreateTree' 'revXMLCreateTreeWithNamespaces' 'revXMLCreateTreeFromFile' 'revXMLCreateTreeFromFileWithNamespaces' 'revXMLDeleteTree'
'revXMLAppend' 'revXMLDeleteAllTrees' 'revXMLAddNode' 'revXMLDeleteNode' 'revXMLInsertNode' 'revXMLMoveNode' 'revXMLCopyNode' 'revXMLCopyRemoteNode' 'revXMLMoveRemoteNode' 'revXMLPutIntoNode' 'revXMLSetAttribute'

Kind regards
Bernd

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: revxml

Post by malte » Thu Feb 06, 2014 10:17 pm

Ok, so the old ones are supposed to be synonyms then. I will set up a test case and file a bug then.

Thanks Bernd.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: revxml

Post by mwieder » Fri Feb 07, 2014 3:43 am

Malte- yes, I changed the names to make the xml commands more consistent (now they *all* start with "revXML"), but I left the old commands in place as synonyms and marked them as deprecated. They *should* still work, and it's a bug if they don't. This shouldn't have broken backward compatibility.

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: revxml

Post by malte » Fri Feb 07, 2014 7:05 am

Thanks Mark! That was what I was hoping. It is a bug then, I will set up a demo stack.

All the best!

Malte

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: revxml

Post by malte » Fri Feb 07, 2014 7:55 am

Oh the joys of debugging. Of course the atomic recipe stack does not crash. :-(

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: revxml

Post by malte » Fri Feb 07, 2014 11:19 am


mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: revxml

Post by mwieder » Fri Feb 07, 2014 5:22 pm

Malte- thanks for the test stack in the bug report. I can confirm that it does indeed crash the engine. But it's not a matter of the naming convention - it crashes no matter whether I use the new or old synonym.

The difference is that the crash button sets the replaceTextOnly argument to true but has an empty replacement string. If you change the empty string to something else then it doesn't crash and gives proper results. Are you trying to delete a node? There's a different revxml command for that.

That's not an excuse for crashing the engine, that shouldn't happen in any event, and it's a serious bug that has to be fixed. It's not a section of code that I've messed with: the only thing I did for that function was create the synonym. But I'll dive in this weekend and see what I can do.

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: revxml

Post by malte » Fri Feb 07, 2014 7:39 pm

Hey Mark!

thanks for your attention in this matter. No, Actually I am trying to empty the node there. The attributes need to remain intact though and the node still needs to exist afterwards. Simply put I want something like this:

Code: Select all

<foo bar="baz">boo</foo>
to become this:

Code: Select all

<foo bar="baz"/>
The reason for this is, that I have no control over what is being put into the node. Might be any (UTF8) string, but might also be empty.

Best,

Malte

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: revxml

Post by mwieder » Fri Feb 07, 2014 11:27 pm

OK - seems like a reasonable thing to do. It shouldn't crash anyway. I didn't change the code, so my guess is that this has always been a problem, it's just that nobody's tried this before. Shouldn't be too hard to track down, though.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: revxml

Post by mwieder » Sat Feb 08, 2014 6:04 am

Done. The problem is really within the third-party libxml library and should be fixed there. If I can figure out what's causing the problem in the code I'll submit a pull request with the changes.

In the meantime, I've patched the code in the revXML external to substitute a carriage return for the existing string, thus giving the same effect as deleting the original string. Fixed and pull request submitted.

Locked

Return to “Engine Contributors”