r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!REBOL3]

shadwolf
16-Aug-2010
[4482]
instead of having an android phone maybe the devtools include an 
emulator no ?
Gregg
16-Aug-2010
[4483]
Thanks Robert. I like the fact that a goal is the use of R3 to build 
commercial apps. That means things like accelerator keys and other 
features have a better chance of being seen as important.
Carl
17-Aug-2010
[4484]
http://www.rebol.net/r3blogs/0329.html- about callbacks
Oldes
17-Aug-2010
[4485]
cool... will be there any examples as well?
Robert
17-Aug-2010
[4486x2]
(OT: Our world is back online)
Carl, great news! I'm ready :-)
Robert
18-Aug-2010
[4488]
I have a XML file and want to handle it by tags like a nested block. 
Are there are any tricks? Or do I need to use PARSE / FIND etc.
Gregg
18-Aug-2010
[4489x2]
So, you want to use path notation on the parse XML?
parsed XML
Robert
18-Aug-2010
[4491x2]
I would like to extract a set of elements like: Everything between 
<TAG> ... </TAG>
TAG should be specified.
Gregg
18-Aug-2010
[4493x2]
What I mean is, do you want to convert the XML to a block and then 
access it like this?

  data/tag
Or do you just want to parse the raw data out of the XML between 
those two <tags>?
Robert
18-Aug-2010
[4495x2]
No, not necessary.
Yes, just raw data.
Gregg
18-Aug-2010
[4497x3]
Just use PARSE then. I have a solution for the block approach, but 
just use PARSE when I need to extract data in more stream-oriented 
ways.
Give me a minute though, I might have something...
This was used with small pieces of XML, rather than entire documents, 
but might be a starting point for you.


xml-get-field: func [input name /local xml-field= data other-name] 
[
	xml-field=: compose/deep [ 
		some [

   (rejoin ["<" name ">"]) copy data to (rejoin ["</" name ">"]) to 
   end
			| skip ;(to paren! [prin '.])
		]
	]
	either parse input xml-field= [data] [none]
]
Robert
18-Aug-2010
[4500]
Ok, thanks.
Sunanda
18-Aug-2010
[4501]
I've used Gavin's XML-object.r in a couple of projects. Not tried 
it under R3 though:
   http://www.rebol.org/view-script.r?script=xml-object.r
Gabriele
19-Aug-2010
[4502x2]
http://www.rebol.it/power-mezz/parsers/ml-parser.html
inside?: no
parse-ml "...your text..." func [command data] [
    either inside? [
        ?? command ?? data
        if command = </tag> [inside?: no]
    ] [
        if command =  <tag> [inside?: yes]
    ]
]
Chris
19-Aug-2010
[4504]
; Another flavour of Rebol XML:
do http://www.ross-gill.com/r/r3xml.r
doc: load-xml/dom location
foreach tag doc/get-by-tag <a> [
	probe tag/flatten
	probe tag/text
	probe tag/get #href
]
Robert
19-Aug-2010
[4505x2]
Chris, you post can now be done native using DECODE. Carl added this 
yesterday.
I proposed a change to how path notation works on TAG! to return 
name value blocks for attributes.
Chris
19-Aug-2010
[4507x2]
Decode loads an XML document?
Is there docs on the change?
Graham
19-Aug-2010
[4509]
even better would be to release the binaries!
Graham
20-Aug-2010
[4510x2]
http://www.rebol.com/cgi-bin/blog.r?view=0484#comments

Does any one have write access, or is Carl mistaken ?
ie. anyone with a rank of 50 or higher
Robert
20-Aug-2010
[4512x4]
Here is how it works:
Added it as a codec so you can access it:

>> ml: decode 'markup read http://www.rebol.com
>> foreach tag ml [probe tag]
<!doctype html>
^/
<html>
<head>
^/
<meta name="generator" content="REBOL WIP Wiki"/>
^/
<meta name="date" content="10-Aug-2010/12:18:33-7:00"/>
^/
<meta name="rebol-version" content="2.100.97.4.2"/>
^/

<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
It's a simple way to traverse over tags.
No fancy thing yet.
Pekr
20-Aug-2010
[4516]
btw - codecs were supposed to be redone, using port mechanism, to 
allow streaming etc. Is this the case already, or not?
Robert
20-Aug-2010
[4517]
Don't know. DECODE doesn't look like a port to me. Maybe on the lower 
level this is done via a port like mechanism.
Chris
20-Aug-2010
[4518]
Equivalent to load/markup then? With respect, that's not exactly 
the same as the example I posted...
Robert
20-Aug-2010
[4519]
Yes, that's the missing part I made a proposal for to Carl.
Chris
20-Aug-2010
[4520]
r3xml is an R3 port of AltXML, a Rebolised version of XML DOM: http://bit.ly/XMLandREBOL
RobertS
20-Aug-2010
[4521]
2.100.99.3.1  the use of  function  at  with negative index simply 
returns the whole series - which reminds me to ask why   at   with 
index 0 doe not return the series atfter the last item i.e. place 
you at the end of the series?  The docs for  at   specify behavior 
for a negative index      "Using a negative index N, you can go N 
values backwards in a series:"   PS   I have relocated to Fredericton, 
NB, Canada.  Lovely, green and interesting.
Graham
20-Aug-2010
[4522x2]
Chris, with the hostkit you can compile in your own functions such 
as r3xml
Carl ... http://www.rebol.com/cgi-bin/blog.r?view=0484#comments
... big typo at the top of the page!
Chris
20-Aug-2010
[4524]
G: I'm not clear on how to get to that point or how to do that.  
Or if it's worthwhile?
Graham
20-Aug-2010
[4525x7]
well, there's only the one protocol included so far .. if you want 
your own, you have the option of including, or loading afterwards
Thanks Ladislav for confirming the lack of write access to the rebol.com 
wiki
Chris, how to include your own protocols http://jira.rebolsource.net:8080/browse/REBOLKIT-2
I don't know how much of a pain this would be, but I would like to 
consider overloading of words such as empty?


It would like to see if there were an 'empty? actor if noun is an 
object ...and use that.
in the same way that open, close etc are port actors
I presume that is something that needs to changed in the r3lib.dll 
and is not possible from the hostkit
Hmm... I guess I could just redefine 'empty ...