Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] XSLT/SVG variables question

From: "Michael Kay" <michael.h.kay@------------>
To:
Date: 7/1/2002 1:20:00 AM
Since your data already seems to be grouped correctly, this shouldn't be
too difficult. You need to write a function that computes the dimensions
of RectA1 based on the contents of the first BlockA element. It's hard
to give you the code for this because you haven't said anything about
the algorithm you want to use. But the key to it is to think in terms of
functions: how can you express the size of the rectangle as a function
of its textual contents? For example, is it as simple as saying that the
width of the rectangle is X times the number of characters in the
longest line, and the height is Y times the number of lines?

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Harry J. Foxwell
> Sent: 30 June 2002 22:31
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] XSLT/SVG variables question
> 
> 
> 
> I'm not quite convinced of 'Assignment Considered
> Harmful' (Kay, Chap 9) since I can't figure out how to solve 
> my XSLT/SVG problem without good ol' x=x+y constructs.
> 
> My general problem is to create SVG rectangles with text
> inside (line numbers included for reference) using XML data and XSLT:
> 
> 01
> 02   RectA1                  RectA2
> 03   +--------------+        +--------------+
> 04   | string-A1a   |        | string-A2a   |
> 05   | string-A1b   +--------+ string-A2b   |
> 06   | ...          |        | string-A2c   |
> 07   +------+-------+        | ...          |
> 08          |                +--------------+
> 09          |
> 10          |
> 11          |
> 12   RectB1 |
> 13   +------+-------+
> 14   | string-B1a   |
> 15   | string-B1b   |
> 16   | ...          |
> 17   +--------------+
> 
> My XML data generically look something like this:
> 
>         <BlockA>
>         <string>string-A1a</string>
>         <string>string-A1b</string>
>         ...
>         </BlockA>
>         <BlockA>
>         <string>string-A2a</string>
>         <string>string-A2b</string>
>         <string>string-A2c</string>
>         ...
>         </BlockA>
>         <BlockB>
>         <string>string-B1a</string>
>         <string>string-B1b</string>
>         ...
>         </BlockB>
>         ...
> 
> As the block chart is built, I need to account for arbitrary 
> number of strings per block and number of blocks.  "Normal" 
> variables would let me compute and increment SVG coordinates 
> for the rectangles and text.  But XSLT variables aren't normal!
> 
> If you have any suggestions about how I should track the 
> coordinates, or better yet an example, that would be helpful.
> 
> Thanks!
> Harry Foxwell
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent