Re: XML+MySQL+UTF8 = MISERY

2010-09-17 Thread Trevor DeVore

On Sep 17, 2010, at 1:39 AM, Tereza Snyder wrote:

  6b I upload the scored survey to a MySQL database on the remote  
server, first escaping it:

   put revXMLText( gTaxoDataA[gCurrentSlot][kID] ,,true) into tXML
   replace \ with \\ in tXML
   replace quote with \  quote in tXML
   replace ' with \' in tXML
   replace tab with \t in tXML
   replace cr with \n in tXML
   put encodeUtf8( tXML ) into tData


What encoding does the column in your MySQL database use? I set the  
default encoding for the DB to UTF-8 and don't have any problems but I  
think you have to do that explicitly.


Regards,

--
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com-www.screensteps.com

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML+MySQL+UTF8 = MISERY

2010-09-17 Thread Tereza Snyder

On Sep 17, 2010, at 12:53 AM, Mark Wieder wrote:

 Tereza-
 
 Thursday, September 16, 2010, 10:39:01 PM, you wrote:
 
 Does anything stand out to those of you who have used MySQL? and revXML? and 
 utf8?
 
 I haven't used that combination, particularly the utf8 part, but off
 the top of my head, I'd say one problem looks like MySQL is making
 crlf pairs from your cr characters. When you say that you're using an
 insert command to put the data into the database, are you storing it
 as a BLOB?

I'm storing it as mediumtext. I will try BLOBbing it.

t


-- 
Tereza Snyder
Califex Software, Inc.
www.califexsoftware.com




___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML+MySQL+UTF8 = MISERY

2010-09-17 Thread Tereza Snyder

On Sep 17, 2010, at 7:15 AM, Trevor DeVore wrote:

 On Sep 17, 2010, at 1:39 AM, Tereza Snyder wrote:
 
  6b I upload the scored survey to a MySQL database on the remote server, 
 first escaping it:
 put revXMLText( gTaxoDataA[gCurrentSlot][kID] ,,true) into tXML
 replace \ with \\ in tXML
 replace quote with \  quote in tXML
 replace ' with \' in tXML
 replace tab with \t in tXML
 replace cr with \n in tXML
 put encodeUtf8( tXML ) into tData
 
 What encoding does the column in your MySQL database use? I set the default 
 encoding for the DB to UTF-8 and don't have any problems but I think you have 
 to do that explicitly.
 

I will try setting the encoding for the column. I did experiment with doing 
that earlier in the debugging process to no avail but I will throw that back 
into the mix!

thanks


t

-- 
Tereza Snyder
Califex Software, Inc.
www.califexsoftware.com




___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


XML+MySQL+UTF8 = MISERY

2010-09-16 Thread Tereza Snyder
Hi all,

In Rev (version 4.0) on a Mac :

1. Build an xml file starting with a 'shell' :
put revCreateXMLTree( encodeUtf8( merge(fld XMLshell)), true,true,false) 
into tmp

1a. the shell has the header: ?xml version=1.0 encoding=utf-8?

1b. the encodeUtf8 function:
 return uniDecode(uniEncode(pStr,UTF8),english)

2. I add about a thousand nodes to the xml. (It's a branching survey.)

3. I save it with:  put tXML into URL (file:  tDestinationFilePath) 
where tDestinationFilePath is a local file

4. The file is copied to a remote server

5. I download it in a Rev app via FTP (using libURL)

6. In the app, I make a new xml tree: 
put revCreateXMLTree( tXML, false, true, false) into tTreeID

6a I 'score' the survey by updating attributes and contents,

6b I put the xml into a variable:
 put encodeUtf8( revXMLText( tID ,,true)) into tData

6c I save it back to the FTP server.

7. I download the file as in step 5 and work with it and save it via FTP, ad 
infinitum

=
ALL THE ABOVE STEPS WORK RELIABLY
=

Now I want to alter the sequence to store the scored survey xml in a MySQL 
database :

1. As above

2. As above

3. As above

4. As above

5. As above

6. As above

   6a As above
   
   6b I upload the scored survey to a MySQL database on the remote server, 
first escaping it:
   put revXMLText( gTaxoDataA[gCurrentSlot][kID] ,,true) into tXML
   replace \ with \\ in tXML
   replace quote with \  quote in tXML
   replace ' with \' in tXML
   replace tab with \t in tXML
   replace cr with \n in tXML
   put encodeUtf8( tXML ) into tData
   
6c I use INSERT to put tData into a column named xml in the MySQL database

6d Using other tools like Navicat, I see that the xml column does indeed 
contain the xml
  
7. I use a SELECT statement to retreive the xml, and attempt to make an xml 
tree again BUT no matter what I do with encoding or decoding or whatever, I get 
this error from revCreateXMLTree:

xmlerr, can't parse xml no root element


-- If I load the file from the first sequence into BBEdit, BBEdit reports that 
it is utf8, with Unix (LF) line endings.

-- If save the xml I get back from the MySQL in the second sequence--as a file 
or a binfile--and load the file into BBEdit, BBEdit reports that it is utf8, 
with Classic Mac (CR) line endings.

I thought, Oh boy! thats it! but NO. 

I replaced numToChar(13) with numToChar(10) in the xml from MySQL, but still 
the same error on attempting to make an xml tree. 

The xml itself looks identical and BBEdit says there are no differences, but it 
also says there are about 7000 more characters in the MySQL version! What's up 
with that?

Does anything stand out to those of you who have used MySQL? and revXML? and 
utf8? 

Is there hope?

t




-- 
Tereza Snyder
Califex Software, Inc.
www.califexsoftware.com




___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML+MySQL+UTF8 = MISERY

2010-09-16 Thread Mark Wieder
Tereza-

Thursday, September 16, 2010, 10:39:01 PM, you wrote:

 Does anything stand out to those of you who have used MySQL? and revXML? and 
 utf8?

I haven't used that combination, particularly the utf8 part, but off
the top of my head, I'd say one problem looks like MySQL is making
crlf pairs from your cr characters. When you say that you're using an
insert command to put the data into the database, are you storing it
as a BLOB?

-- 
-Mark Wieder
 mwie...@ahsoftware.net

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Rev Create XML Tree

2010-07-29 Thread Ben Rubinstein

On 28/07/2010 18:49, J. Landman Gay wrote:

On 7/28/10 11:33 AM, Mark Wieder wrote:


...and for my two cents' worth, it's hard to think of using the terms
xml and performance in the same thought...



Yeah. And it's hard to work with in all kinds of ways. I can't figure
out why it's become the de facto standard for so many things. Surely
there's a better way.


I think the three of us must be old!  I used to sniff at XML too: not only the 
performance implications of parsing it, but also the appalling verbosity as a 
format.


But, pardoning me for pointing out (and apologies in advance if it's just me) 
we're... ol^H^H experienced; we've grown up when every byte and cpu cycle was 
precious and it was worth hours or days to save a few.  Now we're conserving 
the wrong things: because CPUs are incredibly fast, and RAM is vast, and 
drives are huge, and the cloud is inexhaustible... and the resource that is 
really scarce now is developer time.  XML saves a great deal of that, and the 
cost in performance and compactness is a small price to pay.


The advent of smartphones made me think for the first time in years that at 
last my rusty old reactions, that my young colleagues sneer at, had a value 
again - but it turns out that even these tiny things have such performance and 
capacity that I'm wrong, yet again.


yrs aye,

'Old Ben'
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Rev Create XML Tree

2010-07-28 Thread Ray Horsley

Greetings,

I'm getting errors when passing XML to this handler, usually because  
there's something odd characters like an em dash in it.  Anybody have  
any experience with this library?  I'm believe it's going to be a  
matter of properly encoding/decoding the data, although I've tried the  
base64 encoding and decoding which seems to be the only kind of  
encoding Rev offers.  I am compressing/decompresing the data to speed  
performance.


Ideas?

Thanks,

Ray Horsley
LinkIt! Software

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Rev Create XML Tree

2010-07-28 Thread Andre Garzia
Ray,

I don't think emdashes are allowed inside XML. You emdash is in a node
content or a tag? If it is in a node content and you encoded it like
emdash; then it will not work because the only escaping that xml knows by
default is amp; so if you encode your emdash like amp;emdash; and you do a
double decode when you want to use the content like first making the amp;
into  and then the emdash; back into a real emdash, it should work.

You can make your XML an UTF8 file and use emdashes directly as well. The
above solution is to keep things under pure ascii charset.

You might conside passing your xml first thru uniDecode before trying to
pass it thru revcreatexmltree as well, this might help you keep your
emdashes without any conversion to xml entities.

Andre

On Wed, Jul 28, 2010 at 5:57 PM, Ray Horsley r...@linkit.com wrote:

 Greetings,

 I'm getting errors when passing XML to this handler, usually because
 there's something odd characters like an em dash in it.  Anybody have any
 experience with this library?  I'm believe it's going to be a matter of
 properly encoding/decoding the data, although I've tried the base64 encoding
 and decoding which seems to be the only kind of encoding Rev offers.  I am
 compressing/decompresing the data to speed performance.

 Ideas?

 Thanks,

 Ray Horsley
 LinkIt! Software

 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution




-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Rev Create XML Tree

2010-07-28 Thread Mark Wieder
Ray-

I've taken to urlencoding my xml data if it contains any chars that
are not straightforward printable ASCII - I had some problems a while
back with base64encoding long data strings like imagedata. Don't know
why, but the data was getting truncated, while urlencoding always
seems to work. So now I check the data first for things like return
chars, tabs, etc. and encode the data if necessary. You also can't
have purely numeric xml tags, so I fiddle with them and decontruct the
fiddling on the way out. And the rev xml library doesn't like
namespaces at all - just strips them out.

You might also try using the CDATA form of storing your data if you
have binary info to convey. I try to avoid it because I find it
awkward and I can never remember the syntax...or maybe I can never
remember the syntax because I try to avoid using it...

...and for my two cents' worth, it's hard to think of using the terms
xml and performance in the same thought...

-- 
-Mark Wieder
 mwie...@ahsoftware.net

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Rev Create XML Tree

2010-07-28 Thread Andre Garzia
Another trick is to replace the : in the namespaces with - so that you
somehow preserve the namespace, you need to know which namespaces you will
be dealing with for example, if dealing with an ATOM feed you know that
there will be atom:tag inside your xml, you can do a simple

replace atom: with atom- in tXML

and refer to your tags with the atom- prefix. It is a hack but it is your
only option.

:D


On Wed, Jul 28, 2010 at 1:33 PM, Mark Wieder mwie...@ahsoftware.net wrote:

 Ray-

 I've taken to urlencoding my xml data if it contains any chars that
 are not straightforward printable ASCII - I had some problems a while
 back with base64encoding long data strings like imagedata. Don't know
 why, but the data was getting truncated, while urlencoding always
 seems to work. So now I check the data first for things like return
 chars, tabs, etc. and encode the data if necessary. You also can't
 have purely numeric xml tags, so I fiddle with them and decontruct the
 fiddling on the way out. And the rev xml library doesn't like
 namespaces at all - just strips them out.

 You might also try using the CDATA form of storing your data if you
 have binary info to convey. I try to avoid it because I find it
 awkward and I can never remember the syntax...or maybe I can never
 remember the syntax because I try to avoid using it...

 ...and for my two cents' worth, it's hard to think of using the terms
 xml and performance in the same thought...

 --
 -Mark Wieder
  mwie...@ahsoftware.net

 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution




-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Rev Create XML Tree

2010-07-28 Thread J. Landman Gay

On 7/28/10 11:33 AM, Mark Wieder wrote:


...and for my two cents' worth, it's hard to think of using the terms
xml and performance in the same thought...



Yeah. And it's hard to work with in all kinds of ways. I can't figure 
out why it's become the de facto standard for so many things. Surely 
there's a better way.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Rev Create XML Tree

2010-07-28 Thread Ray Horsley

André, Jacque, Mark,

Thanks for these ideas.  Actually, I was hoping for an overall  
solution for this as oposed to various ideas as to how to approach  
various single characters which cause problems.  Does anybody have any  
experience with the Blowfish solution?  This might be the overall  
solution I'm looking for.


Thanks,

Ray

On Jul 28, 2010, at 12:36 PM, Andre Garzia wrote:

Another trick is to replace the : in the namespaces with - so  
that you
somehow preserve the namespace, you need to know which namespaces  
you will
be dealing with for example, if dealing with an ATOM feed you know  
that

there will be atom:tag inside your xml, you can do a simple

   replace atom: with atom- in tXML

and refer to your tags with the atom- prefix. It is a hack but it  
is your

only option.

:D


On Wed, Jul 28, 2010 at 1:33 PM, Mark Wieder  
mwie...@ahsoftware.net wrote:



Ray-

I've taken to urlencoding my xml data if it contains any chars that
are not straightforward printable ASCII - I had some problems a while
back with base64encoding long data strings like imagedata. Don't know
why, but the data was getting truncated, while urlencoding always
seems to work. So now I check the data first for things like return
chars, tabs, etc. and encode the data if necessary. You also can't
have purely numeric xml tags, so I fiddle with them and decontruct  
the

fiddling on the way out. And the rev xml library doesn't like
namespaces at all - just strips them out.

You might also try using the CDATA form of storing your data if you
have binary info to convey. I try to avoid it because I find it
awkward and I can never remember the syntax...or maybe I can never
remember the syntax because I try to avoid using it...

...and for my two cents' worth, it's hard to think of using the terms
xml and performance in the same thought...

--
-Mark Wieder
mwie...@ahsoftware.net

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution





--
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML one-liner (if possible)

2010-07-14 Thread viktoras d.
I needed to display formatted document created from an xml source with 
ability to save it as it is displayed. HTMLtext suites here best. And 
all this had to work on Linux...


Solved now.

Thanks for all the hints!
Viktoras

Colin Holgate wrote:


That sounds more complicated than my example. What is the overall goal? If it's 
just to look at the xml in a field, then my one liner would do that (so long as 
the xml file can be read as a URL). Do you want to just use some of the xml, or 
process it in some way?



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

  


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML one-liner (if possible)

2010-07-14 Thread Sarah Reichelt
 After every call to a revXML function, you can check the result for
 xmlerr which indicates a problem.

 ...with certain exceptions.

 put revXMLNextSibling(tXMLID, tNode) into tNextNode

 will return empty if there's no next sibling. So *mostly* you need to
 check for xmlerr to see if you're done, and *sometimes* you also
 need to check for empty or get stuck in an endless loop.


Sure, but I think the 3 xml functions I suggested all return xmlerr if
there is a problem.
So in this case, a check for xmlerr will be sufficient.

Cheers,
Sarah
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


XML one-liner (if possible)

2010-07-13 Thread viktoras d.
err., what's the simplest way of displaying all contents of an XML 
document in a rev field? e.g. getting a list of all elements with all 
their attributes and values. Is there a simple way to do this - a one 
liner probably ;-) ?


Viktoras
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML one-liner (if possible)

2010-07-13 Thread Colin Holgate

On Jul 13, 2010, at 5:19 PM, viktoras d. wrote:

 err., what's the simplest way of displaying all contents of an XML document 
 in a rev field? e.g. getting a list of all elements with all their attributes 
 and values. Is there a simple way to do this - a one liner probably ;-) ?


