preserve vertical white space in XML?

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

preserve vertical white space in XML?

Sivakatirswami
I always use extra line breaks in my XML docs and .XHTML docs... for  
readability.

But, if you create an XML Tree from one of these, transform some data  
in a node and then

put revXMLText(tCurrTree) into tNewFile

to get that data back out, Rev's XML libraries have wiped out all the  
cr's.

What is interesting is that double cr's are preserved, singles are not

e.g

<node1>Revolutionaries</node1>
<node2>will make a better future</node2>
<here_is_why>

A brilliant rev advocacy essay

with many paragraphs

</here_is_why>

get returned as:

<node1>Revolutionaries</node1><node2>will make a better future</
node2><here_is_why>

A brilliant rev advocacy essay

with many paragraphs

</here_is_why>

Is there a way to preserve the single cr's in the original? Otherwise  
I have to a) live with it b) open them in BBEdit and run a format  
function to get them back to a readable state--each child node on  
it's own line...

TIA

Sivakatirswami
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: preserve vertical white space in XML?

masmit
I noticed this too - the revXMLText function does not put any end of
line delimiters between tags, though of course it preserves them with
in node contents.

For simple cases (and I think this would cover the case given),

put revXMLText(treeID) into theXML
replace "><" with ">" & cr & "<" in theXML

will work.

On my current project, I found it easier (and quicker in execution) to
generate the XML in my own code, rather than using the library, though
I still use the library for reading it back in.

Mark Smith


On 9 Jul 2005, at 06:50, Sivakatirswami wrote:

> I always use extra line breaks in my XML docs and .XHTML docs... for
> readability.
>
> But, if you create an XML Tree from one of these, transform some data
> in a node and then
>
> put revXMLText(tCurrTree) into tNewFile
>
> to get that data back out, Rev's XML libraries have wiped out all the
> cr's.
>
> What is interesting is that double cr's are preserved, singles are not
>
> e.g
>
> <node1>Revolutionaries</node1>
> <node2>will make a better future</node2>
> <here_is_why>
>
> A brilliant rev advocacy essay
>
> with many paragraphs
>
> </here_is_why>
>
> get returned as:
>
> <node1>Revolutionaries</node1><node2>will make a better
> future</node2><here_is_why>
>
> A brilliant rev advocacy essay
>
> with many paragraphs
>
> </here_is_why>
>
> Is there a way to preserve the single cr's in the original? Otherwise
> I have to a) live with it b) open them in BBEdit and run a format
> function to get them back to a readable state--each child node on it's
> own line...
>
> TIA
>
> Sivakatirswami
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: preserve vertical white space in XML?

Ken Ray
In reply to this post by Sivakatirswami

> Is there a way to preserve the single cr's in the original? Otherwise
> I have to a) live with it b) open them in BBEdit and run a format
> function to get them back to a readable state--each child node on
> it's own line...

One alternative is to use my Transcript-based XML Library which will
preserve white space, but the current version works differently than revXML
(i.e. it works with nodes and children instead of an XPATH). If you're
interested, check it out...

http://www.sonsothunder.com/products/metacard/xmllib.htm

Ken Ray
Sons of Thunder Software
Email: [hidden email]
Web Site: http://www.sonsothunder.com/



_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: preserve vertical white space in XML?

Terry Judd
In reply to this post by Sivakatirswami
Actually you can maintain at least some formatting by passing 'true' as
a(n undocumented)  third parameter to the revXMLText function...

put revXMLText(treeID,,true)

HTH

Terry...

> I noticed this too - the revXMLText function does not put any end of
> line delimiters between tags, though of course it preserves them with
> in node contents.
>
> For simple cases (and I think this would cover the case given),
>
> put revXMLText(treeID) into theXML
> replace "><" with ">" & cr & "<" in theXML
>
> will work.
>
> On my current project, I found it easier (and quicker in execution) to
> generate the XML in my own code, rather than using the library, though
> I still use the library for reading it back in.
>
> Mark Smith
>
>
> On 9 Jul 2005, at 06:50, Sivakatirswami wrote:
>
>> I always use extra line breaks in my XML docs and .XHTML docs... for
>> readability.
>>
>> But, if you create an XML Tree from one of these, transform some data
>> in a node and then
>>
>> put revXMLText(tCurrTree) into tNewFile
>>
>> to get that data back out, Rev's XML libraries have wiped out all the
>> cr's.
>>
>> What is interesting is that double cr's are preserved, singles are not
>>
>>
Dr Terry Judd
Lecturer in Educational Technology (Design)
Biomedical Multimedia Unit
Faculty of Medicine, Dentistry & Health Sciences
The University of Melbourne
Parkville VIC 3052
AUSTRALIA

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: preserve vertical white space in XML?

masmit
Well I'll be...how on earth did you find that out?

Mark

On 10 Jul 2005, at 00:45, Terry Judd wrote:

> Actually you can maintain at least some formatting by passing 'true'
> as a(n undocumented)  third parameter to the revXMLText function...
>
> put revXMLText(treeID,,true)
>
> HTH
>
> Terry...

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: preserve vertical white space in XML?

Sivakatirswami
In reply to this post by Terry Judd
Great! that does help... yes, all cr's retained..

thanks

Where is this documented?

skts


On Jul 09, 2005, at 1:45 PM, Terry Judd wrote:

> Actually you can maintain at least some formatting by passing  
> 'true' as a(n undocumented)  third parameter to the revXMLText  
> function...
>
> put revXMLText(treeID,,true)
>
> HTH
>
> Terry...

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: preserve vertical white space in XML?

Terry Judd
In reply to this post by Sivakatirswami

On Sunday, July 10, 2005, at 12:56  PM,
[hidden email] wrote:

> From: Mark Smith <[hidden email]>
> Date: Sun Jul 10, 2005  10:46:37  AM Australia/Melbourne
> To: How to use Revolution <[hidden email]>
> Subject: Re: preserve vertical white space in XML?
> Reply-To: How to use Revolution <[hidden email]>
>
>
> Well I'll be...how on earth did you find that out?
>
> Mark

I think Tuviah 'revealed' that one when I was moaning about having to
implement my own text padding routine a couple of years ago. Makes you
wonder if there are any other undocumented XML 'gems' out there.

Cheers,

Terry...

>
> On 10 Jul 2005, at 00:45, Terry Judd wrote:
>
>> Actually you can maintain at least some formatting by passing 'true'
>> as a(n undocumented)  third parameter to the revXMLText function...
>>
>> put revXMLText(treeID,,true)
>>
>> HTH
>>
>> Terry...

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: preserve vertical white space in XML?

Sivakatirswami
In reply to this post by Ken Ray
Ken... just a thought... you might sell more software if you had a  
full demo that timed out... even if you only gave it 24 hours or 72  
hours...

I generally always want to know what I'm getting. and since the  
standard ediiton of your XML library is locked... I can't see the  
scripts.

skts


On Jul 09, 2005, at 4:33 AM, Ken Ray wrote:

>
>
>> Is there a way to preserve the single cr's in the original? Otherwise
>> I have to a) live with it b) open them in BBEdit and run a format
>> function to get them back to a readable state--each child node on
>> it's own line...
>>
>
> One alternative is to use my Transcript-based XML Library which will
> preserve white space, but the current version works differently  
> than revXML
> (i.e. it works with nodes and children instead of an XPATH). If you're
> interested, check it out...
>
> http://www.sonsothunder.com/products/metacard/xmllib.htm
>
> Ken Ray
> Sons of Thunder Software
> Email: [hidden email]
> Web Site: http://www.sonsothunder.com/
>
>
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: preserve vertical white space in XML?

Ken Ray
> Ken... just a thought... you might sell more software if you had a
> full demo that timed out... even if you only gave it 24 hours or 72
> hours...
>
> I generally always want to know what I'm getting. and since the
> standard ediiton of your XML library is locked... I can't see the
> scripts.

Thanks, I'll consider it... but the library is kind of a "black box", so I
was consdering people only needing access to the scripts if they were
wanting to change the default behavior... but as I'm in the middle of
upgrading the library, I'll think about your suggestion before I release the
next version.

Ken Ray
Sons of Thunder Software
Email: [hidden email]
Web Site: http://www.sonsothunder.com/



_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: preserve vertical white space in XML?

Sivakatirswami
Look forward to it... I've already  put a request in to our software  
acquisitions... you should see a new customer soon.

Since you are working on upgrading...

I would like to see some parameter(s) allow for input and output of  
quotes and apostrophes  that did not "escape" quotes or apostrophes  
(converting to entities).  w3Schools.com says only ampersands and "<"  
are truly "illegal"  and so any xml processor really should escape  
these... and they recommend also quotes, apostrophe's and closing  
tag marker ">" &gt;  also be converted... so, that is what Rev  
does... all five of them. And I don't see a way to turn it off.

