MACSCRPT Archives

June 2007

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Walter Ian Kaye <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 6 Jun 2007 07:36:53 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (42 lines)
At 11:13 a +0200 06/06/2007, Andreas Kiel didst inscribe upon an 
electronic papyrus:

>Content-Transfer-Encoding: 7bit
>Content-Type: text/plain;
>	charset=US-ASCII;
>	delsp=yes;
>	format=flowed
>
>Hi all,
>
>I'm still (or better again) struggling a bit with XMLlib.
>But that's really not the fault of the Satimage people, since the 
>XMLs I've to work with don't follow the specs as they should - at 
>least as far as I see.
>
>Maybe somebody got a tip for me how to handle the things below (I've 
>attached a file, if that works with the list).

It does not. :)

>If I check values using XMLGetText I will get ascii character 13 
>plus  whatever number of tabs if the value is empty - since the XML 
>uses  ascii 13 for new line and tabs for indent.
>If I modify a value and save the XML all "empty" values will be 
>nailed to: ascii character 13 plus whatever number of tabs. And so 
>the XML is useless to bring it back to the original application.
>
>Any way to modify the XML upfront in a fast way so that this won't  happen?
>If there would be a fast way to remove the indents first and then 
>remove all values which are exactly ascii 13 that would be the most 
>convient.

I'm sure a Perl script could fix the file. Maybe something like this:

s/(<([A-Za-z0-9:]+)>)(\015\009+)/\1<\/\2>\3/g;

...but that is off the top of my very tired brain and is probably wrong. :)


-boo

ATOM RSS1 RSS2