put URL http://www.apple.com/crossdomain.xml; into field 
1___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML one-liner (if possible)

2010-07-13 Thread Mark Wieder
viktoras-

Tuesday, July 13, 2010, 2:19:41 PM, you wrote:

 err., what's the simplest way of displaying all contents of an XML 
 document in a rev field? e.g. getting a list of all elements with all
 their attributes and values. Is there a simple way to do this - a one
 liner probably ;-) ?

I'm not sure this can be done in one line, but...

place a browser control and a button onto your stack and then:

-- button scrips
on mouseUp pMouseBtnNo
local tBrowserID

answer file where is the file?
if it is not empty then
put revBrowserOpen(the windowID of this stack, file:  it) into 
tBrowserID
revBrowserSet tBrowserID, rect, the rect of image browserimage
end if
end mouseUp

-- 
-Mark Wieder
 mwie...@ahsoftware.net

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML one-liner (if possible)

2010-07-13 Thread viktoras d.

Thank you Colin, Mark!

Changing point of view is refreshing! I rolled out a solution which is 
getting unreasonably complex using all the revXML stuff and finally got 
suck... Now after seeing your examples I  realized that the simplest way 
to display xml with known schema is to transform it by simply replacing 
xml tags with html in the source text and setting htmltext of field to 
it (!).


Best wishes!
Viktoras

Mark Wieder wrote:

viktoras-

Tuesday, July 13, 2010, 2:19:41 PM, you wrote:

  
err., what's the simplest way of displaying all contents of an XML 
document in a rev field? e.g. getting a list of all elements with all

their attributes and values. Is there a simple way to do this - a one
liner probably ;-) ?



I'm not sure this can be done in one line, but...

place a browser control and a button onto your stack and then:

-- button scrips
on mouseUp pMouseBtnNo
local tBrowserID

answer file where is the file?

if it is not empty then
put revBrowserOpen(the windowID of this stack, file:  it) into 
tBrowserID
revBrowserSet tBrowserID, rect, the rect of image browserimage
end if
end mouseUp

  


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML one-liner (if possible)

2010-07-13 Thread Colin Holgate

On Jul 13, 2010, at 6:35 PM, viktoras d. wrote:

 I  realized that the simplest way to display xml with known schema is to 
 transform it by simply replacing xml tags with html in the source text and 
 setting htmltext of field to it (!).


That sounds more complicated than my example. What is the overall goal? If it's 
just to look at the xml in a field, then my one liner would do that (so long as 
the xml file can be read as a URL). Do you want to just use some of the xml, or 
process it in some way?



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML one-liner (if possible)

2010-07-13 Thread Sarah Reichelt
On Wed, Jul 14, 2010 at 7:19 AM, viktoras d. vikto...@ekoinf.net wrote:
 err., what's the simplest way of displaying all contents of an XML document
 in a rev field? e.g. getting a list of all elements with all their
 attributes and values. Is there a simple way to do this - a one liner
 probably ;-) ?

Not a one-liner, but try this:

   put URL (file:  tFileName) into tData
   put revCreateXMLTree(tData, false, true, false) into tDocID
   put revXMLRootNode(tDocID) into tParentNode
   put revXMLText(tDocID, tParentNode, true) into tXML

After every call to a revXML function, you can check the result for
xmlerr which indicates a problem.

Cheers,
Sarah
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML one-liner (if possible)

2010-07-13 Thread Mark Wieder
Sarah-

Tuesday, July 13, 2010, 3:55:02 PM, you wrote:

 After every call to a revXML function, you can check the result for
 xmlerr which indicates a problem.

...with certain exceptions.

put revXMLNextSibling(tXMLID, tNode) into tNextNode

will return empty if there's no next sibling. So *mostly* you need to
check for xmlerr to see if you're done, and *sometimes* you also
need to check for empty or get stuck in an endless loop.

-- 
-Mark Wieder
 mwie...@ahsoftware.net

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sarah Reichelt's XML sample stack

2010-06-26 Thread Sarah Reichelt
On Sat, Jun 26, 2010 at 12:36 PM, Simon Lord sl...@karbonized.com wrote:
 Is Sarah still around?  I searched the archives for an XML sample
 stack to get my feet wet but her sample seems to be missing from her
 site (I can't find it to save my life).

Still here :-)

My XML stack was online but had got lost from the stacks list, so was
effectively invisible.
It's listed now but here is a direct link
http://www.troz.net/rev/stacks/XMLdemo1.rev

-- 
Cheers,
Sarah

Rodeo discussion:
http://rodeoapps.com/rodeo-discuss-among-yourselves
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sarah Reichelt's XML sample stack

2010-06-26 Thread Simon Lord
Excellent.  Thanks guys. :)


On Sat, Jun 26, 2010 at 4:32 AM, Sarah Reichelt
sarah.reich...@gmail.com wrote:
 On Sat, Jun 26, 2010 at 12:36 PM, Simon Lord sl...@karbonized.com wrote:
 Is Sarah still around?  I searched the archives for an XML sample
 stack to get my feet wet but her sample seems to be missing from her
 site (I can't find it to save my life).

 Still here :-)

 My XML stack was online but had got lost from the stacks list, so was
 effectively invisible.
 It's listed now but here is a direct link
 http://www.troz.net/rev/stacks/XMLdemo1.rev

 --
 Cheers,
 Sarah

 Rodeo discussion:
 http://rodeoapps.com/rodeo-discuss-among-yourselves
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sarah Reichelt's XML sample stack

2010-06-26 Thread Michael Kann
I could have sworn that I saw you in the stands when the Socceroos played 
Germany. You were dressed up like a kangaroo blowing into a vuvuzela horn. That 
wasn't you? I swear it looked exactly like you.

Anyway, now that the Socceroos are back home we're all glad that you have time 
to work on your programming. 





--- On Sat, 6/26/10, Sarah Reichelt sarah.reich...@gmail.com wrote:

 From: Sarah Reichelt sarah.reich...@gmail.com
 Subject: Re: Sarah Reichelt's XML sample stack
 To: How to use Revolution use-revolution@lists.runrev.com
 Date: Saturday, June 26, 2010, 3:32 AM
 On Sat, Jun 26, 2010 at 12:36 PM,
 Simon Lord sl...@karbonized.com
 wrote:
  Is Sarah still around?  I searched the archives for
 an XML sample
  stack to get my feet wet but her sample seems to be
 missing from her
  site (I can't find it to save my life).
 
 Still here :-)
 
 My XML stack was online but had got lost from the stacks
 list, so was
 effectively invisible.
 It's listed now but here is a direct link
 http://www.troz.net/rev/stacks/XMLdemo1.rev
 
 -- 
 Cheers,
 Sarah
 
 Rodeo discussion:
 http://rodeoapps.com/rodeo-discuss-among-yourselves
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage
 your subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution
 



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Sarah Reichelt's XML sample stack

2010-06-26 Thread Simon Lord
Sarah, your tutorial stack is a rosetta stone.  Thanks for taking the
effort to make it.



On Sat, Jun 26, 2010 at 4:32 AM, Sarah Reichelt
sarah.reich...@gmail.com wrote:
 On Sat, Jun 26, 2010 at 12:36 PM, Simon Lord sl...@karbonized.com wrote:
 Is Sarah still around?  I searched the archives for an XML sample
 stack to get my feet wet but her sample seems to be missing from her
 site (I can't find it to save my life).

 Still here :-)

 My XML stack was online but had got lost from the stacks list, so was
 effectively invisible.
 It's listed now but here is a direct link
 http://www.troz.net/rev/stacks/XMLdemo1.rev

 --
 Cheers,
 Sarah

 Rodeo discussion:
 http://rodeoapps.com/rodeo-discuss-among-yourselves
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Sarah Reichelt's XML sample stack

2010-06-25 Thread Simon Lord
Is Sarah still around?  I searched the archives for an XML sample
stack to get my feet wet but her sample seems to be missing from her
site (I can't find it to save my life).

I also found 1 revonline lesson but would like a few *starter* stacks
to review as well.

Thanks.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


RE: Sarah Reichelt's XML sample stack

2010-06-25 Thread Mark Smith
Hi Simon, there is a lot of material online although it can take awhile to 
find. I've compiled some of the most interesting looking links below (if anyone 
knows of others sites please let me know). Keep in mind that the BYU course 
material is all online, so you don't have to signup or register for anything on 
that site. Also, I think Sarah Reichelt's blog is listed here (its 
identified only by the first name). I've not tried all of these so can't vouch 
for them, but they are my intended starting points. If you have the stamina to 
work through this you'll be a Rev guru by the end. Good luck. 

http://www.runrev.com/developers/lessons-and-tutorials/tutorials/online-scripting-conferences/

http://www.aslugontheroad.co.cc/index.php?option=com_weblinksview=categoryid=36%3Ahow-to-scriptItemid=61

http://www.tactilemedia.com/index.html?http%3A//www.tactilemedia.com/site_files/software/tutorials.html%3Fhttp%253A//www.tactilemedia.com/site_files/software/tutorial_thumbs.html

http://sarahrev.blogspot.com/

http://revolution.byu.edu./

http://www.runrev.com/developers/

http://runrevplanet.com/index.php?option=com_contentview=sectionlayout=blogid=7Itemid=65limitstart=8

http://runrevplanet.com/index.php?searchword=tip+1ordering=searchphrase=allItemid=1option=com_search

-- Mark


From: use-revolution-boun...@lists.runrev.com 
[use-revolution-boun...@lists.runrev.com] On Behalf Of Simon Lord 
[sl...@karbonized.com]
Sent: Friday, June 25, 2010 9:36 PM
To: How to use Revolution
Subject: Sarah Reichelt's XML sample stack

Is Sarah still around?  I searched the archives for an XML sample
stack to get my feet wet but her sample seems to be missing from her
site (I can't find it to save my life).

I also found 1 revonline lesson but would like a few *starter* stacks
to review as well.

Thanks.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: That nice XML exporter for stacks...

2010-06-15 Thread Geoff Canyon Rev
I think I used the properties property, which even then didn't get
absolutely everything, but did get nearly all the properties. If it's
been kept up to date the stack should already be in sync.

gc

On Sun, May 16, 2010 at 4:18 PM, Alejandro Tejada
capellan2...@gmail.com wrote:

 Hi Andre,

 Will you update Geoff Canyon's stack?

 If so, please post a link to download this
 updated version. Recent versions of Rev
 added many new properties to objects.

 Thanks in advance!

 Alejandro
 --
 View this message in context: 
 http://runtime-revolution.278305.n4.nabble.com/That-nice-XML-exporter-for-stacks-tp2172738p2218887.html
 Sent from the Revolution - User mailing list archive at Nabble.com.
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: That nice XML exporter for stacks...

2010-05-16 Thread Alejandro Tejada

Hi Andre,

Will you update Geoff Canyon's stack?

If so, please post a link to download this
updated version. Recent versions of Rev
added many new properties to objects.

Thanks in advance!

Alejandro
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/That-nice-XML-exporter-for-stacks-tp2172738p2218887.html
Sent from the Revolution - User mailing list archive at Nabble.com.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


That nice XML exporter for stacks...

2010-05-10 Thread Andre Garzia
Hello Folks,

Anyone here remember a sample stack that would export a Rev stack with all
properties and scripts to an XML file?

I don't see it anymore in the bundled files. If you guys don't remember it
is ok, but can someone here think a clever way to iterate over all controls?
is something along the lines of

repeat with x = 1 to the number of cards in the cardnames of this stack
  repeat with y = 1 to the number of controls in card x of this stack
...
  end repeat
end repeat

ok?

-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: That nice XML exporter for stacks...

2010-05-10 Thread Richmond Mathewson

 On 10/05/2010 21:32, Andre Garzia wrote:

Hello Folks,

Anyone here remember a sample stack that would export a Rev stack with all
properties and scripts to an XML file?

I don't see it anymore in the bundled files. If you guys don't remember it
is ok, but can someone here think a clever way to iterate over all controls?
is something along the lines of

repeat with x = 1 to the number of cards in the cardnames of this stack
   repeat with y = 1 to the number of controls in card x of this stack
 ...
   end repeat
end repeat

ok?


Do you mean xmltree-view.rev ???

If so; look somewhere 'vaguely familiar':

http://andregarzia.on-rev.com/richmond/STUFF/xmltree-view.rev.zip

If NOT; try and think of its name - I have buckets of stacks
backed up over here.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: That nice XML exporter for stacks...

2010-05-10 Thread -= JB =-

There was and Tree View stack that the person programming it said
he would release a full version in around April 2010 but I don't know
the name of the stack and have not heard anything about it being
released.  He was going to charge a small fee for it when the full
version was released.

-=JB=-



On May 10, 2010, at 1:46 AM, Richmond Mathewson wrote:


 On 10/05/2010 21:32, Andre Garzia wrote:

Hello Folks,

Anyone here remember a sample stack that would export a Rev stack  
with all

properties and scripts to an XML file?

I don't see it anymore in the bundled files. If you guys don't  
remember it
is ok, but can someone here think a clever way to iterate over all  
controls?

is something along the lines of

repeat with x = 1 to the number of cards in the cardnames of this  
stack
   repeat with y = 1 to the number of controls in card x of this  
stack

 ...
   end repeat
end repeat

ok?


Do you mean xmltree-view.rev ???

If so; look somewhere 'vaguely familiar':

http://andregarzia.on-rev.com/richmond/STUFF/xmltree-view.rev.zip

If NOT; try and think of its name - I have buckets of stacks
backed up over here.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: That nice XML exporter for stacks...

2010-05-10 Thread Josh Mellicker
Hi André,

There's this:

http://revcoders.org/resources/exportscripts.rev.zip

it doesn't export as XML, but a text file... and scripts only, no props. But if 
you have to start from scratch I hope it saves you some time in creating what 
you really want.



On May 10, 2010, at 11:32 AM, Andre Garzia wrote:

 Hello Folks,
 
 Anyone here remember a sample stack that would export a Rev stack with all
 properties and scripts to an XML file?
 
 I don't see it anymore in the bundled files. If you guys don't remember it
 is ok, but can someone here think a clever way to iterate over all controls?
 is something along the lines of
 
 repeat with x = 1 to the number of cards in the cardnames of this stack
  repeat with y = 1 to the number of controls in card x of this stack
...
  end repeat
 end repeat
 
 ok?
 
 -- 
 http://www.andregarzia.com All We Do Is Code.
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: That nice XML exporter for stacks...

2010-05-10 Thread Geoff Canyon Rev
Waay back when I wrote mcRipper:

http://inspiredlogic.com/mc/ripper.html

It exported to XML, and re-constituted from the XML. I haven't looked
at it in about ten years. It never broke anything, but always use it
on a copy of your files.

gc

On Mon, May 10, 2010 at 1:32 PM, Andre Garzia an...@andregarzia.com wrote:
 Hello Folks,

 Anyone here remember a sample stack that would export a Rev stack with all
 properties and scripts to an XML file?
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML-RPC doc

2010-03-03 Thread Andre Rombauts
I don't find much info on XML-RPC usage in RunRev. What could you advise
for a start...?
André Rombauts

I notice that in RunRev online dictionary many XMLRPC commands and
functions descriptions end by More details to come... :-(

--

André Rombauts,

Using RunRev 4.5.0-dp-2 Build 1010 on
MacBook Pro 3,1 2,4 GHz - 4 Go running
Mac OS X 10.6.2 (10C540)

Fléron, Liège (BE)
an...@rombauts.be
+32 (0)477 53.35.17

Sent by Powermail 6.0.3 Build 4609

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML-RPC doc

2010-03-03 Thread Andre Garzia
Andre,

I just added my personal weblog library to RevOnline. It has code for
Blogger, Metaweblog and ATOM. It is an extensive library but it is not
complete (I don't remember supporting every method  but the ones I use)

For years I kept this just to myself but I don't see any reason not to share
it now. It will allow you to post to wordpress in a single call.

It has some support for
* Blogger API 1.0 and some of the 2.0 calls (2.0 was never released, but
blogger2.post was implemented by Pyra and still works)
* Metaweblog API 1.0
* ATOM API 1.0 (Never used it but implemented it anyway, I think it is
untested... at least, I don't recall testing it but looking at the code, I
don't believe I would write that amount of code without testing so I
probably tested it and forgot.)

Hope this helps! At least will help you learn more about XML-RPC

Cheers
andre


On Wed, Mar 3, 2010 at 6:32 AM, Andre Rombauts an...@rombauts.be wrote:

 I don't find much info on XML-RPC usage in RunRev. What could you advise
 for a start...?
 André Rombauts

 I notice that in RunRev online dictionary many XMLRPC commands and
 functions descriptions end by More details to come... :-(

 --

 André Rombauts,

 Using RunRev 4.5.0-dp-2 Build 1010 on
 MacBook Pro 3,1 2,4 GHz - 4 Go running
 Mac OS X 10.6.2 (10C540)

 Fléron, Liège (BE)
 an...@rombauts.be
 +32 (0)477 53.35.17

 Sent by Powermail 6.0.3 Build 4609

 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution




-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


XML-RPC doc

2010-03-02 Thread Andre Rombauts
Hello there...

I don't find much info on XML-RPC usage in RunRev. What could you advise
for a start...?

Thanks in advance,

--

André Rombauts,
an...@rombauts.be

Envoyé par Powermail 6.0.3 Build 4609

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML-RPC doc

2010-03-02 Thread Mark Wieder
Andre-

Tuesday, March 2, 2010, 3:28:22 PM, you wrote:

 I don't find much info on XML-RPC usage in RunRev. What could you advise
 for a start...?

Check out my libSOAP library on revOnline... that should give you
something to start with.

-- 
-Mark Wieder
 mwie...@ahsoftware.net

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML-RPC doc

2010-03-02 Thread Andre Garzia
Andre

I have some code for XML-RPC, do you want a client or a server?

cheers

On Tue, Mar 2, 2010 at 9:23 PM, Mark Wieder mwie...@ahsoftware.net wrote:

 Andre-

 Tuesday, March 2, 2010, 3:28:22 PM, you wrote:

  I don't find much info on XML-RPC usage in RunRev. What could you advise
  for a start...?

 Check out my libSOAP library on revOnline... that should give you
 something to start with.

 --
 -Mark Wieder
  mwie...@ahsoftware.net

 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution




-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML-RPC doc

2010-03-02 Thread Andre Rombauts
 I don't find much info on XML-RPC usage in RunRev. What could you advise
 for a start...?
Check out my libSOAP library on revOnline... that should give you
something to start with.
Thanks Mark. I'll have a look.

--

André Rombauts,

Using RunRev 4.5.0-dp-2 Build 1010 on
MacBook Pro 3,1 2,4 GHz - 4 Go running
Mac OS X 10.6.2 (10C540)

Fléron, Liège (BE)
an...@rombauts.be
+32 (0)477 53.35.17

Sent by Powermail 6.0.3 Build 4609

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML-RPC doc

2010-03-02 Thread Andre Rombauts
I have some code for XML-RPC, do you want a client or a server?
Thanks... André :-)

A client. In fact, I'm trying to develop a client system for a school
project where students are accessing a Wordpress driven meeting place.

--

André Rombauts,

Using RunRev 4.5.0-dp-2 Build 1010 on
MacBook Pro 3,1 2,4 GHz - 4 Go running
Mac OS X 10.6.2 (10C540)

Fléron, Liège (BE)
an...@rombauts.be
+32 (0)477 53.35.17

Sent by Powermail 6.0.3 Build 4609

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


From XML to array

2010-02-24 Thread mazza paolo
I need to import the data of an XML file to an ARRAY having the nodes as keys.

For example:  I need to transform an XML file like this ...

?xml version=1.0?
records
record IDnum=1
firstNameSteve/firstName
lastNameJobs/lastName
roomNums
roomNum1001/roomNum1
roomNum2054/roomNum2
roomNum3545/roomNum1
/roomNums
phoneExt345/phoneExt
parkingSlot100/parkingSlot
/employee
record IDnum=2
firstNameBill/firstName
lastNameGates/lastName
roomNums
roomNum1454/roomNum1
roomNum2656/roomNum2
/roomNums
phoneExt666/phoneExt
parkingSlot987/parkingSlot
/employee
record IDnum=3
firstNameLinus/firstName
lastNameTorvald/lastName
roomNums
roomNum1001/roomNum1
roomNum2054/roomNum2
roomNum3545/roomNum3
roomNum4545/roomNum4
/roomNums
phoneExt479/phoneExt
parkingSlot123/parkingSlot
/employee
record IDnum=4
firstNameKevin/firstName
lastNameMiller/lastName
roomNum100/roomNum
phoneExt421/phoneExt
parkingSlot987/parkingSlot
/employee
/records

to  an array like this (se the combined version of the array)

/records/record[1]record:
/records/record[1]record/firstName:Steve
/records/record[1]record/lastName:Jobs
/records/record[1]record/parkingSlot:100
/records/record[1]record/phoneExt:345
/records/record[1]record/roomNums:
/records/record[1]record/roomNums/roomNum1:001
/records/record[1]record/roomNums/roomNum2:054
/records/record[1]record/roomNums/roomNum3:545
/records/record[2]record:
/records/record[2]record/firstName:Bill
/records/record[2]record/lastName:Gates
/records/record[2]record/parkingSlot:987
/records/record[2]record/phoneExt:666
/records/record[2]record/roomNums:
/records/record[2]record/roomNums/roomNum1:454
/records/record[2]record/roomNums/roomNum2:656
/records/record[3]record:
/records/record[3]record/firstName:Linus
/records/record[3]record/lastName:Torvald
/records/record[3]record/parkingSlot:123
/records/record[3]record/phoneExt:479
/records/record[3]record/roomNums:
/records/record[3]record/roomNums/roomNum1:001
/records/record[3]record/roomNums/roomNum2:054
/records/record[3]record/roomNums/roomNum3:545
/records/record[3]record/roomNums/roomNum4:545
/records/record[4]record:
/records/record[4]record/firstName:Kevin
/records/record[4]record/lastName:Miller
/records/record[4]record/parkingSlot:987
/records/record[4]record/phoneExt:421
/records/record[4]record/roomNum:100


The following RevTalk  script does the job. I wonder if there is an easyer (and 
more efficient) way to accomplish this task with Revolution.

local STRUTTURA,NODO1,LISTAARRAY, tDocID

on mouseUp
   local J, tNUMERORECORDS, tParentNode
  put field DocID into tDocID
   --the number of records
   put revXMLRootNode(tDocID) into tParentNode
   put revXMLNumberOfChildren(tDocID,tParentNode,record,0) into tNUMERORECORDS

   repeat with J=1 to tNUMERORECORDS
   put /records/record[  J  ] into NODO1
   CreaListaValori
   combine LISTAARRAY with return and  :
   put LISTAARRAY  return after message
   end repeat
end mouseUp

on CreaListaValori
   local NOMECAMPO, tNUMERO, VALORECAMPO, LISTA

   put revXMLTree(tDocID, NODO1, cr, tab, false, -1) into STRUTTURA
repeat with tNUMERO=1 to the number of lines of STRUTTURA
  put line tNUMERO of STRUTTURA into NOMECAMPO
  put CompletaCampo(NOMECAMPO,tNUMERO) into NOMECAMPO
  put revXMLNodeContents(tDocID,NOMECAMPO) into VALORECAMPO
  PUT VALORECAMPO into LISTAARRAY[NOMECAMPO]
   end repeat

end CreaListaValori


function CompletaCampo  NOMECAMPO tNUMERO
   local NUMEROX, LINEA
   set itemdelimiter to TAB
   put the number of items of NOMECAMPO into NUMEROX
   repeat with k=1 to NUMEROX
  if item K of LINEA is empty then
 put CercaNomeCampo(tNUMERO, k ) into item K of LINEA
  end if
   end repeat
   replace tab with / in LINEA
   put NODO1  LINEA into LINEA
   return LINEA
end CompletaCampo

function CercaNomeCampo tNUMERO tPosizione
   local NUMEROX, LINEA, K, NOME
   set itemdelimiter to tab
   repeat with K=tNumero down to 1
  put item tPosizione of line K of STRUTTURA into NOME
  if NOME is not empty then
return NOME
 exit repeat
  end if
   end repeat
end CercaNomeCampo



Thanks a lot,  Paolo Mazza

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: From XML to array

2010-02-24 Thread Jim Ault

I am assuming your data set contains an error and will ignore this tag.
There is no opening tag employee

On Feb 24, 2010, at 5:44 AM, mazza paolo wrote:


/employee


Jim Ault
Las Vegas



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: From XML to array

2010-02-24 Thread paolo mazza
Yes, you are right. Here it is the right XML file:

?xml version=1.0?
records
record IDnum=1
firstNameSteve/firstName
lastNameJobs/lastName
roomNums
roomNum1001/roomNum1
roomNum2054/roomNum2
roomNum3545/roomNum1
/roomNums
phoneExt345/phoneExt
parkingSlot100/parkingSlot
/record
record IDnum=2
firstNameBill/firstName
lastNameGates/lastName
roomNums
roomNum1454/roomNum1
roomNum2656/roomNum2
/roomNums
phoneExt666/phoneExt
parkingSlot987/parkingSlot
/record
record IDnum=3
firstNameLinus/firstName
lastNameTorvald/lastName
roomNums
roomNum1001/roomNum1
roomNum2054/roomNum2
roomNum3545/roomNum3
roomNum4545/roomNum4
/roomNums
phoneExt479/phoneExt
parkingSlot123/parkingSlot
/record
record IDnum=4
firstNameKevin/firstName
lastNameMiller/lastName
roomNum100/roomNum
phoneExt421/phoneExt
parkingSlot987/parkingSlot
/record
/records


On Wed, Feb 24, 2010 at 5:21 PM, Jim Ault jimaultw...@yahoo.com wrote:

 I am assuming your data set contains an error and will ignore this tag.
 There is no opening tag employee

 On Feb 24, 2010, at 5:44 AM, mazza paolo wrote:

  /employee


 Jim Ault
 Las Vegas



 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


validate XML against schema

2010-01-20 Thread viktoras d.
how do you usually validate XML against schema in Rev? I know there is 
a function RevXMLValidateDTD, but it validates against DTD, not 
schema... Or should I convert my XML schemas to DTDs prior to validation?


Viktoras
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


bad xml files for rev 4.0

2009-11-24 Thread François Chaplais
I have been using BvG's stacks to incorporate into my own dictionary stacks. 
There are more than a dozen dict xml files with a bad syntax. I have tracked 
the bug rather deep into BvG docsLib, and it seems that the errors come from 
the documentation files supplied by runrev. 
I suspect they involve tags that are not displayed in the built-in dictionary 
(like related). You will find an error log below; I also suspect they are due 
to the improper inclusion of xml keywords into the dictionary entries. 
Should I report this to the quality center (I have never done this before)?
Here is the log

xmlerr, can't parse xml
xmlParseStartTag: invalid element name
error for entryoperator

xmlerr, can't parse xml
xmlParseStartTag: invalid element name
error for entry =  operator

xmlerr, can't parse xml
xmlParseStartTag: invalid element name
error for entry   operator

xmlerr, can't parse xml
xmlParseStartTag: invalid element name
error for entry =   operator

xmlerr, can't parse xml
xmlParseStartTag: invalid element name
error for entryoperator

xmlerr, can't parse xml
xmlParseStartTag: invalid element name
error for entry =  operator

xmlerr, can't parse xml
xmlParseEntityRef: no name
error for entry \   keyword

xmlerr, can't parse xml
Extra content at the end of the document
error for entry cancel  command

xmlerr, can't parse xml
xmlParseStartTag: invalid element name
error for entry caseSensitive   property

xmlerr, can't parse xml
xmlParseStartTag: invalid element name
error for entry containsoperator

xmlerr, can't parse xml
xmlParseStartTag: invalid element name
error for entry is  operator

xmlerr, can't parse xml
xmlParseStartTag: invalid element name
error for entry is not  operator

xmlerr, can't parse xml
xmlParseStartTag: invalid element name
error for entry max function

xmlerr, can't parse xml
xmlParseStartTag: invalid element name
error for entry min function

xmlerr, can't parse xml
xmlParseEntityRef: no name
error for entry quote   constant

xmlerr, can't parse xml
xmlParseEntityRef: no name
error for entry space   constant

xmlerr, can't parse xml
xmlParseEntityRef: no name
error for entry split   command
-

Best
François

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: bad xml files for rev 4.0

2009-11-24 Thread Björnke von Gierke

Hi Francois (sorry can't find the cecile)

Thank you for the list of affected entries, tho I really wish you'd  
give me more then 2 Hours to respond to you directly, before you go  
public with BvG Docu bugs :P


---

Short version:

RunRev has made errors when they created some of the XML files. I have  
filed relevant bug reports. I have uploaded a version that works. It  
replaces the faulty entries with those from 3.5 (stored in custom  
properties), but only if the version is 4.0:


http://bjoernke.com/bvgdocu/bvg_docu1.5.rev

---
---

Long Version:

The problem here is, RunRev did butcher the xml files _again_ (kinda  
seems like they aim to do that with every release...). They didn't  
find this out themselves, because they have long ago given up on using  
'proper' xml. Basically they use the fault-ignoring version of the  
revCreateXMLTree command. BvG Docu however does not, and therefore  
fails at parsing their malformed xml. See their line vs. my line:


put revCreateXMLTree(tData,false, true, false) into tTree -- theirs
put revcreatexmltree(theXML,true,true,false) into theID --mine

Really fixing that particular problem is not easy. A quick workaround  
is to set the relevant line in BvG Docu to accept false xml too, or  
write your own parser that looks for false chars in the content of the  
tags before passing it on to the xml function (nontrivial and slow).  
Another workaround is to copy the relevant files from a 3.5 version  
export into your 4.0 folder, thereby replacing the faulty files. I  
have chosen to include the correct versions of 3.5 as properties, and  
include those instead of the faulty ones that come with 4.0.


Problematic entries are those that link to , ,  or  
 (etc.) in their see also part, because RunRev didn't encode  
these, which understandably confuses every xml parser that expects  
proper xml. In addition, all appearance of these chars in the  
descriptions have been erroneously removed.


Finally, there's a problem with illegal nesting in the entry for  
cancel.


---

For the same information, see bugs 8462, 8463 and 8464.


Wishing for RunRev to create proper xml
Bjoernke

On 24 Nov 2009, at 12:00, François Chaplais wrote:

I have been using BvG's stacks to incorporate into my own dictionary  
stacks. There are more than a dozen dict xml files with a bad  
syntax. I have tracked the bug rather deep into BvG docsLib, and it  
seems that the errors come from the documentation files supplied by  
runrev.
I suspect they involve tags that are not displayed in the built-in  
dictionary (like related). You will find an error log below; I  
also suspect they are due to the improper inclusion of xml keywords  
into the dictionary entries.
Should I report this to the quality center (I have never done this  
before)?

Here is the log
snipped the log



--

official ChatRev page:
http://bjoernke.com?target=chatrev

Chat with other RunRev developers:
go stack URL http://bjoernke.com/chatrev/chatrev1.3b3.rev;

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


[OT] Figuring Out XML Error?

2009-10-12 Thread Scott Rossi
Hi List:

Was wondering if any XML savvy folks out there might know how to track
down/correct a formatting error (?) in an XML file.

My brother is using some proprietary software to translate text in XML
documents into languages with diacritical characters.  The output produced
by the software apparently has one or more errors that prevent it from being
rendered properly in a Web browser for example.

I've tried just looking at the raw XML which appears to include some MS
tags, but I have neither a dedicated XML editor nor enough knowledge to know
what to look for.  Perhaps someone here can offer a clue.

A sample file is posted here:
http://www.tactilemedia.com/download/document.xml.zip

Thanks  Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia  Design



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: [OT] Figuring Out XML Error?

2009-10-12 Thread Peter W A Wood

Hi Scott

I'm no XML expert but tried your sample file with this XML Validator - 
http://www.validome.org/xml/validate/

It complained about an HTML escape sequence aacute; As the XML file  
is UTF-8 encoded it shouldn't be necessary to use HMTL escapes.


I've attached the actual error message.

Regards

Peter Wood



Error (1)
LineFile name:  document.xml
2   Column: 4703
Error:  Entity aacute was referenced, but not declared.
Error Position: 
...th Plan, Inc. ya no seguiraacute; ofreciendo su plan en el 2010./ 
w:t/

On 12 Oct 2009, at 15:19, Scott Rossi wrote:


Hi List:

Was wondering if any XML savvy folks out there might know how to track
down/correct a formatting error (?) in an XML file.

My brother is using some proprietary software to translate text in XML
documents into languages with diacritical characters.  The output  
produced
by the software apparently has one or more errors that prevent it  
from being

rendered properly in a Web browser for example.

I've tried just looking at the raw XML which appears to include some  
MS
tags, but I have neither a dedicated XML editor nor enough knowledge  
to know

what to look for.  Perhaps someone here can offer a clue.

A sample file is posted here:
http://www.tactilemedia.com/download/document.xml.zip

Thanks  Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia  Design



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: [OT] Figuring Out XML Error?

2009-10-12 Thread Pierre Sahores

Hi Scott,

Did your brother test what occurs in applying the rev command :

put uniEncode(fileURL,UTF8) into fileURL

to the text file before sending it to the proprietary software used to  
output the XML file?


Best Regards,

P.


Le 12 oct. 09 à 09:19, Scott Rossi a écrit :


Hi List:

Was wondering if any XML savvy folks out there might know how to track
down/correct a formatting error (?) in an XML file.

My brother is using some proprietary software to translate text in XML
documents into languages with diacritical characters.  The output  
produced
by the software apparently has one or more errors that prevent it  
from being

rendered properly in a Web browser for example.

I've tried just looking at the raw XML which appears to include some  
MS
tags, but I have neither a dedicated XML editor nor enough knowledge  
to know

what to look for.  Perhaps someone here can offer a clue.

A sample file is posted here:
http://www.tactilemedia.com/download/document.xml.zip

Thanks  Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia  Design



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution



--
Pierre Sahores
mobile : (33) 6 03 95 77 70

www.wrds.com
www.sahores-conseil.com






___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: [OT] Figuring Out XML Error?

2009-10-12 Thread Dave Cragg

Scott

I tried to open it with something (not Rev) that parses XML and get  
the following error:


'The entity aacute was referenced, but not declared.'

Entities are different between html and xml, and XML only supports a  
few as standard. Others have to be declared. (From my crusty memory. )


Is this Microsoft's open xml format by the way?


Cheers
Dave

On 12 Oct 2009, at 08:19, Scott Rossi wrote:


Hi List:

Was wondering if any XML savvy folks out there might know how to track
down/correct a formatting error (?) in an XML file.

My brother is using some proprietary software to translate text in XML
documents into languages with diacritical characters.  The output  
produced
by the software apparently has one or more errors that prevent it  
from being

rendered properly in a Web browser for example.

I've tried just looking at the raw XML which appears to include some  
MS
tags, but I have neither a dedicated XML editor nor enough knowledge  
to know

what to look for.  Perhaps someone here can offer a clue.

A sample file is posted here:
http://www.tactilemedia.com/download/document.xml.zip

Thanks  Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia  Design



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: [OT] Figuring Out XML Error?

2009-10-12 Thread Scott Rossi
Recently, Pierre Sahores wrote:

 Did your brother test what occurs in applying the rev command :
 
 put uniEncode(fileURL,UTF8) into fileURL
 
 to the text file before sending it to the proprietary software used to
 output the XML file?

Hello Pierre:

I don't think the above will help -- as far as I know, the source file is in
English with standard roman characters; the proprietary software reads
through this and translates to alternate languages.

Thanks  Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia  Design



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: [OT] Figuring Out XML Error?

2009-10-12 Thread Scott Rossi
Recently, Peter W A Wood wrote:

 I'm no XML expert but tried your sample file with this XML Validator -
 http://www.validome.org/xml/validate/
 
 It complained about an HTML escape sequence aacute; As the XML file
 is UTF-8 encoded it shouldn't be necessary to use HMTL escapes.

Thanks for looking Peter.  It seems possible to discern the error even just
using a Web browser, but how to correct it?

Best Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia  Design



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: [OT] Figuring Out XML Error?

2009-10-12 Thread Scott Rossi
Recently, Dave Cragg wrote:

 I tried to open it with something (not Rev) that parses XML and get
 the following error:
 
 'The entity aacute was referenced, but not declared.'
 
 Entities are different between html and xml, and XML only supports a
 few as standard. Others have to be declared. (From my crusty memory. )
 
 Is this Microsoft's open xml format by the way?

Hi Dave:

From the tags in the code, it looks like it might be, but without reading
some descriptive docs from the company that produces the software, I don't
know what the output is supposed to be.  And I don't know enough about XML
to know how to fix the output so it renders properly (declare an entity = no
clue).

Best Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia  Design



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: [OT] Figuring Out XML Error?

2009-10-12 Thread Peter W A Wood

Hi Scott
On 12 Oct 2009, at 16:24, Scott Rossi wrote:
Thanks for looking Peter.  It seems possible to discern the error  
even just

using a Web browser, but how to correct it?


By changing all the HTML escapes to their UTF-8 Equivalent which is  
will be a little laborious and beyond my fledgling Rev skills at the  
moment.


I could do it with Rebol but that probably won't be much help to  
you.  :-(


Regards

Peter
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: [OT] Figuring Out XML Error?

2009-10-12 Thread Dave Cragg


On 12 Oct 2009, at 09:30, Scott Rossi wrote:


 (declare an entity = no clue).


That's because you are still sane.

No promises here, but if you insert the following at the top of the  
document, just after the ?xml version=1.0 encoding=UTF-8  
standalone=yes? part, it seems to display in Firefox OK.


(I'm worried this may not come over in the mail properly. Apologies to  
everyone if this is a mess.)


!DOCTYPE [
!ENTITY aacute #x00E1; 
  !ENTITY Aacute #x00C1; 
  !ENTITY acirc #x00E2; 
  !ENTITY Acirc #x00C2; 
  !ENTITY agrave #x00E0; 
  !ENTITY Agrave #x00C0; 
  !ENTITY aring #x00E5; 
  !ENTITY Aring #x00C5; 
  !ENTITY atilde #x00E3; 
  !ENTITY Atilde #x00C3; 
  !ENTITY auml #x00E4; 
  !ENTITY Auml #x00C4; 
  !ENTITY aelig #x00E6; 
  !ENTITY AElig #x00C6; 
  !ENTITY ccedil #x00E7; 
  !ENTITY Ccedil #x00C7; 
  !ENTITY eth #x00F0; 
  !ENTITY ETH #x00D0; 
  !ENTITY eacute #x00E9; 
  !ENTITY Eacute #x00C9; 
  !ENTITY ecirc #x00EA; 
  !ENTITY Ecirc #x00CA; 
  !ENTITY egrave #x00E8; 
  !ENTITY Egrave #x00C8; 
  !ENTITY euml #x00EB; 
  !ENTITY Euml #x00CB; 
  !ENTITY iacute #x00ED; 
  !ENTITY Iacute #x00CD; 
  !ENTITY icirc #x00EE; 
  !ENTITY Icirc #x00CE; 
  !ENTITY igrave #x00EC; 
  !ENTITY Igrave #x00CC; 
  !ENTITY iuml #x00EF; 
  !ENTITY Iuml #x00CF; 
  !ENTITY ntilde #x00F1; 
  !ENTITY Ntilde #x00D1; 
  !ENTITY oacute #x00F3; 
  !ENTITY Oacute #x00D3; 
  !ENTITY ocirc #x00F4; 
  !ENTITY Ocirc #x00D4; 
  !ENTITY ograve #x00F2; 
  !ENTITY Ograve #x00D2; 
  !ENTITY oslash #x00F8; 
  !ENTITY Oslash #x00D8; 
  !ENTITY otilde #x00F5; 
  !ENTITY Otilde #x00D5; 
  !ENTITY ouml #x00F6; 
  !ENTITY Ouml #x00D6; 
  !ENTITY szlig #x00DF; 
  !ENTITY thorn #x00FE; 
  !ENTITY THORN #x00DE; 
  !ENTITY uacute #x00FA; 
  !ENTITY Uacute #x00DA; 
  !ENTITY ucirc #x00FB; 
  !ENTITY Ucirc #x00DB; 
  !ENTITY ugrave #x00F9; 
  !ENTITY Ugrave #x00D9; 
  !ENTITY uuml #x00FC; 
  !ENTITY Uuml #x00DC; 
  !ENTITY yacute #x00FD; 
  !ENTITY Yacute #x00DD; 
  !ENTITY yuml #x00FF; 
]
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: [OT] Figuring Out XML Error? (correction)

2009-10-12 Thread Dave Cragg

Sorry, my last posting contained some errors. (Copied from wrong file.)

I think this is correct:



!DOCTYPE document [
!ENTITY aacute #x00E1; 
  !ENTITY Aacute #x00C1; 
  !ENTITY acirc #x00E2; 
  !ENTITY Acirc #x00C2; 
  !ENTITY agrave #x00E0; 
  !ENTITY Agrave #x00C0; 
  !ENTITY aring #x00E5; 
  !ENTITY Aring #x00C5; 
  !ENTITY atilde #x00E3; 
  !ENTITY Atilde #x00C3; 
  !ENTITY auml #x00E4; 
  !ENTITY Auml #x00C4; 
  !ENTITY aelig #x00E6; 
  !ENTITY AElig #x00C6; 
  !ENTITY ccedil #x00E7; 
  !ENTITY Ccedil #x00C7; 
  !ENTITY eth #x00F0; 
  !ENTITY ETH #x00D0; 
  !ENTITY eacute #x00E9; 
  !ENTITY Eacute #x00C9; 
  !ENTITY ecirc #x00EA; 
  !ENTITY Ecirc #x00CA; 
  !ENTITY egrave #x00E8; 
  !ENTITY Egrave #x00C8; 
  !ENTITY euml #x00EB; 
  !ENTITY Euml #x00CB; 
  !ENTITY iacute #x00ED; 
  !ENTITY Iacute #x00CD; 
  !ENTITY icirc #x00EE; 
  !ENTITY Icirc #x00CE; 
  !ENTITY igrave #x00EC; 
  !ENTITY Igrave #x00CC; 
  !ENTITY iuml #x00EF; 
  !ENTITY Iuml #x00CF; 
  !ENTITY ntilde #x00F1; 
  !ENTITY Ntilde #x00D1; 
  !ENTITY oacute #x00F3; 
  !ENTITY Oacute #x00D3; 
  !ENTITY ocirc #x00F4; 
  !ENTITY Ocirc #x00D4; 
  !ENTITY ograve #x00F2; 
  !ENTITY Ograve #x00D2; 
  !ENTITY oslash #x00F8; 
  !ENTITY Oslash #x00D8; 
  !ENTITY otilde #x00F5; 
  !ENTITY Otilde #x00D5; 
  !ENTITY ouml #x00F6; 
  !ENTITY Ouml #x00D6; 
  !ENTITY szlig #x00DF; 
  !ENTITY thorn #x00FE; 
  !ENTITY THORN #x00DE; 
  !ENTITY uacute #x00FA; 
  !ENTITY Uacute #x00DA; 
  !ENTITY ucirc #x00FB; 
  !ENTITY Ucirc #x00DB; 
  !ENTITY ugrave #x00F9; 
  !ENTITY Ugrave #x00D9; 
  !ENTITY uuml #x00FC; 
  !ENTITY Uuml #x00DC; 
  !ENTITY yacute #x00FD; 
  !ENTITY Yacute #x00DD; 
  !ENTITY yuml #x00FF; 
  !ENTITY nbsp #160; 
]
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: [OT] Figuring Out XML Error?

2009-10-12 Thread Peter W A Wood

Hi Scott

Thanks for looking Peter.  It seems possible to discern the error  
even just

using a Web browser, but how to correct it?


By referring to a couple of tutorials and the dictionary, I managed to  
cobble together this simple skeleton of how to correct the file using  
RunRev. I'm sure that most people on this list could do better:


By referring to a couple of tutorials and the dictionary

set the defaultFolder to /Users/peter/Desktop
put url (file:   document.xml) into myXML
replace aacute; with numToChar(195)  numToChar(161) in myXML
replace eacute; with numtoChar(195)  numToChar(169) in myXML
-- etc.
put myXML into url (file:  newdocument.xml)

In case it isn't obvious what the above script does is change all the  
occurrences of  aacute; to the UTF-8 character sequence for a small a  
with an acute accent. It does the same to a small e with an acute  
accent. Unfortunately, their are a lot more to add. I'm not aware of a  
programatic way of converting from HTML escape characters to UTF-8.


I did test against the file you supplied and it worked in the sense  
that the XML validator found a different error.


I hope this helps.

Regards

Peter

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: [OT] Figuring Out XML Error?

2009-10-12 Thread Mark Smith
Inserting Dave's DOCTYPE declarations (2nd version) gets the file a  
clean bill of health from xml nanny (http://www.versiontracker.com/ 
dyn/moreinfo/macosx/27761).


Best,

Mark Smith
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: [OT] Figuring Out XML Error?

2009-10-12 Thread Colin Holgate
The others have answered the main question (with acute solution, you  
might say...), but something that seems odd is that every single node  
has a namespace. I've never seen that done before. Maybe the schema at http://schemas.openxmlformats.org/markup-compatibility/2006 
 is supposed to take care of the accented characters?



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: [OT] Figuring Out XML Error?

2009-10-12 Thread Scott Rossi
 No promises here, but if you insert the following at the top of the
 document, just after the ?xml version=1.0 encoding=UTF-8
 standalone=yes? part, it seems to display in Firefox OK.

Adding the lookup table does indeed appear to make the XML display
properly.  I've passed the info along to my brother who sends back many
thanks.

This list is so awesome. Thanks to all who responded.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia  Design



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: [OT] Figuring Out XML Error?

2009-10-12 Thread Dave Cragg


On 12 Oct 2009, at 14:38, Colin Holgate wrote:

The others have answered the main question (with acute solution, you  
might say...), but something that seems odd is that every single  
node has a namespace. I've never seen that done before. Maybe the  
schema at http://schemas.openxmlformats.org/markup-compatibility/ 
2006 is supposed to take care of the accented characters?



I think a couple of things are missing in the document to allow using  
the intended schema(s).


At the top, the standalone parameter is set to yes which is meant  
to indicate that a non-validating parser can interpret the document  
without reference to external items such as schemas or DTDs.


And none of the namespace declarations have schemaLocation  
attributes which tell you where to find the schema content. They  
should look something like this, I think, to enable looking up the  
schema content:


abc:document xmlns:abc=http://schemas.openxmlformats.org/wordprocessingml/2006/main 
  abc:schemaLocation=http://path.to.schema/location;

...
/abc:document

(Be warned! My reference book is old!!)

Cheers
Dave
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: [OT] Figuring Out XML Error?

2009-10-12 Thread Mark Wieder
Dave-

Monday, October 12, 2009, 1:22:56 AM, you wrote:

 Is this Microsoft's open xml format by the way?

Yep. That it is. The bloat is MS Word namespace tags on every element.
I'd be embarrassed to write something like

w:p w:rsidR=00E52FAC w:rsidRPr=002C0BD1 w:rsidRDefault=00E52FAC 
w:rsidP=007C075C
 w:pPr
  w:autoSpaceDE w:val=0/
  w:autoSpaceDN w:val=0/
  w:adjustRightInd w:val=0/
  w:rPrw:bCs/
   w:color w:val=00/
  /w:rPr
 /w:pPr
/w:p

(that's a paragraph tag with no content, apparently to provide a blank
line)

-- 
-Mark Wieder
 mwie...@ahsoftware.net

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: [OT] Figuring Out XML Error?

2009-10-12 Thread stephen barncard
Open XML?   - oxymoron
MS has seemingly done the same thing for XML what they did for SQL, html and
javascript de-standardize it 'just enough' to make interchange more
difficult without their blessing.


-
Stephen Barncard
San Francisco
http://houseofcubes.com/disco.irev


2009/10/12 Mark Wieder mwie...@ahsoftware.net

 Dave-

 Monday, October 12, 2009, 1:22:56 AM, you wrote:

  Is this Microsoft's open xml format by the way?

 Yep. That it is. The bloat is MS Word namespace tags on every element.
 I'd be embarrassed to write something like

 w:p w:rsidR=00E52FAC w:rsidRPr=002C0BD1 w:rsidRDefault=00E52FAC
 w:rsidP=007C075C
  w:pPr
  w:autoSpaceDE w:val=0/
  w:autoSpaceDN w:val=0/
  w:adjustRightInd w:val=0/
  w:rPrw:bCs/
   w:color w:val=00/
  /w:rPr
  /w:pPr
 /w:p

 (that's a paragraph tag with no content, apparently to provide a blank
 line)

 --
 -Mark Wieder
  mwie...@ahsoftware.net


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


XML name spaces

2009-06-19 Thread David Bovill
Shameless plug for votes for this bug report:

While the xmlns issue is fixed we still can't use the common and basic name
spaces in attributes. Take this RSS example and try it in the message box:

get ?xml version='1.0' encoding='UTF-8'?rss version='2.0' xmlns:atom='
 http://www.w3.org/2005/Atom' xmlns:content='
 http://purl.org/rss/1.0/modules/content/'channel/channel/rss
 put revCreateXMLTree(it, true, true, false) into treeID
 put revXMLAttributes(treeID, rss, tab, CR)


Only one value for xmlns is returned. We cannot work with any number of
XML based web services until this matter is resolved. The example is just a
common example, but it comes up very often with most of the major web
services. What we need returned is the entire attribute name including the
name space - so xmlns:atom and xmlns:content - there is very little
point in returning the name space without the attribute name.

If others are having this issue could you vote on the report found
herehttp://quality.runrev.com/qacenter/show_bug.cgi?id=7586- it
applies to any handler dealing with XML attributes not justt
revXmlAttribute
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML name spaces

2009-06-19 Thread Andre Garzia
David,
Praise the Gods of Hack! do this before creating the xml

replace : with - in tXML

and put the colons back afterwards. :-)

then you can query for xmlns-atom or xmlns-content

:P

(if your content has colons in it, then replace the namespaces)

On Fri, Jun 19, 2009 at 10:56 AM, David Bovill da...@architex.tv wrote:

 Shameless plug for votes for this bug report:

 While the xmlns issue is fixed we still can't use the common and basic name
 spaces in attributes. Take this RSS example and try it in the message box:

 get ?xml version='1.0' encoding='UTF-8'?rss version='2.0' xmlns:atom='
  http://www.w3.org/2005/Atom' xmlns:content='
  http://purl.org/rss/1.0/modules/content/'channel/channel/rss
  put revCreateXMLTree(it, true, true, false) into treeID
  put revXMLAttributes(treeID, rss, tab, CR)
 

 Only one value for xmlns is returned. We cannot work with any number of
 XML based web services until this matter is resolved. The example is just a
 common example, but it comes up very often with most of the major web
 services. What we need returned is the entire attribute name including the
 name space - so xmlns:atom and xmlns:content - there is very little
 point in returning the name space without the attribute name.

 If others are having this issue could you vote on the report found
 herehttp://quality.runrev.com/qacenter/show_bug.cgi?id=7586- it
 applies to any handler dealing with XML attributes not justt
 revXmlAttribute
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution




-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML name spaces

2009-06-19 Thread David Bovill
Ooooh! Ugly :)

Go on just vote for it - you know you want to (especially if you want to
allow colons or even smileys in RSS fields from your shiny blog :)

2009/6/19 Andre Garzia an...@andregarzia.com

 David,
 Praise the Gods of Hack! do this before creating the xml

 replace : with - in tXML

 and put the colons back afterwards. :-)

 then you can query for xmlns-atom or xmlns-content

 :P

 (if your content has colons in it, then replace the namespaces)

 On Fri, Jun 19, 2009 at 10:56 AM, David Bovill da...@architex.tv wrote:

  Shameless plug for votes for this bug report:
 
  While the xmlns issue is fixed we still can't use the common and basic
 name
  spaces in attributes. Take this RSS example and try it in the message
 box:
 
  get ?xml version='1.0' encoding='UTF-8'?rss version='2.0'
 xmlns:atom='
   http://www.w3.org/2005/Atom' xmlns:content='
   http://purl.org/rss/1.0/modules/content/'channel/channel/rss
   put revCreateXMLTree(it, true, true, false) into treeID
   put revXMLAttributes(treeID, rss, tab, CR)
  
 
  Only one value for xmlns is returned. We cannot work with any number of
  XML based web services until this matter is resolved. The example is just
 a
  common example, but it comes up very often with most of the major web
  services. What we need returned is the entire attribute name including
 the
  name space - so xmlns:atom and xmlns:content - there is very little
  point in returning the name space without the attribute name.
 
  If others are having this issue could you vote on the report found
  herehttp://quality.runrev.com/qacenter/show_bug.cgi?id=7586- it
  applies to any handler dealing with XML attributes not justt
  revXmlAttribute
  ___
  use-revolution mailing list
  use-revolution@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-revolution
 



 --
 http://www.andregarzia.com All We Do Is Code.
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


XML Validation:

2009-06-15 Thread David Bovill
Has anyone done XML validation using Rev with and XML Schema? The docs say
you can use a DTD, but mention nothing about using a schema...

I'm looking to validate XML within Rev. Looking at the docs, we can use:


 Use the revXMLValidateDTD function to validate an XML tree against a DTD.

 Parameters:
 The treeID is the number returned by the revCreateXMLTree or
 revCreateXMLTreeFromFile function when you created the XML tree.

 The DTDText is a Document Type Definition.


I need to get the DTD from the url referenced in the XML file - however the
XML file uses an XML-based alternative to DTD, ( XML Schema ):

   - http://www.w3schools.com/Xml/xml_dtd.asp

The XML starts with something of the form:

?xml version=1.0?
 XX xmlns=http://www.example.com/test/ui/; xmlns:xsi=
 http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=
 http://www.example.com/test/ui/ ..\ExampleXML\Test.xsd


 AFAIK, it is still not possible to use Rev to extract these XML attributes
(they aall get put in xmlns - see bugzilla 231) Skipping over that issue,
I could extract
xsi:schemaLocation=http://www.example.com/test/ui/..\ExampleXML\Test.xsd;
with a script but then the url is a bit strange I'm
not sure how to get the text referenced. Any ideas?
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML Validation:

2009-06-15 Thread Jan Schenkel

XML Schema validation is a different animal from DTD validation.
Whereas DTD validation is limited to the structure of the XML file (are there 
no eloements that are not defined in the DTD, are all the elements there, do 
they have the right attributes,etc) XML Schemas can also dictate the 
cardinality of the elements and their content.
RevXML doesn't offer XML Schema validation. You can either use a shell() call 
to a command-line tool, or write your own external to wrap an existing C 
library.

Jan Schenkel
=
Quartam Reports  PDF Library for Revolution
http://www.quartam.com

=
As we grow older, we grow both wiser and more foolish at the same time.  (La 
Rochefoucauld)


--- On Mon, 6/15/09, David Bovill da...@architex.tv wrote:

 From: David Bovill da...@architex.tv
 Subject: XML Validation:
 To: How to use Revolution use-revolution@lists.runrev.com
 Date: Monday, June 15, 2009, 4:42 AM
 Has anyone done XML validation using
 Rev with and XML Schema? The docs say
 you can use a DTD, but mention nothing about using a
 schema...
 
 I'm looking to validate XML within Rev. Looking at the
 docs, we can use:
 
 
  Use the revXMLValidateDTD function to validate an XML
 tree against a DTD.
 
  Parameters:
  The treeID is the number returned by the
 revCreateXMLTree or
  revCreateXMLTreeFromFile function when you created the
 XML tree.
 
  The DTDText is a Document Type Definition.
 
 
 I need to get the DTD from the url referenced in the XML
 file - however the
 XML file uses an XML-based alternative to DTD, ( XML Schema
 ):
 
    - http://www.w3schools.com/Xml/xml_dtd.asp
 
 The XML starts with something of the form:
 
 ?xml version=1.0?
  XX xmlns=http://www.example.com/test/ui/; xmlns:xsi=
  http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation=
  http://www.example.com/test/ui/
 ..\ExampleXML\Test.xsd
 
 
  AFAIK, it is still not possible to use Rev to extract
 these XML attributes
 (they aall get put in xmlns - see bugzilla 231) Skipping
 over that issue,
 I could extract
 xsi:schemaLocation=http://www.example.com/test/ui/..\ExampleXML\Test.xsd;
 with a script but then the url is a bit strange I'm
 not sure how to get the text referenced. Any ideas?
 



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML Validation:

2009-06-15 Thread David Bovill
Thanks Jan - seems OSX comes with libxml and xmllint. xmllint looks good for
checking... lets see if they are also part of standard linux distros

2009/6/15 Jan Schenkel janschen...@yahoo.com


 XML Schema validation is a different animal from DTD validation.
 Whereas DTD validation is limited to the structure of the XML file (are
 there no eloements that are not defined in the DTD, are all the elements
 there, do they have the right attributes,etc) XML Schemas can also dictate
 the cardinality of the elements and their content.
 RevXML doesn't offer XML Schema validation. You can either use a shell()
 call to a command-line tool, or write your own external to wrap an existing
 C library.

 Jan Schenkel
 =
 Quartam Reports  PDF Library for Revolution
 http://www.quartam.com

 =
 As we grow older, we grow both wiser and more foolish at the same time.
  (La Rochefoucauld)


 --- On Mon, 6/15/09, David Bovill da...@architex.tv wrote:

  From: David Bovill da...@architex.tv
  Subject: XML Validation:
  To: How to use Revolution use-revolution@lists.runrev.com
  Date: Monday, June 15, 2009, 4:42 AM
  Has anyone done XML validation using
  Rev with and XML Schema? The docs say
  you can use a DTD, but mention nothing about using a
  schema...
 
  I'm looking to validate XML within Rev. Looking at the
  docs, we can use:
 
 
   Use the revXMLValidateDTD function to validate an XML
  tree against a DTD.
  
   Parameters:
   The treeID is the number returned by the
  revCreateXMLTree or
   revCreateXMLTreeFromFile function when you created the
  XML tree.
  
   The DTDText is a Document Type Definition.
 
 
  I need to get the DTD from the url referenced in the XML
  file - however the
  XML file uses an XML-based alternative to DTD, ( XML Schema
  ):
 
 - http://www.w3schools.com/Xml/xml_dtd.asp
 
  The XML starts with something of the form:
 
  ?xml version=1.0?
   XX xmlns=http://www.example.com/test/ui/; xmlns:xsi=
   http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=
   http://www.example.com/test/ui/
  ..\ExampleXML\Test.xsd
 
 
   AFAIK, it is still not possible to use Rev to extract
  these XML attributes
  (they aall get put in xmlns - see bugzilla 231) Skipping
  over that issue,
  I could extract
  xsi:schemaLocation=http://www.example.com/test/ui/.
 .\ExampleXML\Test.xsd
  with a script but then the url is a bit strange I'm
  not sure how to get the text referenced. Any ideas?
 



 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Searching for a tag name in XML

2009-04-22 Thread David Bovill
2009/4/21 Terry Judd t...@unimelb.edu.au

 I usually forget revXML and just use replace, itemOffset etc. to parse
 XHTML.


Yes - I've spent ages writing code to do that - but still not got anywhere
regarding nested brackets - or am i missing a trick - actually in this case
it might not be a bad idea - as you rarely have tables within tables - still
could your code handle extracting a table wich may or may not have a number
of tables within it?
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Searching for a tag name in XML

2009-04-22 Thread Terry Judd
David - from memory, I have had to deal with nested tables before (parsing
Flickr pages) and as you point out the replace/itemoffset approach would no
have worked. I think I had to rely on either the formatting of whitespace
within the html or the presence of adjacent tags to do what I wanted.

Terry...


On 23/04/09 12:20 AM, David Bovill david.bov...@gmail.com wrote:

 2009/4/21 Terry Judd t...@unimelb.edu.au
 
 I usually forget revXML and just use replace, itemOffset etc. to parse
 XHTML.
 
 
 Yes - I've spent ages writing code to do that - but still not got anywhere
 regarding nested brackets - or am i missing a trick - actually in this case
 it might not be a bad idea - as you rarely have tables within tables - still
 could your code handle extracting a table wich may or may not have a number
 of tables within it?
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Searching for a tag name in XML

2009-04-22 Thread Andre Garzia
Hello David,
RevXMLGetNamedChildren might help you!

:D
andre

On Tue, Apr 21, 2009 at 12:20 PM, David Bovill da...@vaudevillecourt.tvwrote:

 Looks like there is no easy way to search for an XML node? I want to search
 for a table element in xHTML. I can pull it out by looking for a
 particular value for the param - say border:

 put revXMLMatchingNode (treeID, pStartNode, table, border, 2, -1)
 into
 foundNode

 but given that it may or may not have such parameters:

 put revXMLMatchingNode (treeID, pStartNode, table, , , -1) into
 foundNode

 does not find anything.

 I can of course use built in rev commands to find the tag - but then it is
 not so easy to find the nodes path in the XML tree so I can pull out the
 entire table reliably from the xHTML.

 Is there any way to do this?
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution




-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Searching for a tag name in XML

2009-04-21 Thread David Bovill
Looks like there is no easy way to search for an XML node? I want to search
for a table element in xHTML. I can pull it out by looking for a
particular value for the param - say border:

put revXMLMatchingNode (treeID, pStartNode, table, border, 2, -1) into
foundNode

but given that it may or may not have such parameters:

put revXMLMatchingNode (treeID, pStartNode, table, , , -1) into
foundNode

does not find anything.

I can of course use built in rev commands to find the tag - but then it is
not so easy to find the nodes path in the XML tree so I can pull out the
entire table reliably from the xHTML.

Is there any way to do this?
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Searching for a tag name in XML

2009-04-21 Thread Terry Judd
I usually forget revXML and just use replace, itemOffset etc. to parse
XHTML.

Terry...


On 22/04/09 1:20 AM, David Bovill da...@vaudevillecourt.tv wrote:

 Looks like there is no easy way to search for an XML node? I want to search
 for a table element in xHTML. I can pull it out by looking for a
 particular value for the param - say border:
 
 put revXMLMatchingNode (treeID, pStartNode, table, border, 2, -1) into
 foundNode
 
 but given that it may or may not have such parameters:
 
 put revXMLMatchingNode (treeID, pStartNode, table, , , -1) into
 foundNode
 
 does not find anything.
 
 I can of course use built in rev commands to find the tag - but then it is
 not so easy to find the nodes path in the XML tree so I can pull out the
 entire table reliably from the xHTML.
 
 Is there any way to do this?
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Searching for a tag name in XML

2009-04-21 Thread Sarah Reichelt
On Wed, Apr 22, 2009 at 1:20 AM, David Bovill da...@vaudevillecourt.tv wrote:
 Looks like there is no easy way to search for an XML node? I want to search
 for a table element in xHTML. I can pull it out by looking for a
 particular value for the param - say border:

 put revXMLMatchingNode (treeID, pStartNode, table, border, 2, -1) into
 foundNode

 but given that it may or may not have such parameters:

 put revXMLMatchingNode (treeID, pStartNode, table, , , -1) into
 foundNode

 does not find anything.

 I can of course use built in rev commands to find the tag - but then it is
 not so easy to find the nodes path in the XML tree so I can pull out the
 entire table reliably from the xHTML.

 Is there any way to do this?


Untested but how about, using revXMLNodeContents and just trying to
find a table node e.g. html[1]/body[1]/table[1].
If there isn't one, you should get an xmlErr report.
If there is, you can loop on to looking for html[1]/body[1]/table[2]


HTH,
Sarah
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


How to create a UTF-8 XML file with rev?

2009-04-17 Thread Tiemo Hollmann TB
Hello,

I can't read/write german Umlaute in a XML file with rev. Trying to write,
they are just ignored, trying to read I get a parsing error input is no
proper UTF-8

How can I create a XML file with a special character set, like UTF-8 or
ISO-8859-1? When creating a XML file with revCreateXMLTree() the header
?xml version=1.0? is created by rev and I can't define any character
set, which should create a header like: ?xml version=1.0
encoding=ISO-8859-1?

What am I missing?

Thanks for any hint

Tiemo

 

 

 

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


AW: How to create a UTF-8 XML file with rev?

2009-04-17 Thread Tiemo Hollmann TB
Moin Malte,
great help! I didn't knew, that I can create my own header...
Thanks
Tiemo

 -Ursprüngliche Nachricht-
 Von: use-revolution-boun...@lists.runrev.com [mailto:use-revolution-
 boun...@lists.runrev.com] Im Auftrag von Malte Brill
 Gesendet: Freitag, 17. April 2009 11:30
 An: use-revolution@lists.runrev.com
 Betreff: Re: How to create a UTF-8 XML file with rev?
 
 Moin Tiemo,
 
 this should get you started (mind linewraps):
 
   put encodeUtf8(?xml version=  quote  1.0  quote  
 encoding=  quote  UTF-8  quote  ?request name=  quote 
 pAction  quote  /request) into tData
  put revCreateXMLTree(tData, true, true, false) into tId
 
 function decodeUtf8 pContents
  local tContents
  put unidecode(uniencode(pContents,UTF8),english) into tContents
  if chartonum(the last char of tContents)=10 then delete the last
 char of tContents
  return tContents
 end decodeUtf8
 
 function encodeUtf8 pContents
  return unidecode(uniencode(pContents, english), UTF8)
 end encodeUtf8
 
 Make sure to encodeUTF8 when you put your data into the XML and to
 decode when you retrieve it.
 
 Hth,
 
 Malte
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: How to create a UTF-8 XML file with rev?

2009-04-17 Thread Malte Brill

Moin Tiemo,

this should get you started (mind linewraps):

 put encodeUtf8(?xml version=  quote  1.0  quote
encoding=  quote  UTF-8  quote  ?request name=  quote   
pAction  quote  /request) into tData

put revCreateXMLTree(tData, true, true, false) into tId

function decodeUtf8 pContents
local tContents
put unidecode(uniencode(pContents,UTF8),english) into tContents
if chartonum(the last char of tContents)=10 then delete the last  
char of tContents

return tContents
end decodeUtf8

function encodeUtf8 pContents
return unidecode(uniencode(pContents, english), UTF8)
end encodeUtf8

Make sure to encodeUTF8 when you put your data into the XML and to  
decode when you retrieve it.


Hth,

Malte   
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Tree Arrays: putting XML in nested arrays

2009-01-01 Thread Trevor DeVore

On Dec 31, 2008, at 11:59 AM, David Bovill wrote:


 One question about the data structure:

[root]

  [...@attributes]
  [attr1]
  [node]
  [node] = value


This would mean that to extract the plain tree structure you would  
have to:


filter keys(someArray) without @*

Isn't this unnecessarily slow?
What do you think about:

  - put treeArray [_tree][root][node][1] into nodeContents
  - put treeArray [_attribute][root][node][1][style] into  
nodeStyle

  - put keys(treeArray [_tree][root]) into level1

Out of interest what do you use them for?


I've never timed the overhead of filter but in my case I don't notice  
a speed hit and the structure isn't unnecessary. I use these  
conversion routines to facilitate interfacing with web services. As  
soon as I receive a response from the server I convert it to a  
Revolution array. If I need to send a request then I create an array,  
convert to XML and send it. Often I need to be able to extract an  
entire node and send it to a function for further processing. If the  
attributes were stored in a different branch in the array then it  
would complicate the code for doing this.


In general I've found I can code much more quickly and end up with  
more readable code when working with the new MD arrays as opposed to  
the revXML calls.


Regards,

--
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com-www.screensteps.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Tree Arrays: putting XML in nested arrays

2009-01-01 Thread David Bovill
2009/1/1 Trevor DeVore li...@mangomultimedia.com


 I've never timed the overhead of filter but in my case I don't notice a
 speed hit and the structure isn't unnecessary. I use these conversion
 routines to facilitate interfacing with web services. As soon as I receive a
 response from the server I convert it to a Revolution array. If I need to
 send a request then I create an array, convert to XML and send it. Often I
 need to be able to extract an entire node and send it to a function for
 further processing. If the attributes were stored in a different branch in
 the array then it would complicate the code for doing this.


I can't see it would complicate anything - just simplify the code? To get an
attribute you'd simply prepend the path with @attribute rather than stick
it at the end - the bonus would be speed and less lines of code (no need for
filter). Or am I missing something?

In general I've found I can code much more quickly and end up with more
 readable code when working with the new MD arrays as opposed to the revXML
 calls.


Snap - that's one of the main use's here - I'm just looking to generalise
it. My thinking is that this exact same code could replace the
data-structures that I also use for tree-widgets (and therefore for storing
a variety of hierarchical data) - so a generic and fast treeArray data
structure could be used for both web service's (XML or JSON) and for tree /
outline widgets. That's why I'm being a bit picky about the actual data
structure, and making it as lean and fast as possible.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Tree Arrays: putting XML in nested arrays

2009-01-01 Thread Trevor DeVore

On Jan 1, 2009, at 10:10 AM, David Bovill wrote:

I can't see it would complicate anything - just simplify the code?  
To get an
attribute you'd simply prepend the path with @attribute rather  
than stick
it at the end - the bonus would be speed and less lines of code (no  
need for

filter). Or am I missing something?


With your design you are assuming that you will always be working on  
the entire tree. With my design I want each node of the array to be  
self contained so that it can be treated as a part separate from the  
whole. I can extract a node like this:


put theTreeA[root][node_1] into theNodeA

and I have all of the data relevant to that node. For how I work this  
is the logical approach given that I am not experiencing any speed  
issues. Have you benchmarked filter to see how badly it affects  
performance in your use cases?


Regards,

--
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com-www.screensteps.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Tree Arrays: putting XML in nested arrays

2009-01-01 Thread David Bovill
2009/1/1 Trevor DeVore li...@mangomultimedia.com


 With your design you are assuming that you will always be working on the
 entire tree. With my design I want each node of the array to be self
 contained so that it can be treated as a part separate from the whole. I can
 extract a node like this:

 put theTreeA[root][node_1] into theNodeA

 and I have all of the data relevant to that node.


Ah - OK. But this would only be one extra line and practically as fast:

put theTreeA[root][node_1] into theNodeA
 put thetre...@attributes][root][node_1] into theNodeA



 For how I work this is the logical approach given that I am not
 experiencing any speed issues. Have you benchmarked filter to see how badly
 it affects performance in your use cases?


No - but the processing is recursive to rebuild trees from the data
structure for expanding and collapsing lines, or indeed just about any
processing of the tree structure. If the tree structure is large with
hundreds of nodes this becomes important. A filter command be called on each
recursion for every node of the tree processed.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Tree Arrays: putting XML in nested arrays

2009-01-01 Thread Trevor DeVore

On Jan 1, 2009, at 2:13 PM, David Bovill wrote:

Ah - OK. But this would only be one extra line and practically as  
fast:


put theTreeA[root][node_1] into theNodeA


put thetre...@attributes][root][node_1] into theNodeA


But that wouldn't give you the same result. You would just have the  
attributes in theNodeA but not the rest of the node contents. Using  
your structure you have to combine your attributes node with the main  
node to get all data into a single array. This means you can't pass  
the node directly to a function call without first combining node and  
it's attributes into a temp array and then passing it in.


It seems like you are working with much larger data sets and you want  
to manipulate without knowing the structure ahead of time. I have no  
such need hence the reason I have little concern for a structure  
optimized for speed. I just want ease of use for my needs.


Regards,

--
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com-www.screensteps.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Tree Arrays: putting XML in nested arrays

2009-01-01 Thread David Bovill
Good point - wasn't thinking - having problems with the latest beta and
script editing, but I'll try and see if there are any speed issues
differences, and if not stick with your structures. Thanks.

2009/1/1 Trevor DeVore li...@mangomultimedia.com

 On Jan 1, 2009, at 2:13 PM, David Bovill wrote:

  Ah - OK. But this would only be one extra line and practically as fast:

 put theTreeA[root][node_1] into theNodeA

  put thetre...@attributes][root][node_1] into theNodeA


 But that wouldn't give you the same result. You would just have the
 attributes in theNodeA but not the rest of the node contents. Using your
 structure you have to combine your attributes node with the main node to get
 all data into a single array. This means you can't pass the node directly to
 a function call without first combining node and it's attributes into a temp
 array and then passing it in.

 It seems like you are working with much larger data sets and you want to
 manipulate without knowing the structure ahead of time. I have no such need
 hence the reason I have little concern for a structure optimized for speed.
 I just want ease of use for my needs.


 Regards,

 --
 Trevor DeVore
 Blue Mango Learning Systems
 www.bluemangolearning.com-www.screensteps.com
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Tree Arrays: putting XML in nested arrays

