Re: iWork Numbers
Re: iWork Numbers
- Subject: Re: iWork Numbers
- From: Bruce Robertson <email@hidden>
- Date: Mon, 27 Aug 2007 23:16:12 -0700
> On 2007-08-27, at 20:00:13, Bruce Robertson wrote:
>
>> Let's just take the Hawaii Vacation example.
>
>> One of the tables is "Gadgets". It has 12 data rows and is 3 columns
>> wide; plus header. Only six data rows contain data. It begins like this:
>
>> <sf:tabular-model sfa:ID="SFTTableModel-5" sf:name="Gadgets"
>> sf:id="931928960B595C3D00970EA600000000" sf:num-header-rows="1"
>> sf:num-footer-rows="0" sf:num-header-columns="0" sf:name-is-visible="true"
>> sf:grouping-enabled="false"><sf:grid sfa:ID="SFTTableGrid-5" sf:ocnt="33"
>> sf:numcols="3" sf:numrows="13" sf:hiddennumcols="0"
>> sf:hiddennumrows="0"><sf:columns sf:count="3"><sf:grid-column
>> sf:width="98.064529418945312" sf:preferred-width="98.064529418945312"
>> sf:fitting-width="84.245895385742188"/><sf:grid-column
>> sf:width="58.967739105224609" sf:preferred-width="58.967739105224609"
>> sf:fitting-width="41.657913208007812"/><sf:grid-col
>>
>> The unpacked XML for this simple table is 11,000 characters and about 230 XML
>> entitites.
>
>> Let's just take the simple question of adding a new table and just take
>> a fragement of that - how do I assign an ID to my new table?
>
> Hi Bruce,
>
> I haven't this app yet, but normally you'd want to use a .xsl file and a
> utility like xsltproc <x-man-page://xsltproc> or a full-fledged XML editor to
> do the above.
>
> A lot depends on knowing the schema (or DTD) as it defines the file format
> (and perhaps the format of the IDs very precisely).
>
> If for instance, the schema file states that the sfa:ID attribute is
> "xsd:IDREF" then it means the ID has to be unique among the document (or
> indeed a document as it might be a conglomeration of several sub-documents).
> So your .xsl file, as one of the inputs to xsltproc, could parse an existing
> document, create the new table after the last table slot, and generate it's ID
> by the XPath function:
>
> <xsl:value-of select="concat( 'SFTTableModel-', generate-id() )"/>.
>
> or perhaps just create a value one larger than the highest sfa:ID number.
>
> Doing that with PVA[1] may be possible, but isn't practical at all.
>
>
>
> Philip Aker
> email@hidden
>
>
> [1] Pure Virgin AppleScript
Thanks. I didn't figure PVA would work but I also didn't think we knew
enough yet about the document format to do anything practical. So far looks
like that's the case.
By the way, what's all the ls and sf and sfa stuff?
<?xml version="1.0"?>
<ls:document xmlns:sfa="http://developer.apple.com/namespaces/sfa"
xmlns:sf="http://developer.apple.com/namespaces/sf"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ls="http://developer.apple.com/namespaces/ls"
ls:version="72007061400" sfa:ID="LSDocumentModel-0"
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden