RE: [U2] XML Escape function

2009-02-25 Thread Womack, Adrian
Here's the code I use (similar to everyone else's) - but I've catalogued
it globally as a user conversion subroutine - this allows it to be used
with ICONV & OCONV:

Eg. CONV.XML = OCONV(ORIG.XML,"U2XML")

Note: I've included conversion for three mark characters, just in case
they manage to sneak through!

To catalog the routine - use this: "CATALOG BP $2XML U2XML"

  FUNCTION U2XML(STATUS.CODE, DATA.FIELD, INTERNAL)
*

*
*
* Arguments:
*
*  STATUS.CODE (I/O) Input : The conversion code
*Output: The value to return to set STATUS()
*  DATA.FIELD  (I)   The data to be converted
*  INTERNAL(I)   @TRUE = ICONV; @FALSE = OCONV
*
*  returns : The converted DATA.FIELD
*

*
*
  STATUS.CODE = 0
*
  IF INTERNAL
  THEN
 RESULT = CHANGE(DATA.FIELD, "&", "&")
 RESULT = CHANGE(RESULT, "<", "<")
 RESULT = CHANGE(RESULT, ">", ">")
 RESULT = CHANGE(RESULT, "'", "'")
 RESULT = CHANGE(RESULT, '"', """)
 RESULT = CHANGE(RESULT, @VM, "ý")
 RESULT = CHANGE(RESULT, @FM, "þ")
 RESULT = CHANGE(RESULT, @SM, "ü")
  END
  ELSE
 IF INDEX(DATA.FIELD,"&",1)
 THEN
RESULT = CHANGE(DATA.FIELD, "&", "&")
RESULT = CHANGE(RESULT, "<", "<")
RESULT = CHANGE(RESULT, ">", ">")
RESULT = CHANGE(RESULT, "'", "'")
RESULT = CHANGE(RESULT, """, '"')
RESULT = CHANGE(RESULT, "ý", @VM)
RESULT = CHANGE(RESULT, "þ", @FM)
RESULT = CHANGE(RESULT, "ü", @SM)
 END
 ELSE
RESULT = DATA.FIELD
 END
  END
*
  RETURN (RESULT)
*

*
*
   END 

-Original Message-
From: owner-u2-us...@listserver.u2ug.org
[mailto:owner-u2-us...@listserver.u2ug.org] On Behalf Of Ben Souther
Sent: Thursday, 26 February 2009 5:13 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] XML Escape function

Years ago, I thought I saw an XML escape function in Unibasic but I
can't seem to find it now.  I thought it was mentioned in the Unidata
Extensions PDF but I'm not able to find it.

Does anyone know if such a function exists?

Thanks,
-Ben
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


DISCLAIMER:
Disclaimer.  This e-mail is private and confidential. If you are not the 
intended recipient, please advise us by return e-mail immediately, and delete 
the e-mail and any attachments without using or disclosing the contents in any 
way. The views expressed in this e-mail are those of the author, and do not 
represent those of this company unless this is clearly indicated. You should 
scan this e-mail and any attachments for viruses. This company accepts no 
liability for any direct or indirect damage or loss resulting from the use of 
any attachments to this e-mail.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] [UV] HP, Cron, Como, Execute, Capturing . Not

2009-02-25 Thread Ken Wallis
tee is a pretty standard UNIX tool.  I cannot think of a variant which
doesn't support it as standard.  At worst you'd have to find an open source
version and compile it, but it is one of the simplest programs - I doubt it
calls anything remotely non-standard.

-Original Message-
Anthony W. Youngman wrote:

I'm not sure whether tee is available across all nix platforms, though.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] [UV] HP, Cron, Como, Execute, Capturing . Not

2009-02-25 Thread Anthony W. Youngman
In message 
<619f7eea7a19a945876205ff14ee8de10116e...@win2003.office.stamina.com.au>,

 Ross Ferris  writes

Have you changed the code yet to avoid problem? You haven't mentioned
version of UV --> if not current, check later GTARs to see if issue
identified/resolved.

Get the customer going with a redirection/read ... obviously (?) new
code, but an

ls -l > /tmp/unique_filename


if you want the COMO to get it as well, try

ls -l | tee /tmp/unique_filename


will work across ANY *nix platform --> assume cron is running as same
user/permissions as when you fire from TCL


I'm not sure whether tee is available across all nix platforms, though.

Cheers,
Wol
--
Anthony W. Youngman 
'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the
thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The man
lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
Visit the MaVerick web-site -  Open Source Pick
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] [UV] HP, Cron, Como, Execute, Capturing . Not (Solved!)

2009-02-25 Thread Tony G
Ken wins!
Running cron as a non-root user (probably a good idea anyway)
causes this environment to work properly.

Your prize is a free permanent end-user license for NebulaXLite
for any supported platform.  Developer licenses are free anyway
so for anyone else who contributed to this thread to this point,
I'll offer one permanent license at 50% off.  Given the economy,
maybe that's a new way for us to show our gratitude in these
forums?  :)

Thanks to all.
Tony Gravagno
Nebula Research and Development
TG@ remove.pleaseNebula-RnD.com


From: Ken Hall
> Tony -
> It just occurred to me that cron is running uv as root and that
when 
> root starts uv, the LOGIN proc does not run except in the uv
account. 
> Try changing the user in cron to a normal uv user and I bet
your 
> problem will go away.
...
> >So it's a prog wrapped in COMO, in a paragraph, with 
> >stdout redirected, executed from uv, within a script, 
> >called from cron. (Sometimes I'm amazed any of this 
> >works.)
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] XML Escape function

2009-02-25 Thread George Gallen
I Use the following (it's not intrinsic):

  DATAITEM=CHANGE(DATAITEM,"&","&")
  DATAITEM=CHANGE(DATAITEM,"<","<")
  DATAITEM=CHANGE(DATAITEM,">",">")
  DATAITEM=CHANGE(DATAITEM,"'","'")

George

> -Original Message-
> From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2-
> us...@listserver.u2ug.org] On Behalf Of Ben Souther
> Sent: Wednesday, February 25, 2009 3:13 PM
> To: u2-users@listserver.u2ug.org
> Subject: [U2] XML Escape function
>
> Years ago, I thought I saw an XML escape function in Unibasic but I
> can't seem to find it now.  I thought it was mentioned in the Unidata
> Extensions PDF but I'm not able to find it.
>
> Does anyone know if such a function exists?
>
> Thanks,
> -Ben
> ---
> u2-users mailing list
> u2-users@listserver.u2ug.org
> To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] XML Escape function

2009-02-25 Thread Henry Unger
I don't know if there is one, but, for text nodes in XML documents, you
could do:

value = change( value, '&',   '&' )
value = change( value, '<',   '<'  )
value = change( value, '>',   '>'  )
value = change( value, '#xD', '
' )

according to RFC 3076:

"Text Nodes - the string value, except all ampersands are replaced by &,
all open angle brackets (<) are replaced by <, all closing angle brackets
(>) are replaced by >, and all #xD characters are replaced by 
."

Other node types, notably attribute nodes, have other requirements that
differ from the above.

Best regards,

Henry

Henry P. Unger
Hitech Systems, Inc.
http://www.hitech.com

-Original Message-
From: owner-u2-us...@listserver.u2ug.org
[mailto:owner-u2-us...@listserver.u2ug.org] On Behalf Of Ben Souther
Sent: Wednesday, February 25, 2009 12:13 PM
To: u2-users@listserver.u2ug.org
Subject: [U2] XML Escape function

Years ago, I thought I saw an XML escape function in Unibasic but I
can't seem to find it now.  I thought it was mentioned in the Unidata
Extensions PDF but I'm not able to find it.

Does anyone know if such a function exists?

Thanks,
-Ben
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


[U2] XML Escape function

2009-02-25 Thread Ben Souther
Years ago, I thought I saw an XML escape function in Unibasic but I
can't seem to find it now.  I thought it was mentioned in the Unidata
Extensions PDF but I'm not able to find it.

Does anyone know if such a function exists?

Thanks,
-Ben
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/