2008-12-31 Thread David Bovill
*Aim*
I am trying to define a generic data structure for storing tree structures
such as XML documents in the new nested arrays. I'd ike to use this
structure to store XML documents, and to store the tree data structures I
use for tree widgets. I'd like it to be simpler to use, understand and
debug, than the XML external.

NB - I remember a reference to some scripts that took XML and created the
new nested arrays. Anyone remember where it is - couldn't find it?

This post is a work in progress - brain dump. I hope it's useful. It helps
me structure my coding to write it up a bit first, and hopefully helps
others with similar issues.

*Key Words*
XML, tree widgets, nested data structures, design patterns, nested arrays,
regular epressions

*The Problem*
I'm working on a script to change one XML document into another - it is the
sort of thing XSLT http://www.w3.org/TR/xslt isused for.

So what would be a good way (design pattern) to convert one XML tree into
another in Revolution? Ideally this structure would work for XML - but also
more general tree structures where the node names could be complete lines of
text (and not simply single word xml node names), such as you might have in
an indented field.

There are all sorts of uses for this - lets take a recent example I've had
to do - translating rev htmltext to xHtml
basichttp://www.w3.org/TR/xhtml-basic/:
which essentially involves taking elements like 

As an example of the sort of hacks Id like to avoid - here is a function
that I came up with for the xHtml basic
http://www.w3.org/TR/xhtml-basic/use case:

function html_RevToBoldSpan someHtml
 put (?miU)(b).*(/b) into someReg
 -- put (?mi)(b)[^\]*(/b) into someReg
 repeat
 if matchchunk(someHtml, someReg, oTagStart, oTagEnd, cTagStart,
 cTagEnd) is true then
 put /span into char cTagStart to cTagEnd of someHtml
 put span style='font-weight:bold' into char oTagStart to
 oTagEnd of someHtml
 else
 return someHtml
 end if
 end repeat
 end html_RevToBoldSpan


Tip - for those of you that have delved into regular expressions - this
script illustrates a new trick I've found with regular expressions - the use
of U to force no-greedy matching - (?miU) at the beginning of a regexp
causes the match to be multi-line (m), case insensitive (i) and non-greedy
(U).

This problem with scripts like this is that they cannot deal with true
nested formatting tags - for that you need to walk the tag tree - which is
what I'd like to do next:

Here were my initial thoughts on a simple start based on renaming XML nodes:

   1. Create an XML Tree for the original XML
   2. Create a new one for the transformed XML
   3. Write a recursive function to walk the tree - starting at the root
   node, getting its children and recursing
   4. Have the recursive function make a call to a translate function which
   uses an array to store the new tag names as the contents of nested keys -
   this could be an array or use the xml treeID