Despite the vast changes in character sets and encodings and unicode  
in our modern world.. I'm still a bit old-fashioned. For certain  
things I want the root data to stay really "dumb" i.e. true, original  
ASCII 0-126  and nothing more. This way we don't have to face *any*  
encoding issues where we want the text to be able to flow, like  
water, in the future through a large variety of processors, agents  
and platforms, not all of which will be html entity aware--i.e. bring  
encoding issues to a virtual zero level, and all the time wasted to  
program around them also to virtual zero.  Output agents later can  
make their own decisions about upgrading source data during process  
to curly quotes or apostrophes for a more sophistricated output...  
but I don't want these in the source data...I'm currently using  
xsltproc with shell cmds from Rev...and having to face all this  
because the standard unix libraries being called

libxml 20616, libxslt 10111 and libexslt 809

are so strict...

Then I have to run all these replace "foo" with "bar" in tText" to  
get back to where I want to be....

Then, on the complete opposite side of the spectrum, for in-house  
publishing RAD tools where the XML processes *are* working with a  
goal of more sophisticated outputs, we could really use another  
parameter that handles the entire entity set (whatever that is) such  
that, for example, M-dash gets output to an entity... and further  
more offer a choice for "by name" or by "decimal" i.e. &mdash;  OR  
&#8121;

Now, some of this is out of the box in terms of rigid XML standards,  
but even Adobe has decided to honor verticle white space (char10 or  
char13)  inside child notes on XML import. Such white space, by spec  
of course is to be ignored... but a line break is basic in the word  
processing word... so to wipe these is not helpful... OK I guess  
that's yet another request. to honor char(10) throughout the  
processing in and out.  Just pass it...

Am I making sense? Or asking for too much? Maybe this is all handled  
transparently with Encoding setting at beginning of the doc... (I  
need to go to "Unicode School!")

Sivakatirswami



On Jul 12, 2005, at 2:15 AM, Ken Ray wrote:

>> Ken... just a thought... you might sell more software if you had a
>> full demo that timed out... even if you only gave it 24 hours or 72
>> hours...
>>
>> I generally always want to know what I'm getting. and since the
>> standard ediiton of your XML library is locked... I can't see the
>> scripts.
>>
>
> Thanks, I'll consider it... but the library is kind of a "black  
> box", so I
> was consdering people only needing access to the scripts if they were
> wanting to change the default behavior... but as I'm in the middle of
> upgrading the library, I'll think about your suggestion before I  
> release the
> next version.
>
> Ken Ray
> Sons of Thunder Software
> Email: [hidden email]
> Web Site: http://www.sonsothunder.com/
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: preserve vertical white space in XML?

Terry Judd
In reply to this post by Sivakatirswami
> From: Sivakatirswami <[hidden email]>
> Date: 13 July 2005 3:36:42 PM
> To: How to use Revolution <[hidden email]>
> Subject: Re: preserve vertical white space in XML?
> Reply-To: How to use Revolution <[hidden email]>
>
>
> Look forward to it... I've already  put a request in to our software
> acquisitions... you should see a new customer soon.
>
> Since you are working on upgrading...
>
> I would like to see some parameter(s) allow for input and output of
> quotes and apostrophes  that did not "escape" quotes or apostrophes
> (converting to entities).  w3Schools.com says only ampersands and "<"
> are truly "illegal"  and so any xml processor really should escape
> these... and they recommend also quotes, apostrophe's and closing  tag
> marker ">" &gt;  also be converted... so, that is what Rev does... all
> five of them. And I don't see a way to turn it off.

One of the nice things about Ken's XML library is that it handles CDATA
nodes well, which makes working with html and other 'illegally'
formatted node data very easy. While I use Rev's own XML extensively
it's not great in this regard and while it reads in CDATA OK, its
inability to create and maintain CDATA nodes is a major shortcoming
IMO.

Terry...

Dr Terry Judd
Lecturer in Educational Technology (Design)
Biomedical Multimedia Unit
Faculty of Medicine, Dentistry & Health Sciences
The University of Melbourne
Parkville VIC 3052
AUSTRALIA
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: preserve vertical white space in XML?

Ken Ray
In reply to this post by Sivakatirswami
On 7/13/05 12:36 AM, "Sivakatirswami" <[hidden email]> wrote:

> Look forward to it... I've already  put a request in to our software
> acquisitions... you should see a new customer soon.
>
> Since you are working on upgrading...
>
> I would like to see some parameter(s) allow for input and output of
> quotes and apostrophes  that did not "escape" quotes or apostrophes
> (converting to entities).  w3Schools.com says only ampersands and "<"
> are truly "illegal"  and so any xml processor really should escape
> these... and they recommend also quotes, apostrophe's and closing
> tag marker ">" &gt;  also be converted... so, that is what Rev
> does... all five of them. And I don't see a way to turn it off.

Actually, my XML library doesn't escape anything automatically (at least I
don't *think* so - I'll check)... it will report an error if the XML can't
be parsed properly.

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [hidden email]

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution