• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

AltME groups: search

Help · search scripts · search articles · search mailing list

results summary

worldhits
r4wp18
r3wp648
total:666

results window for this page: [start: 501 end: 600]

world-name: r3wp

Group: All ... except covered in other channels [web-public]
Reichart:
4-Feb-2008
Agreed, this is easy, I was just hoping to look at something already 
done, perhaps even by Richard...

The cool thing is this could be saved in XML, and be compatible with 
other systems then.


The important thing is that no CAD system I know of lets you easily 
build an object, (even like a little JBox) by telling it that it 
is x distance from the corner of some other object.  This is the 
key to logging things around a house.

I want to build a really powerful way to triangulate on a point.
Oldes:
6-Feb-2008
Don't forget that SVG is XML so it can be very large if you draw 
something more complex
BrianH:
6-Feb-2008
If you want Pcode for SVG, use one of the binary XML encodings like 
EBML. If you want Pcode for REBOL, that's what Rebin is to be.
Reichart:
6-Feb-2008
Both XML and REBOL already work on multiple systems, I don't perceive 
much of a speed increase, and now-a-days, Zip works great.  WE did 
not have that as a standard 20 years ago.
BrianH:
6-Feb-2008
Here's a breakdown for any encoding (Pcode, XML, REBOL, whatever):

Portability:

You need to build or acquire a decoder or encoder, and third-party 
code would need to as well. Advantage: XML


Faster execution: The main way you get that is to make the model 
of your data format match your data model. If the match is close 
enough you can translate the data to your internal model in insignificant 
time, like EBML to XML, Rebin to REBOL, or CPU instructions. If your 
internal semantic model is simple enough you can quickly do a direct 
interpretation of the data, like older Pcode interpreters or the 
original Java byte code, or the micro-operations inside modern CPUs.


In the case of REBOL, we have it easy because REBOL is primarily 
a data model. All we have to do is encode that data in an efficient 
binary format and then decode that format to the memory model. That's 
Rebin, the proposed Pcode of REBOL.


In the case of XML, it is slightly more difficult because there are 
competing binary encodings, and none of those will be supported in 
a web browser until it wins the format war. EBML is like a Zip for 
the XML data model, rather than its syntax (similar compression algorithm 
too) - much faster than unzipping XML and parsing it. The main problem 
is that only Matroska decoders support it right now - no web browsers. 
Similar constraints exist for the other binary encodings of XML.


In the case of SVG, we are much less lucky. SVG has its own data 
model on top of the XML data model. Once you decode the XML from 
whatever format it was encoded in, you end up with data of the XML 
model - then you have to interpret that data to get a dataset in 
the SVG model, much like the relation between REBOL and the Draw 
dialect. There may be some advantage to coming up with a Pcode for 
SVG.


The main thing that you need to keep in mind is that your Postscript 
experience is throwing you off: The semantic models of modern graphic 
formats are declarative, not programmatic - this was the main change 
between Postscript and PDF. A Pcode for a modern graphic model would 
not be executed like code, it would be loaded as data.
Reichart:
7-Feb-2008
BrainH, I won't belabour the point, I'm simply still unclear how 
once can make REBOL really much faster by making byte-code from it. 
 But, perhaps someone will, and make a demo, and prove it to me in 
the future… I agree that Zip XML is not a solution, but unless the 
Pcode system for XML is built into the browser, I don't see an advantage 
there either yet.

I'll be the first to use both though, when they exist.

Ashley, yes, will move future SVG convo to group…
Reichart:
19-Apr-2008
Hmmm....I'm not familiar with Google Graph yet enough to confirm.

But...this is another one of those areas we are starting to play 
with.  I really like thier basic method, although, SOAP might be 
nice so one can work in something more like XML
Reichart:
20-Jul-2008
Do keep in mind, recent copies of Excel "are" simply XML.
Group: Core ... Discuss core issues [web-public]
Graham:
17-Nov-2006
What's the best available XML toolkit available for Rebol these days?
Geomol:
17-Nov-2006
That's a solution, but it can't cope with all XML. What should you 
call the content attribute? You might call it something, that another 
attribute is called already.
Geomol:
17-Nov-2006
Another problem is, that this is valid XML:
<tag1>string 1<tag2>content</tag2>string 2</tag1>


If you made that to an object, how would to refer to "string 1" and 
"string 2"? So of course it's possible to make XML to REBOL objects, 
but then you have to make restrictions to what kind of XML, you can 
handle.
Geomol:
17-Nov-2006
It's hard (maybe impossible) to come up with a solution, that can 
handle all XML.
Graham:
17-Nov-2006
is there a difference between valid xml and that which is in common 
use?
Geomol:
17-Nov-2006
I don't know. My last example is probably not seen that often, but 
it's valid according to the XML specs.
Geomol:
17-Nov-2006
Maybe something can be made from the builtin REBOL parse-xml and 
xml-language?
Gregg:
18-Nov-2006
There's a HUGE difference between dealing with simple, well formed, 
XML, and trying to implement the XML specification. A good deal of 
XML our there is just well formed; no namespaces, no attributes; 
easy to deal with. I did a loading (XML to blocks) that just makes 
a minor change to parse-xml; it reverses the content and attribute 
values--since attributes are often NONE--so you can use path notation 
on the resulting block.
Graham:
21-Nov-2006
Anyone built an xml to rebol object utility?
Graham:
21-Nov-2006
I'm talking about well formed xml, no attributes involved.
Graham:
21-Nov-2006
No matter, xml-to-object works fine.
Maxim:
8-Feb-2007
a 10MB xml file loaded from the net and loaded with xml2rebxml  took 
about 100mb of ram.  the same file loaded in firefox  took up 600mb 
of ram.  I was pretty shocked !
Maxim:
8-Feb-2007
10mb of string becomes 600MB of binary xml objects... this is just 
insane.
Graham:
19-May-2009
page: read/custom [ scheme: 'http host: "twitter.com" target: "direct_messages/new.xml" 
user: "my-twitter-id" pass: "mypassword" ]  [ POST "text=This was 
also sent from a Rebol&user=synapse_emr" ]


This sends a private tweet to a user ... not clear from the API docs 
what the call is to just tweet ... anyone know?
Graham:
19-May-2009
This works ... posting a message is actually called updating your 
status!


 page: read/custom [ scheme: 'http host: "twitter.com" target: "statuses/update.xml" 
 user: "my-twitter-id" pass: "mypassword" ]  [ POST "status=Playing 
 with REBOL and the Twitter API" ]
Dockimbel:
27-May-2009
I agree, using recursion for walking through hierarchical structures 
is a good approach as these structures usually have a depth limit 
far below the stack limit (e.g. parsing XML data) . In the last years, 
I've found that using block parsing for block! trees walking was 
probably the most efficient approach (code size and speed wise).
Graham:
1-Jul-2009
Janko, I see you were using rebXR in 2002 ... so why not just use 
xml-rpc for this as well?
BrianH:
27-Jul-2009
The way this kind of thing is resolved in R3 is through liberal use 
of the ASSERT/type function, and not representing XML as objects.
BrianH:
27-Jul-2009
Well, you can clean it up to a usable structure on read, process 
it nicely, then regenerate the bad XML on write.
Graham:
27-Jul-2009
I suspect this is a very common issue and not bad xml.  So, if the 
XSD states an element can be 0 ... n and each element can be of a 
different type, then it's going to be difficult to work with no matter 
what.
Graham:
27-Jul-2009
I guess the xml-to-object.r script doesn't know that!
BrianH:
27-Jul-2009
Saw a new language the other day that has a native, literal data 
structure which matches the XML object model, without the syntax.
Graham:
8-Aug-2009
But if I do a wireshark trace, I see this

GET /20090806.7z HTTP/1.0
Accept: */*
Connection: close
User-Agent: REBOL View 2.7.6.3.1
Host: remr.s3.amazonaws.com

HTTP/1.0 403 Forbidden
Date: Sat, 08 Aug 2009 21:08:07 GMT
Content-Type: application/xml
x-amz-request-id: D03B3FA12CC875D5

x-amz-id-2: u3b7TkPzJc5NBwvov4HRQuMsCsosD7le9xfRMSGiCN2BXgeae6kKMVQAbhzqRDwY
Server: AmazonS3
Via: 1.1 nc1 (NetCache NetApp/6.0.5P1)

<?xml version="1.0" encoding="UTF-8"?>

<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>D03B3FA12CC875D5</RequestId><HostId>u3b7TkPzJc5NBwvov4HRQuMsCsosD7le9xfRMSGiCN2BXgeae6kKMVQAbhzqRDwY</HostId></Error>
Gregg:
2-Dec-2009
Talks often dont' go as planned Janko. I'm sure you did fine. 


For a less technical audience, I try to focus on how little code 
it takes to do useful things; and how readable that code can be. 
Having some simple GUI examples is important, because normal people 
don't want console apps. For programmers, I emphasize that REBOL 
isn't really a programming language; it's a messaging language. As 
Carl has said "It was designed for the semantic exchange of information 
between people and machines." So it's never REBOL compared to Python, 
or Ruby, but compared to those languages plus XML or JSON.
Terry:
23-Jan-2010
Any gotchas when posting xml via read/cutom [post "<my xml>"]  ?
Maxim:
23-Jan-2010
also might want to make sure the content-type is set to: "application/xml"
Maxim:
23-Jan-2010
IIRC you also need to name your post data...

complete example, something like:

header: [Content-Type: "application/xml"]
name: "get-info"

read/custom reduce ['post rejoin [ "value=" your-xml-data "&"] 'header 
header]
Maxim:
23-Jan-2010
oops 


read/custom reduce ['post rejoin [ name "=" your-xml-data "&"] 'header 
header]
Terry:
24-Jan-2010
name "=" your-xml-data ??
Maxim:
24-Jan-2010
where name is the name of the variable which stores the xml and your-xml-data 
is, obviously, your xml file content.


you might also need to url-encode the xml-data so it gets read properly 
at the other end.
Maxim:
24-Jan-2010
eh not sure what that refers to, but I guess you refer to "which 
stores the xml" ?
Terry:
24-Jan-2010
it asks for the function be the first xml tag ie: <restmethod>
Terry:
24-Jan-2010
and then chokes.. im thinking it the rest header is lacking somehow.. 
but if it's asking for just xml, where would I shove it? I would 
think the rebol custom 'post' would do that.. but yeah, probably 
needs the Content-Type: "application/xml" .. ?

It's this kind of verbose nonsense that should have been left behind 
in the last century.
Maxim:
24-Jan-2010
so you should probably have to give a name to the parameter which 
is followed by the xml data  ex:

postdata=<restmethod><sometag>value</sometag></restmethod>
Maxim:
10-Jun-2010
I used it and modified it too a few years ago... I have 5 simultaneous 
feeds of different types (rss, search engines, xml-web-app) with 
updates and animation.

it was pretty stable once I wrapped an attempt around every close 
port in the source.... otherwise, for some reason it would crash 
rebol arbitrarily .
Pekr:
8-Jul-2010
What is the easiest way to prevent sub-object sharing? I have very 
simple but nested XML structure, and I want to put records into objects. 
But I have one subobject. I want to have prototype object (class) 
and create instances filled with data, but I want to avoid subobject 
sharing ....
Maxim:
21-Sep-2010
when I talk to XML-minded people and tell them that we've got paths 
embeded in the language they always *really* like the idea... and 
I understand them.
Group: View ... discuss view related issues [web-public]
[unknown: 9]:
13-Jan-2006
I think of it the other way around, "send" the material in XML, RSS, 
ATOM, what ever, an let each system deal with showing it.  But no 
matter what, we need a website where all this stuff comes together.
Graham:
21-Sep-2006
So, you create an xml form which acrobat can read??
Geomol:
21-Dec-2006
W3C link to this from their SVG page: http://openclipart.org/cchost/

so there's a lot of clipart in SVG format, I guess. SVG uses XML, 
so it should be easy to import using my RebXML packet. Problem is 
to figure out content  of the format.
Pekr:
2-Apr-2008
look at - php (other), db on the server, js, xhtml, xml, css on the 
client ... what a mess. We are trying to push web where it never 
meant to go. Fixing layers upon layers by adding yet another layers 
and excuses for not functioning realtime on my Core 2 Duo 2GB PC 
:-)
Pekr:
2-Apr-2008
Fork - but VID3 is so well abstracted, separating methods of user 
input, widgets update, that no clumsy XML forms reach its knees, 
so we will see ...
james_nak:
8-Jul-2008
Thanks Graham for the 3flex link. That's interesting. Perhaps Henrik's 
Relations-Engine might be something you can use. I myself have been 
tinkering around with it and attempting to parse the data to work 
with a chart making program. In my case I am planning on using http://www.maani.us/xml_charts/
.
Graham:
10-Jul-2008
xml_charts looks interesting but doesn't seem capable of doing what 
I want.  But it might be useful for a website.  Does it do time series?
james_nak:
14-Jul-2008
Graham... Check out http://www.maani.us/xml_charts/index.php?menu=Gallery&submenu=Floating_Bar
Graham:
26-Jul-2009
Basically these are XML files that are being turned into Rebol objects 
that I wish to browse.
Anton:
27-Jul-2009
I think what you have in your situation, with objects built from 
XML, is different than mine. I take advantage of being able to use 
blocks in my structure which allows me to insert my additional associated 
info. With your object hierarchy, it's problematic to add your own 
extra fields for state because the XML, of course, might already 
have those field names as part of its data, so there's possibility 
for collision there.

However, (as I see in my notes,) I was strongly considering for my 
purposes a structure like this:
		file-structure: [
			%OHS/ [
				%adir/ [
				]
				%afile
			]
		]
		associated-file-info: [
			%OHS/ make object! [...]
			%OHS/adir/ make object! [...]
			%OHS/afile make object! [...]
		]
Anton:
27-Jul-2009
(with duplication of all the paths as a negative consequence), but 
this idea could work better with XML objects.
james_nak:
13-Oct-2010
In my quest to transform an object with nested objects back into 
an xml file I am running into an invalid path issue. Where obj is 
the object with other nested objects and p: person, first obj/:p 
works fine. However though obj/person/name  exists, I can't figure 
out how to store the path /person/name into p.

A couple of years ago Robert and Chris had a discussion about this. 
Anyone know if this can be done or not.? Thanks.
Steeve:
13-Oct-2010
James, about your object-to-xml need. The best way to express it 
when you speak to other programmers is to give them a concrete use 
case.
1/ mold the input
2/ mold the expected output.

Then, one can figure a solution without the need to decipher your 
patter ;-)
james_nak:
13-Oct-2010
Oldes, originally I was going to build a function that took the output 
of xml-to-object.r and change it back to xml. For that I was creating 
paths to the objects but couldn't get past the path being more than 
one level issue. 

As I mentioned, there was some discussion a few years back and there 
was mention that what worked in Core did not in View so rather than 
start something there, I thought it best to do that here.
I'm good now with my new approach.
Steeve:
2-Nov-2010
I probably made a wrong choice, trying to parse the source on the 
fly instead of converting the xml source into nested blocks.
Maxim:
2-Nov-2010
I'll have to build the convertion on both sides, so converting your 
code into using rebol blocks is going to be my choice.


I already have the xml part very well covered, so I'll dive into 
this in a few days.  thanks again.
Group: I'm new ... Ask any question, and a helpful person will try to answer. [web-public]
jack-ort:
2-Jul-2010
Hello - hope someone can find the newbie mistake I'm making here. 
 Wanted to use REBOL to tackle a need to get data from Salesforce 
using their SOAP API.  New to SOAP, WSDL and Salesforce, but using 
SoapUI mananged to do this POST (edited only to hide personal info):

POST https://login.salesforce.com/services/Soap/u/19.0HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
User-Agent: Jakarta Commons-HttpClient/3.1
Host: login.salesforce.com
Content-Length: 525


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:partner.soap.sforce.com">
   <soapenv:Header>
      <urn:CallOptions>
         <urn:client></urn:client>
         <urn:defaultNamespace></urn:defaultNamespace>
      </urn:CallOptions>
   </soapenv:Header>
   <soapenv:Body>
      <urn:login>
         <urn:username>[jort-:-xxxxxxxxxxxxx-:-com]</urn:username>

         <urn:password>xxxxxxxxxx78l6g7iFac5uaviDnJLFxxxxx</urn:password>
      </urn:login>
   </soapenv:Body>
</soapenv:Envelope>

and get the desired response:

HTTP/1.1 200 OK
Server: 
Content-Encoding: gzip
Content-Type: text/xml; charset=utf-8
Content-Length: 736
Date: Fri, 02 Jul 2010 20:32:14 GMT


<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><loginResponse> 
......

Then using SoapUI I am able to send a successful Logout message.


Using REBOL 2.7.7.3.1, I created an "upload" string containing the 
POST block above without the "POST " at the beginning, set my url 
to:

>> url
== https://login.salesforce.com/services/Soap/u/19.0

and tried this:

>> response: read/custom url reduce ['POST upload]

but consistently get a Server 500 error:


** User Error: Error.  Target url: https://login.salesforce.com:443/services/Soap/u/19.0 
could not be retrieved.  Se
rver response: HTTP...
** Near: response: read/custom url reduce ['POST upload]

For completeness, here's the upload value:

>> print mold upload
{https://login.salesforce.com/services/Soap/u/19.0HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
User-Agent: Jakarta Commons-HttpClient/3.1
Host: login.salesforce.com
Content-Length: 525


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:partner.soap.sforce.com">

   <soapenv:Header>
      <urn:CallOptions>
         <urn:client></urn:client>
         <urn:defaultNamespace></urn:defaultNamespace>
      </urn:CallOptions>
   </soapenv:Header>
   <soapenv:Body>
      <urn:login>
         <urn:username>[jort-:-researchpoint-:-com]</urn:username>

         <urn:password>metrics12378l6g7iFac5uaviDnJLFVprDl</urn:password>
      </urn:login>
   </soapenv:Body>
</soapenv:Envelope>}

Would appreciate any help you can give!
Group: !RebGUI ... A lightweight alternative to VID [web-public]
Graham:
30-Jul-2009
Here's a movie to show what the effect is.  Basically I am opening 
up an XML file, turning it into a REBOL object and browsing it.
http://screencast.com/t/5K3dkL3Y7
Group: Tech News ... Interesting technology [web-public]
Chris:
6-May-2009
It seems beside the point that AIR/Flex/etc/whatever is built on 
XML, JS, and so on.  If the end product is better and the development 
isn't too much more painful - developers/braintrust are going to 
go with the better end product.
Chris:
24-May-2009
Hmm, DOM (ok, not really what he means, but still vaguely similar):

	http://www.rebol.org/view-script.r?script=xml-dom.r
	http://www.ross-gill.com/r/qxml.html(slightly newer)
amacleod:
12-Aug-2009
Confused as to what they infringed upon...I thought XML was open 
standard...
Reichart:
12-Aug-2009
I think I can help here (I'm about to have another patent awarded 
in fact that touches on this same area).


First, we all have to laugh here that what the patent covers is that 
data is sent in a format that is OPEN and STANDARD.  XML falls under 
this definition.


From the description “Any program or procedure which needs to format 
or understand the document must know all of the special codes and 
be able to correctly separate them from the content. All routines 
which work with the document must have exactly the same model of 
how the embedded codes are formatted or placed. If any operation 
misinterprets the code sequence even slightly, or mistakes content 
for formatting, the document or a part thereof will be reduced to 
meaninglessness. “


In other words guys, this group is suing Microsilly for FINALLY playing 
nice with everyone else.   This is the purist form of irony ever, 
and I love it.


I agree with the judge.   The problem now is...is there prior art? 
 This is 1994.  Permit me to make something clear, they are not claiming 
that showing something like XML is the scope of the patent, even 
WordPerfect would should you something like XML if you asked to “reveal 
codes”, but in fact it was stored internally in some odd format (just 
like word).  The move to storing the data in this standardized way, 
and showing it in the same way, might indeed by unqiue.  The language 
for storing it has to be standard itself, this self referencing part 
is what makes this tricky.
Graham:
13-Aug-2009
so, is this like combining an XSD with an XML document ?
Group: !REBOL3-OLD1 ... [web-public]
Kaj:
10-Oct-2007
Years ago there was a project trying to do this in XML, UIML
shadwolf:
15-Jul-2008
in opera widgets applet you have a CSS whay to setup the widget and 
in destop google applet you have a XML  way to setup the widget
Kaj:
17-Aug-2008
Same way XML is the "lightweight" version of SGML
Rebolek:
19-Sep-2008
Henrik: "When you fire up R3, you will get what looks like a webbrowser 
and acts like one." - not just that, I want R3 not just to look like 
a webbrowser and act like a webbroser but actually TO BE a webbrowser 
- download R3 (few hunderts kB), run it and be able to browse REBOL 
pages - and if you enter *.html - just show some window that says 
"downloading" and download some REBOL plugin that can display webpages 
(being based on Gecko, Webkit, whatever) - it will be few megs download, 
but people are used to it. This is definitely possible - it's possible 
to display OpenGL etc in View window so I believe there are some 
libraries to do this ("somebody" just needs to make an interface 
to them ;)'


The thing is that R3 browser (and just a R3 browser) will be once 
again a great platform without apps (Be Inc etc...). If R3 browser 
can display classic HTML+JS+CSS+DOM+XML+AJAX+WHATEVER combo it's 
win-win situation. Lots of apps available and we can improve them 
one after one to show it can be done much easier and faster.
Oldes:
22-Sep-2008
I already used Rebol -> ECMAScript (at least to generate data (mainly 
nasted arrays)) to skip a need to write something like XML parser 
on the client side, how most people do now:)
BrianH:
7-Jan-2009
Here's the current source for LOAD:

load: func [
	{Loads a file, URL, or string.}
	source [file! url! string! any-block! binary!]

 /header  {Includes REBOL header object if present. Preempts /all.}

;	/next    {Load the next value only. Return block with value and 
new position.}

;	/library {Force file to be a dynamic library. (Command version)}
;	/markup  {Convert HTML and XML to a block of tags and strings.}
	/all     {Load all values. Does not evaluate REBOL header.}
	/unbound {Do not bind the block.}
	/local data tmp
][
	; Note: Avoid use of ALL func, because of /all option
	if any-block? :source [return :source]

	data: case [
		string? source [to-binary source]
		binary? source [source]
		; Check for special media load cases: (temporary code)
		find [%.jpg %.jpeg %.jpe] suffix? source [
			return load-jpeg read/binary source
		]

  url? source [read source] ; can this possibly return not binary! 
  ?
		file? source [read source] ; binary! or block of file!
	]

 ; At this point, data is binary!, a block of file!, or something 
 weird.

	if binary? :data [
		unless find [0 8] tmp: utf? data [
			cause-error 'script 'no-decode ajoin ['UTF tmp]
		]

		; Only load script data:
		if any [header not all] [ ; Note: refinement /all
			if tmp: script? data [data: tmp]
		]
	]

	unless block? :data [data: to block! :data] ; reduce overhead

 ; data is a block! here, unless something really weird is going on
	tmp: none
	
	; Is there a REBOL script header:
	if any [header not all] [ ; /header preempts /all
		tmp: unless any [

   ;not any [file? source url? source] ; removed: hdr in string is same
			unset? first data ; because <> doesn't work with unset!
			'rebol <> first data
			not block? second data
		][ ; Process header:
			attempt [construct/with second data system/standard/script]
		]
		; tmp is header object or none here
		case [
			tmp [
				remove data
				either header [change data tmp][remove data]
				tmp: tmp/type = 'module ; tmp true if module
			]
			header [cause-error 'syntax 'no-header data]
		]
	]
	; tmp is true if module, false or none if not

 ; data is a block!, with possible header object in first position

	; Bind to current global context if not a module:
	unless any [
		unbound
		tmp ; not a module
	][
		bind/new data system/contexts/current
	]

 ; data is a block! here, unless something really weird is going on

	; If appropriate and possible, return singular data value:
	unless any [ ; avoid use of ALL
		all
		header ; This fixes a design flaw in R2's LOAD
		;not block? :data ; can this ever happen?
		empty? data ; R2 compatibility
		not tail? next data
	][data: first data]
	; If /all or /header, data is a block here

	:data
]
Kaj:
2-Feb-2009
Eventually, when I built a number of OpenOffice XML files that take 
three seconds on R2, it took twenty seconds
BrianH:
9-Feb-2009
Rebin is intended to be a binary syntax for REBOL, like EBML for 
XML. All REBOL values (or maybe just the literal values) will be 
stored in a binary format. I suppose rebin would be an output format 
of MOLD and SAVE.
BrianH:
3-Apr-2009
load: func [
	{Loads a file, URL, or string.}

 source [file! url! string! binary! block!] {Source or block of sources}

 /header  {Includes REBOL header object if present. Preempts /all.}

 /next    {Load the next value only. Return block with value and new 
 position.}

;	/library {Force file to be a dynamic library. (Command version)}
;	/markup  {Convert HTML and XML to a block of tags and strings.}
	/all     {Load all values. Does not evaluate REBOL header.}
	/unbound {Do not bind the block.}
	/local data content val rst tmp

][  ; Note: Avoid use of ALL and NEXT funcs, because of /all and 
/next options
	content: val: rst: tmp: none ; In case people call LOAD/local
	
	; Retrieve the script data
	data: case [
		block? source [ ; Load all in block
			return map x source [apply :load [:x header next all unbound]]
		]
		string? source [source] ; Will convert to binary! later
		binary? source [source]
		; Otherwise source is file or url
		'else [
			; See if a codec exists for this file type
			tmp: find find system/catalog/file-types suffix? source word!
			; Get the data, script required if /header
			content: read source  ; Must be a value, not unset
			case [
				binary? :content [content] ; Assumed script or decodable
				string? :content [content] ; Assumed script or decodable
				header [cause-error 'syntax 'no-header source]
				block? :content [content]
				'else [content: reduce [:content]]
			] ; Don't LOAD/header non-script data from urls and files.

  ] ; content is data if content doesn't need copying, or none if it 
  does
	]
	;print [1 "data type?" type? :data 'content true? :content]
	if string? :data [data: to-binary data] ; REBOL script is UTF-8

 assert/type [data [binary! block!] content [binary! string! block! 
 none!]]
	assert [any [binary? :data not header]]
	if tmp [ ; Use a codec if found earlier
		set/any 'data decode first tmp :data

  ; See if we can shortcut return the value, or fake a script if we 
  can't
		case [

   block? :data [if header [insert data val: make system/standard/script 
   []]]

   header [data: reduce [val: make system/standard/script [] :data]]

   (to logic! unbound) and not next [return :data] ; Shortcut return

   any [next any-block? :data any-word? :data] [data: reduce [:data]]
			'else [return :data] ; No binding needed, shortcut return
		]
		assert/type [data block!] ; If we get this far
	]
	;print [2 'data mold to-string :data]
	
	if binary? :data [ ; It's a script
		unless find [0 8] tmp: utf? data [ ; Not UTF-8
			cause-error 'script 'no-decode ajoin ["UTF-" abs tmp]
		]
		; Process the header if necessary
		either any [header not all] [
			if tmp: script? data [data: tmp] ; Load script data
			; Check for a REBOL header
			set/any [val rst] transcode/only data
			unless case [
				:val = [rebol] [ ; Possible script-in-a-block
					set/any [val rst] transcode/next/error rst
					if block? :val [ ; Is script-in-a-block
						data: first transcode/next data
						rst: skip data 2
					] ; If true, val is header spec
				]
				:val = 'rebol [ ; Possible REBOL header
					set/any [val rst] transcode/next/error rst
					block? :val ; If true, val is header spec
				]
			] [ ; No REBOL header, use default
				val: [] rst: data
			]
			; val is the header spec block, rst the position afterwards

   assert/type [val block! rst [binary! block!] data [binary! block!]]
			assert [same? head data head rst]
			; Make the header object

   either val: attempt [construct/with :val system/standard/script] 
   [
				if (select val 'content) = true [
					val/content: any [:content copy source]
				]
			] [cause-error 'syntax 'no-header data]
			; val is correct header object! here, or you don't get here
			; Convert the rest of the data if necessary and not /next
			unless any [next block? data] [data: rst: to block! rst]
			if block? data [ ; Script-in-a-block or not /next
				case [

     header [change/part data val rst] ; Replace the header with the object

     not all [remove/part data rst]	; Remove the header from the data
				]
				rst: none ; Determined later
			]
		] [rst: data] ; /all and not /header
	]

 ; val is the header object or none, rst is the binary position after 
 or none

 assert/type [val [object! none!] rst [binary! none!] data [binary! 
 block!]]

 assert [any [none? rst same? head data head rst] any [val not header]]

 ;print [3 'val mold/all :val 'data mold/all :data "type?" type? :data]
	
	; LOAD/next or convert data to block - block either way
	assert [block? data: case [
		not next [ ; Not /next
			unless any [block? data not binary? rst] [data: to block! rst]
			data
		]
		; Otherwise /next

  block? data [reduce pick [[data] [first+ data data]] empty? data]
		header [reduce [val rst]] ; Already transcoded above
		binary? rst [transcode/next rst]
	]]
	
	; Bind to current global context if not a module
	unless any [ ; Note: NOT ANY instead of ALL because of /all
		unbound
		(select val 'type) = 'module
	][
		bind/new data system/contexts/current
	]
	;print [6 'data mold/all :data 'tmp mold/all :tmp]
	
	; If appropriate and possible, return singular data value
	unless any [
		all header next  ; /all /header /next
		empty? data
		1 < length? data
	][set/any 'data first data]
	;print [7 'data mold/all :data]
	
	:data
]
Maxim:
30-May-2009
in cases where the data is pretty linear or backup isn't needed due 
to format, a simple error is all you need to return when you encounter 
un-expected data... this can mean streamed xml parsing.
shadwolf:
2-Jun-2009
Carl > Have you seen wave.google.com ? 

why isn't that kind of project  made with  Rebol ?
 

I mean most of the technologies involved in wave could be done using 
rebol and even in a better way if  instead of jave/python xml and 
html you can design a wave oriented dialect . Your clever than me 
so I think you already got the point.
Chris:
9-Jun-2009
do http://www.ross-gill.com/r/altxml.r

r3tweets: load-xml/dom http://twitter.com/statuses/user_timeline/45953552.rss
                     
foreach tweet r3tweets/get-by-tag <item> [
	print ""
	print tweet/get <pubDate>
	print tweet/get <title>
]
BrianH:
10-Aug-2009
Sounds interesting. A few comments:

- Colons and semi-colons don't have special meaning within REBOL 
string literals - { and " do (depending on how they are specified).

- String literals in programming languages almost always have escaping, 
though the capabilities vary from language to language. Escaping 
is done to include data in the string that would otherwise break 
the syntax. Without escaping you will never be able to include certain 
characters or character sequences.


There's a lot of terms and methods for what you are asking for, such 
as here docs (from Perl), CDATA sections (from XML), etc. An interesting 
idea, though it is usually cause for concern when we look to Perl 
or XML for syntax ideas - that's usually a bad road to take. Remember, 
when you get rid of escaping you limit the characters (or sequences) 
that you can include, though with here docs that limit can be minimal.
RobertS:
13-Aug-2009
A server-side scripting language which cannot handle literal strings 
- and especially one that claims to be Unicode - has to be excluded 
from consideration for templating web content which is expressed 
in any other langauge which uses curly braces.  I told BrianH that 
the red flag here should be Tcl as Rebol shares this with Tcl.  Literal 
string are literal strings.  Period.  No if's and's or "that might 
be my curly brace in there" ...  Unless you dream of a Rebol-only 
world - and that fantasy should have passed some years back.    This 
falls under the heading of folly - a topic too often neglected.  
Folly in a meritocracy usually requires some individual to speak 
up.  But the folly of meritocracies is that  to be heard taht individual 
would already have to be playing within those constraints.  We see 
this in schools which graduate top people distinguished for inidividual 
effort who then do not fit well into teams.  They did group work 
in college by being the one who saved the group from failure by ... 
their individual effort.  For me this will be what makes or breaks 
my involvement with REBOL.  I could not wait for REBOL4 and hope 
for change then by getting into the merit circle.  My outside voice 
would have to be heard before it is too late. Tcl as the do-all is 
folly.  As nuch as I admire OOTcl, the XOTcl IDE and Expect.  I cannot 
use Tcl with "balanced brace" foolishness.  Of course if we all adopt 
XML and abandon scripting in non-XML languages ... So  We have comment 
{  }  and that was a mistake: it should have been symmetrical as 
in c{ comment here as literal with } or whatever }c   And that is 
water under the bridge.  We cannot be UNICODE and claim that  we 
must escape a certain pair  of characters if ithey are in a literal 
string.  That is silly. Ludicrous. Folly.  A literal string is a 
data value where you do not get to peek.  Imagine a proxy object 
that said: "I will be your proxy only if you promise that when the 
real object appears it does not contain [ folly happens here ] " 
  Many forms of "catch-22" in the world of beaurocratic regulation 
have a similar pattern.  I am no expert on unintended consequences, 
but requiring that some pair of characters be escaped in otherwise 
literal content has consequences for TEMPLATE value TEMPLATE  There 
should be a lesson there: some markup must be arbitrary and the choice 
will matter.  { and } are the wrong choice.  At least the terminal 
markup must be "sacrificed (it will always have to be escaped so 
pick carefully.   [{ is a bad combo for JSON so #[{ looks worrisome 
to me.  I propose lit |ls# and_content_then  #ls|    Someone shoots 
that down and we inch towards a suitable result.  Not perfect.  But 
usable.  { and } are not useable in the real world on the server-side 
if rebol is to play a role with other languages.  Play nice.  Please.
RobertS:
13-Aug-2009
What is obscure about a syntax which permits literal strings to be 
literal strings?  Try assigning  set lit "{test} {" in your favorite 
Tcl interpreter.  I am not a JSON expert but [{ looks like JSON to 
me so #{[ "looks worrisome to me"   JSON or YAML or something other 
than XML is going to be important whether REBOL likes it or not. 
 Take RDF as one exmaple ( I prefer Topic Maps - please do not attack 
the example, but the isea ).  The fact that most people seem to think 
that RDF is XML does not make it so.  Tim Berners-Lee prefers some 
form of Triple notation for RDF.  Not XML.  As soon as a notation 
uses curly braces we have a problem using Curl on the server-side. 
 Please don't point to QM.  IT is not just tightly coupled to HTML 
it is married to it.  The web is not HTML it is HTTP with Content-Type: 
 set in the response header.  If that content type uses curly braces 
we have to start escaping characters in Rebol.  Awkward templating 
is dooked templating.  Let me repeat: doomed.  Folly.
BrianH:
13-Aug-2009
RobertS, you said that similarity with TCL is a red flag, but that 
is not the case. TCL, like Ruby, is known to be bad because of its 
internals and semantics, not its syntax. XML and Perl are the ones 
with bad syntax.
Maxim:
10-Sep-2009
so basically, you build a little module in cheyenne which does a 
tcp exchange to your R3 server.  

the R3 server maps the request to a module, returns the molded result.

cheyenne then returns the value in an xml block which your ajax app 
did the request for.


allowing multiple handlers on the cheyenne side (and an equal amount 
of R3 servers) would allow you to support multiple concurrent users, 
but you'd have to map which R3 service is being used within the cheyenne 
module, in order to send your tcp request to a free R3 service.

does any of this make sense?
Maxim:
10-Sep-2009
sort of like a mini embeded windows kernel... very similar in spirit 
to REBOL actually... but taking the abysmal route in terms the coding 
interface (XML aaargh ... depressing).
Maxim:
11-Sep-2009
some systeme like RSS even support multiple encodings in the same 
xml document!
shadwolf:
23-Sep-2009
maxim that's like if i was asking you to do 3D secenes in XML format 
because hey man i have thet vid xml-opengl rendering black box that 
will do the work for you but hey you don't have any control upon 
the rendering engine
shadwolf:
23-Sep-2009
maxim with an imposed close format and an imposed close black box 
called "doc"  what you gain in a hand you lost it on the other hand 
cause you still have to convert your raw data into the specifiq imposed 
markup language and if that markup language have limitations then 
you have find again new tricks to do what wasn't planned to be done... 
 that's not like choosing your own format and then your own rendering 
line. That's why i said in my example we impose to you the use oof 
XML  sheets to represent your 3D data (which is obviously far to 
be the most performant and the most suited to that use) and you are 
stuck to what the black box is able to do no way for you to directly 
have an impact on the rendering line.
Steeve:
7-Oct-2009
Have we a built-in function to decode xml data, currently ? Perhaps, 
i missed something...
Sunanda:
7-Oct-2009
R2 has 'parse-xml and its helper function 'xml-language.

You can copy their sources to R3 .... but they are currently seriously 
buggy there.


Gavin's XML parser was better in R2....It has no equivalent in R3 
yet:
    http://www.rebol.org/view-script.r?script=xml-parse.r


I guess we are waiting for parse to settle down before getting decent 
XML tools.
Chris:
22-Oct-2009
Another shot at reworking my XML loader for R3: http://bit.ly/xml_rebol
- works mostly, try:

	rss: load-xml/dom http://www.rebol.com/article/carl-rss.xml
	entries: rss/get-by-tag <item>
	foreach entry entries [probe entry/get <title>]

However trips at the first line of the first example:

	html: load-xml/dom http://w3.org

as follows:

	>> do http://www.ross-gill.com/r/r3xml.r
	Script: "XML for REBOL 3" Version: 0.2.0 Date: 22-Oct-2009
	>> html: load-xml/dom http://w3.org

 ** Access error: protocol error: "Redirect to other host - requires 
 custom handling"


	>> html: load-xml/dom http://www.w3.org
	Segmentation fault

On 2.100.90.2.5
Group: !Cheyenne ... Discussions about the Cheyenne Web Server [web-public]
Graham:
19-Aug-2009
this is the request


GET /md/creategoogledoc.rsp?gdoc=simple-letter.rtf&patientid=2832&encounter=none 
HTTP/1.1
Host: gchiu.no-ip.biz:8000

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) 
Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://gchiu.no-ip.biz:8000/md/Listgoogledocs.rsp
Cookie: RSPSID=QZPTPCZIWWMMYBKWHWRQETGM
Dockimbel:
10-Sep-2009
Graham did some work on REST support for Cheyenne. SOAP requires 
a XML encoder/decoder in your RSP script.
Dockimbel:
15-Oct-2009
Pekr: that's in my todo list, I just need to find some free time 
to think more deeply about how to support such feature efficiently.


Btw, I have built a XMLC (XML Compiler) engine inspired by enhydra 
(http://www.enhydra.org/tech/xmlc/index.html) which should fit perfectly 
your needs. It's a working prototype but need some significant work 
to be integrated within Cheyenne, so it's low priority for now.
Maxim:
15-Oct-2009
well... the main call to remark is ... compile   hehehe...  I do 
plan on making an XML document model eventually.  basically, it would 
convert XML elements into your current Remark document models, so 
you can leverage the same code base but with another data model as 
input.


optionally you could build direct XML document models for a bit more 
speed.


all that needs to be done to make it easy for you guys is to build 
a few simple base XML tags which allow you to build the dialect based 
on xml element names.
Terry:
10-Nov-2009
I want to unify communications using Cheyenne (Rebol) as the middleware, 
pulling and pushing info through and to each other

ie: an event message from Freeswitch is processed via xml socket, 
processed, and pushed to a web page via comet / ajax.. and back again..
Terry:
23-Dec-2009
I can envision a day when everything will have an "always on" connection 
with everything else that is important.. probably via websockets. 
 ie: my email, chats, voicemails pushed to me wherever i am, and 
on whatever device. The ability to do this is nothing new (SOAP, 
XML-RPC etc), but what is missing is a homogenous catalyst... the 
webserver seems the most likely candidate, as they are the de-facto 
interface to the world's DBs. This is my vision for Cheyenne, that 
of an Uber-server.
Graham:
25-Dec-2009
Not using the default config .. but I get this

26/12-10:17:23.838-[RSP] ##RSP Script Error: 

	URL  = /ws.rsp
	File = www/ws.rsp

	** Script Error : Invalid path value: data 
	** Where: rsp-script 
	** Near:  [prin request/content/data] 


Request  = make object! [

    headers: [Host "localhost:8000" Connection "keep-alive" User-Agent 
    {Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 
    (KHTML, like Gecko) Chrome/4.0.249.43 Safari/532.5} Accept {application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5} 
    Accept-Encoding "gzip,deflate" Accept-Language "en-GB,en-US;q=0.8,en;q=0.6" 
    Accept-Charset "ISO-8859-1,utf-8;q=0.7,*;q=0.3"]
    status-line: #{474554202F77732E72737020485454502F312E310D0A}
    method: 'GET
    url: "/ws.rsp"
    content: none
    path: "/"
    target: "ws.rsp"
    arg: none
    ext: '.rsp
    version: none
    file: %www/ws.rsp
    script-name: none
    ws?: none
]
Terry:
25-Dec-2009
On the design side, a packet-oriented protocol not sending packet 
length (for text frames), rather relying on begin/end markers, is 
a surprizing choice to me.
 

I think this is pretty much standard.. 
From an Xml sockets in Flash article


send() - This method allows you to send a string of characters through 
the socket connection. While the string is usually in XML format 
it does not have to be. This string can either be constructed using 
the XML object within Flash, or manually if size permits. Flash will 
also automatically append the terminating null character for you.
501 / 66612345[6] 7