Somehow I need to include the general ability to use node attributes to
determine the new node name - so that:

span style='font-weight:bold'  = b
 span style='color:#FF'Red/span = font color=#FF


I think what I'd really like to do all this with arrays rather than XML
treeIDs - that is:

   1. Create an XML Tree for the original XML and convert it to an array
   2. Write a recursive function to walk the array - starting at the root
   node, getting its children and recursing
   3. Have the recursive function make a call to a translate function which
   uses an array to store the new tag names as the contents of nested keys -
   building a new transformed array as it goes
   4. Create a new XML document from the transformed Array

What I need to decide is:

   - what sort of structure to use for this generic array, and not so
   critically
   - how to implement some sort of plugin to this design pattern so it is
   easy do a variety of transformations easily and intuitively.

*Nested Array Data Structure*
For the array structure I want to use the new nested arrays, and also to be
able to store attributes of nodes - something like:

node_1
 node_1_1
node_1_1_1
 node_1_2


Puttin an XML tree like that above into a nested array we could then do
things like:

   - put treeArray [node_1][node_1_2] into nodeContents
   - put treeArray [node_1][node_1_2][attribute][style] into
   nodeStyle

With the attributes it gets ugly, and would require filtering out the
attribute key, and naming it in some unique as possible way. So probably
better to store a separate attribute branch of the array?

   - put treeArray [_tree][node_1][node_1_2] into nodeContents
   - put treeArray [_attribute][node_1][node_1_2][style] into
   nodeStyle

*What about duplicate nodes?*
This is where I get a bit stuck, as there are still problems: for instance
at the moment the structure does not allow for duplicate nodes (which are
very common

Re: Tree Arrays: putting XML in nested arrays

2008-12-31 Thread Trevor DeVore

On Dec 31, 2008, at 8:02 AM, David Bovill wrote:


*Aim*
I am trying to define a generic data structure for storing tree  
structures

such as XML documents in the new nested arrays. I'd ike to use this
structure to store XML documents, and to store the tree data  
structures I

use for tree widgets. I'd like it to be simpler to use, understand and
debug, than the XML external.

NB - I remember a reference to some scripts that took XML and  
created the

new nested arrays. Anyone remember where it is - couldn't find it?



Hi David,

I included some md array - xml routines in an article I wrote for  
revUp. I'm including the latest version of these handlers at the ned  
of the email. I updated them a few weeks ago.


The two primary functions are ConvertXMLToArray and ConvertXMLToArray.

The default array structure stores node values as the value of the  
node key in the array:


[root]
[...@attributes]
[attr1]
[node]
[node] = value

If you have nodes where you need to store both attributes of a node as  
well as it's value then you can pass a flag to ConvertXMLToArray and  
values will be stored in a @value key:


[root]
[...@attributes]
[attr1]
[node]
[node]
[...@attribtues]
[attr1]
[...@value] = value

Regards,

--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Developer Resources: http://revolution.bluemangolearning.com


--
-- Converts an XML tree into a Revolution multi-dimensional array.
-- A nodes attributes will be stored as an array of it's @attributes  
key.
-- Node names will retain the sequence information (i.e. node[1],  
node[2], etc.).
-- This information is necessary to determine order that keys should  
be processed in. Example:

-- set the itemDelimiter to [
-- put the keys of theArray into theKeys
-- sort theKeys numeric by the last item of each
--
-- pUseValueKey: The default value is false. In this case you get an  
array that has an @attributes
-- key for nodes that have attributes and either a) no value or b)  
only child nodes. Otherwise it contains the node contents.
-- Set to true if you want to store a nodes value in the '@value' key.  
This will allow a key to have

-- both attributes (in @attributes key) and a value (in @value key).
--
function ConvertXMLToArray pXML, pStoreEncodedAs, pUseValueKey
local theArray,theResult,theRootNode,theTreeID
local theXMLEncoding

## Create an XML tree from XML text
put revCreateXMLTree(pXML, true, true, false) into theTreeID

if theTreeID is an integer then
## Determine the encoding of the XML, default to UTF-8
put matchtext(pXML, \?xml (.*)encoding=  quote  (.*)   
quote  \?, versionMatch, theXMLEncoding) into theResult

if theXMLEncoding is empty then put utf-8 into theXMLEncoding

## Now convert to array.
## The 1st dimension has one key which is the name of the  
root node.

put revXMLRootNode(theTreeID) into theRootNode
if theRootNode is not empty and not(theRootNode begins with  
xmlerr,) then
put ConvertXMLNodeToArray(theTreeID, theRootNode,  
theXMLEncoding, pStoreEncodedAs, pUseValueKey) into  
theArray[theRootNode]

end if

revDeleteXMLTree theTreeID
end if

return theArray
end ConvertXMLToArray


function ConvertXMLTreeToArray pXMLTree, pStoreEncodedAs, pUseValueKey
return ConvertXMLToArray(revXMLText(pXMLTree), pStoreEncodedAs,  
pUseValueKey)

end ConvertXMLTreeToArray


--
-- Converts a multi-dimensional array to an XML tree.
-- The array should contain one key in the 1st dimension which
-- will become the root node. Attributes of a node should be stored
-- as an array in the @attributes key. Sequence information for multiple
-- nodes with the same name should be included in the node name using
-- brackets (i.e. node[1], node[2], node[3]).
-- Returns an xml tree id (integer) or an error message.
--
function ConvertArrayToXML pArray, pArrayEncoding, pStoreEncodedAs
local theError,theRootNode,theXML,theXMLTree

## if pArrayEncoding is empty then current platform encoding is  
assumed

if pStoreEncodedAs is empty then put UTF-8 into pStoreEncodedAs

## Create XML for root node. Note that we take extra steps in  
order to support
## converting an array that only represents part of a tree rather  
than the entire tree.

## In this case there may be multiple nodes at the root level.
put line 1 of the keys of pArray into theRootNode
set the itemdelimiter to [
put   item 1 of theRootNode  / into theXML

## Create XML needed to create tree
put format(?xml version=\1.0\ encoding=\%s\?%s, \
pStoreEncodedAs, theXML) into theXML
put revCreateXMLTree(theXML, true, true, false) into theXMLTree

if theXMLTree is an integer then
## Loop over all nodes at root level
put false into stripMetaKeys
put

Re: Tree Arrays: putting XML in nested arrays

2008-12-31 Thread David Bovill
Thanks for these trevor - I've only just started so should save plenty of
time. One question about the data structure:

[root]
[...@attributes]
[attr1]
[node]
[node] = value


This would mean that to extract the plain tree structure you would have to:

filter keys(someArray) without @*

Isn't this unnecessarily slow? What do you think about:

   - put treeArray [_tree][root][node][1] into nodeContents
   - put treeArray [_attribute][root][node][1][style] into nodeStyle
   - put keys(treeArray [_tree][root]) into level1

I'll start playing with your scripts now so maybe I'll have a few
questions later :) Out of interest what do you use them for?
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


XML question

2008-11-16 Thread Richmond Mathewson
Can anybody tell me what packaged xml is?

sincerely, Richmond Mathewson.



A Thorn in the flesh is better than a failed Systems Development Life Cycle.




___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML question

2008-11-16 Thread Björnke von Gierke
I'm assuming this refers to the XML files the documentation is in.  
They are packaged by Rev as follows:


XML Data (without DTD) is put into a customproperty named c   
number, where number is mostly random (as far as i can tell).
This customproperty is in a stack called revDocClump_  number,  
they are numbered continuously.
This stack is is saved at this place: .../3.0.0-gm-3/Documentation/ 
packaged_xml/dictionary (or glossary instead of dictionary).
In the same folder is a plain text file called clumps.index that  
describes in which rev stack what clumps are saved.
One folder up (packaged_xml), you'll find the dict.index file.  
Itcontains several data points about the entries (some information is  
in there but not in the xml data). This list is also used to create  
the listing of terms for the build in documentation.


If you want just the dictionary files, it's probably easisest to let  
BvG Docu extract them for you, and use the dict.index file yourself  
(bvg docu names the files appropriately, so they work with the  
existing index file). The glossary information is not used BvG Docu,  
and therefore not extracted by it.
If you need the DTD, then look at this cprop: the cDictDTD of stack  
revDocumentationLibrary. Or at the customproperty of the  first card  
of my dictionary library stack (a substack of BvG docu).


cheers
Björnke

On 16 Nov 2008, at 17:10, Richmond Mathewson wrote:


Can anybody tell me what packaged xml is?

sincerely, Richmond Mathewson.



On 15 Nov 2008, at 21:44, Joe Lewis Wilkins wrote:

But WHERE is the XML file in the Rev pkg.? I'm looking at the 3.0  
version of the dictionary, which changed a lot from 2.9.





--

official ChatRev page:
http://bjoernke.com/runrev/chatrev.php

Chat with other RunRev developers:
go stack URL http://bjoernke.com/stacks/chatrev/chatrev1.3b3.rev;

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Cleaning/parsing HTML XML

2008-11-11 Thread william humphrey
Thanks Andre. I've been storing everything like that in my Valentina
database and I've never tried custom properties. I certainly should.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML encoding oddities

2008-11-10 Thread Trevor DeVore

On Nov 9, 2008, at 11:50 AM, Mark Smith wrote:

So, finally, is there a way to encode xml documents as UTF-8 (or  
whatever) without having to encode each part myself, and add the  
encoding attribute to the header myself?


Mark,

Have you tried creating your XML tree with the encoding included?

put format(?xml version=\1.0\ encoding=\UTF-8\? 
whatshappening/whatshappening) into tXml

put revCreateXmlTree(tXml, true, true, false) into tTree
put revXmlRootNode(tTree) into tNode

I've done this in the past and then I pass UTF-8 encoded strings to  
the revXML handlers.


Regards,

--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Developer Resources: http://revolution.bluemangolearning.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML encoding oddities

2008-11-10 Thread Mark Smith

Thanks Trevor! (Also Ken). That seems to work very well.

The particular problem I was trying to solve was how to serialize  
arrays with arbitrary keys and contents, such that they can be shared  
across networks and platforms. I think I've found a solution for my  
purposes, (though it won't be reliable with binary data), and it  
involves building the xml without the xml library, and then using the  
library to unserialize - though it fails if there is any ?xml...  
header at all!


Best,

Mark

On 10 Nov 2008, at 14:33, Trevor DeVore wrote:


On Nov 9, 2008, at 11:50 AM, Mark Smith wrote:

So, finally, is there a way to encode xml documents as UTF-8 (or  
whatever) without having to encode each part myself, and add the  
encoding attribute to the header myself?


Mark,

Have you tried creating your XML tree with the encoding included?

put format(?xml version=\1.0\ encoding=\UTF-8\? 
whatshappening/whatshappening) into tXml

put revCreateXmlTree(tXml, true, true, false) into tTree
put revXmlRootNode(tTree) into tNode

I've done this in the past and then I pass UTF-8 encoded strings to  
the revXML handlers.


Regards,

--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Developer Resources: http://revolution.bluemangolearning.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML encoding oddities

2008-11-10 Thread Trevor DeVore

On Nov 10, 2008, at 11:21 AM, Mark Smith wrote:


Thanks Trevor! (Also Ken). That seems to work very well.

The particular problem I was trying to solve was how to serialize  
arrays with arbitrary keys and contents, such that they can be  
shared across networks and platforms. I think I've found a solution  
for my purposes, (though it won't be reliable with binary data), and  
it involves building the xml without the xml library, and then using  
the library to unserialize - though it fails if there is any ? 
xml... header at all!


Mark,

For what it's worth I've been using the attached SerializeArray/ 
UnserializeArray handlers with relatively small arrays for a while now  
and they seem to be working well enough for storing them in a database.


Regards,

--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Developer Resources: http://revolution.bluemangolearning.com



function SerializeArray pArray
   repeat for each key theKey in pArray
  if the keys of pArray[theKey] is not empty then
 put urlencode(theKey)  :  ___array___:   
urlencode(SerializeArray(pArray[theKey]))  cr after theData

  else
 put urlencode(theKey)  :   
urlencode(base64encode(pArray[theKey]))  cr after theData

  end if
   end repeat
   delete the last char of theData
   return theData
end SerializeArray

-- Returns array
-- Support Rev 3.0 multi-dimensional arrays
function UnserializeArray pSerializedArray
   set the itemdelimiter to :
   repeat for each line theLine in pSerializedArray
  if item 2 of theLine begins with ___array___ then
 put urldecode(item 1 of theLine) into theKey
 put UnserializeArray(urldecode(item 3 of theLine)) into  
theArray[theKey]

  else
 put urldecode(item 1 of theLine) into theKey
 put base64decode(urldecode(item 2 to -1 of theLine)) into  
theArray[theKey]

  end if
   end repeat
   return theArray
end UnserializeArray
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML encoding oddities

2008-11-10 Thread Mark Smith
Trevor, this is nice. I'd started doing something similar, but then  
realised that what I was after for what I'm working on was a way to  
neatly package up pretty much any non-binary data, array or not,  
whatever platform, and send to to a linux server (also running  
revolution) where it could be unpacked and used as is - hence the  
encoding issue.


What I've come up with is considerably longer than yours :-) (Partly  
because I've factored out quite a lot of stuff to sub-handlers).
But it seems to work well, and even produces slightly more compact  
output than yours when dealing with chunks of data 2-3Kb or more in  
size, which is no bad thing even in today's bandwidth? what's  
bandwidth? world.


I also wrote a handy function arraysMatch() to test the input/output.

For what it's worth, here it all is, below,

Best,

Mark


-- pack and unpack are the 'high-level' functions

function pack pData
   if pData is not an array then
  put pData into tArray[futpak]
  put tArray into pData
   end if
   put atx(pData) into tXml

   put base64encode(compress(tXml)) into tB64data
   replace cr with empty in tB64data
   return futpak  tB64data
end pack

-

function unpack pData
   if char 1 to 6 of pData is not futpak then return empty
   put decompress(base64decode(char 7 to -1 of pData)) into tXml
   put xta(tXml) into tArray
   if keys(tArray) = futpak then
  return tArray[futpak]
   else
  return tArray
   end if
end unpack

 
--

-- turns any revolution array into xml. (not nice to look at, though)
-- array keys are stored as attributes of nodes
-- all element and attribute contents are utf8encoded and base64encoded
 
--


function atx pArray
   put revarray after tXml
   put atxNodes(pArray) after tXml
   put /revarray after tXml
   return tXml
end atx

private function atxNodes pArray pLevel
   if pLevel is empty then put 0 into pLevel
   add 1 to pLevel

   repeat for each key k in pArray
  add 1 to n
  put atx  pLevel  -  n into tName
  put   tName  key=  q(b64U8encode(k))   after tXml
  if pArray[k] is an array then
 put atxNodes(pArray[k], pLevel) after tXml
  else
 put b64U8encode(pArray[k]) after tXml
  end if
  put /  tName   after tXml
   end repeat
   return tXml
end atxNodes

 
---

-- takes xml and attempts to turn it into an array
-- see atx() above.
 
---


function xta pXml
   put revCreateXmlTree(pXml, true, true, false) into tTree
   put xtaNodes(tTree, revarray) into tArray
   revDeleteXmlTree tTree
   return tArray
end xta

-

private function xtaNodes pTree, pNode
   put revXmlFirstChild(pTree, pNode) into tNode

   repeat while tNode is not empty and xmlerr is not in tNode
  put b64U8decode(revXmlAttribute(pTree, tNode, key)) into tKey
  if revXmlChildNames(pTree, tNode,cr,, false) is empty then
 put b64U8decode(revXmlNodeContents(pTree, tNode)) into  
tArray[tKey]

  else
 put xtaNodes(pTree, tNode) into tArray[tKey]
  end if
  put revXmlNextSibling(pTree, tNode) into tNode
   end repeat
   return tArray
end xtaNodes

-

function utf8encode pString
  return unidecode(uniencode(pString),UTF8)
end utf8encode

-

function utf8decode pString
   return unidecode(uniencode(pString,UTF8))
end utf8decode

-

function b64U8encode pData
   put base64encode(utf8encode(pData)) into tEnc
   replace cr with empty in tEnc
   return tEnc
end b64U8encode

-

function b64U8decode pData
   return utf8decode(base64decode(pData))
end b64U8decode

-

function arraysMatch a1, a2
   put keys(a1) into k1 ; put keys(a2) into k2
   sort lines of k1; sort lnes of k2
   put (k1 = k2) into tArraysMatch
   if tArraysMatch then
  repeat for each key k in a1
 if a1[k] is an array then
put arraysMatch(a1[k], a2[k]) into tArraysMatch
 else
put (a1[k] = a2[k]) into tArraysMatch
 end if
 if not tArraysMatch then exit repeat
  end repeat
   end if
   return tArraysMatch
end arraysMatch

-

function q aString
  return quote  aString  quote
end q

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Cleaning/parsing HTML XML

2008-11-10 Thread Andre Garzia
Willian,

I usually use Ken Rays stsXMLLib which I grew very fond of.

A nice way of escaping XML entities is to use a custom property as a
little map, for example:

 gt;
 lt;
 amp;

Then you do a loop like:

repeat for each line tEntry in the cReplacementMap of this stack
  replace word 1 of tEntry with word 2 of tEntry in theText
end repeat

this way, if you ever need to escape something more, you don't need to
change your code. I have a lot of XML, XHTML, *ML code here and I find
that every time I hard code something like a collection of things to
replace of thing like that, in the end, I need to change and fix
several parts of the code.

custom properties are your friend!

Cheers
andre

On Sat, Nov 8, 2008 at 8:30 PM, william humphrey [EMAIL PROTECTED] wrote:
 I'm generating my own XML without using the XML functions of RunRev (it's
 faster and I can format exactly how I want it to look). But I would like a
 function for cleaning the text for  to amp; and that kind of thing.
 Any suggestions for such a function? There must be one in RunRev that the
 XML library uses.

 Thanks,  Bill
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution




-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Cleaning/parsing HTML XML

2008-11-09 Thread william humphrey
Mark
Thanks. I hadn't realized there were so few to worry about. I will write a
function that is exactly the opposite of the one you wrote (because I am
converting SQL data to XML). Are you finding it easier and better to roll
your own XML instead of using all the RunRev functions?

Bill

On Sat, Nov 8, 2008 at 10:28 PM, Mark Smith [EMAIL PROTECTED] wrote:

 Here's a function I've used in parsing the content of xml documents:

 function xmlEntities pXmlContent
   replace quot; with quote in pXmlContent
   replace apos; with ' in pXmlContent
   replace lt; with  in pXmlContent
   replace gt; with  in pXmlContent
   replace amp; with  in pXmlContent
   return pXmlContent
 end xmlEntities

 According to wikipedia (http://en.wikipedia.org/wiki/
 List_of_XML_and_HTML_character_entity_references)
 there are only these 5 to deal with. For html there are 252!

 Best,

 Mark


 On 8 Nov 2008, at 22:30, william humphrey wrote:

  I'm generating my own XML without using the XML functions of RunRev (it's
 faster and I can format exactly how I want it to look). But I would like a
 function for cleaning the text for  to amp; and that kind of thing.
 Any suggestions for such a function? There must be one in RunRev that the
 XML library uses.

 Thanks,  Bill
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution


 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution




-- 
http://www.bluewatermaritime.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


XML encoding oddities

2008-11-09 Thread Mark Smith

I'm seeing some (I think) very strange behaviour from the XML library...

(warning, this is quite long, and won't be of much interest to anyone  
who isn't using the library...)


This is on an intel macintosh, OS 10.4.11

In a button, I have the following script:

-
on mouseUp
   put toXml() into tXml
   put tXml  cr  fromXml(tXml)
end mouseUp

function toXml
   put whatshappening/whatshappening into tXml
   put revCreateXmlTree(tXml, true, true, false) into tTree
   put revXmlRootNode(tTree) into tNode

   revAddXmlNode tTree, tNode, name, fred

   put revXmlText(tTree) into tText
   revDeleteXmlTree tTree
   return tText
end toXml

function fromXml pXml
   put revCreateXmlTree(pXml, true, true, false) into tTree
   put revXmlRootNode(tTree) into tNode
   put revXmlFirstChild(tTree, tNode) into tChild

   put revXmlNodeContents(tTree, tChild) into tContent
   revDeleteXmlTree(tTree)
   return tChild  cr  tContent
end fromXml
-

The output is:

?xml version=1.0?
whatshappeningnamefred/name/whatshappening

/whatshappening/name
fred

So all is good. If I change fred in the toXml function to fréd,  
(acute accent on the 'e'), I get this:


?xml version=1.0?
whatshappeningname/name/whatshappening

/whatshappening/name

The content has simply disappeared, so I guess I need to encode non- 
ascii material. OK, but as what? (ideally UTF-8), and how do I  
indicate what I've done in my xml document?


However, if I now add an accented string as an attribute:

-
function toXml
   put whatshappening/whatshappening into tXml
   put revCreateXmlTree(tXml, true, true, false) into tTree
   put revXmlRootNode(tTree) into tNode

   revAddXmlNode tTree, tNode, name, fred
   revSetXmlAttribute tTree, tNode  /name, orig, fréd

   put revXmlText(tTree) into tText
   revDeleteXmlTree tTree
   return tText
end toXml

function fromXml pXml
   put revCreateXmlTree(pXml, true, true, false) into tTree
   put revXmlRootNode(tTree) into tNode
   put revXmlFirstChild(tTree, tNode) into tChild

   put revXmlNodeContents(tTree, tChild) into tContent
   put revXmlAttribute(tTree, tChild, orig) into tAtt
   revDeleteXmlTree(tTree)
   return tChild  cr  tContent  cr  tAtt
end fromXml
-

I get:

?xml version=1.0 encoding=ISO-8859-1?
whatshappeningname orig=frédfred/name/whatshappening

/whatshappening/name
fred
frŽd

An encoding attribute has now been aded to the xml header, and some  
version of the orig attribute value (not ISO-8859-1, as far as I  
can tell) has been produced. 


So, finally, is there a way to encode xml documents as UTF-8 (or  
whatever) without having to encode each part myself, and add the  
encoding attribute to the header myself?


What is slightly worrying is that it seems the library will add an  
encoding attribute to the header in some circumstances, but not others.


Ken (if you're reading this), does your library deal with this stuff  
better?


Best,

Mark

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML encoding oddities

2008-11-09 Thread Ken Ray
 I forgot that there was a whole 'nother XML library to try. I gave up on the
 RunRev one. Does the stsXML library return nicely formated XML that is all
 indented, nested, spaces inserted (or tabs) and everything so it is clean to
 read?  

Yes, as a matter of fact!

 Did you stop working on it now that RunRev has all their XML stuff or
 are you still improving it as an alternative?

I'm still working on it (off and on), but haven't had time to do much more
than maintain it at the moment.

Ken Ray
Sons of Thunder Software, Inc.
Email: [EMAIL PROTECTED]
Web Site: http://www.sonsothunder.com/


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: XML encoding oddities

2008-11-09 Thread william humphrey
I forgot that there was a whole 'nother XML library to try. I gave up on the
RunRev one. Does the stsXML library return nicely formated XML that is all
indented, nested, spaces inserted (or tabs) and everything so it is clean to
read?  Did you stop working on it now that RunRev has all their XML stuff or
are you still improving it as an alternative?
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


  1   2   3   4   5   6   7   >