XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 22nd, 2004, 10:02 AM
David C David C is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 3 David C User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question XSLT: Possible To Add X,Y Space If Additional XML Data Exists?

Back, again!

My query this time: In my XSLT, I am requesting data from my XML source files if it exists within specific elements and stating that if it does, stream and transform this data into an SVG at these given X,Y coordinates in my viewbox. To date, I have found nothing in either XSLT or SVG specifications that would allow for a flexible flow of data...all data seems to be etched in stone based on these X,Y coordinates. Am I wrong on this matter? Are X,Y coordinates more flexible than I have discovered? Please tell me "Yes"!

In my particular situation, I have flowchart logic-test's (my source XML files) which may contain any number of <step><para><pcnarr>'s (<pcnarr> being the only element which may contain PCDATA). These I have accommodated to flow into my XSLT transformed SVG as such:

Code:
SOURCE XSLT:

<xsl:template match="logic-test">
  <svg width="100%" height="100%">		
    <g>
      <xsl:for-each select="descendant-or-self::step">
        <xsl:if test="position()=1 and not(para/null)">
          <text x="10" y="75" style="text-anchor: start; font-size: 8pt;">
            <xsl:number format="1. " level="single"/>
              <xsl:value-of select="para/pcnarr"/>
          </text>
        </xsl:if>

        <xsl:if test="position()=2 and not(para/null)">
          <text x="10" y="90" style="text-anchor: start; font-size: 8pt;">
            <xsl:number format="1. " level="single"/>
              <xsl:value-of select="para/pcnarr"/>
          </text>
        </xsl:if>

        <xsl:if test="position()=3 and not(para/null)">
          <text x="10" y="105" style="text-anchor: start; font-size: 8pt;">
            <xsl:number format="1. " level="single"/>
              <xsl:value-of select="para/pcnarr"/>
          </text>
        </xsl:if>

        <xsl:if test="position()=4 and not(para/null)">
          <text x="10" y="105" style="text-anchor: start; font-size: 8pt;">
            <xsl:number format="1. " level="single"/>
              <xsl:value-of select="para/pcnarr"/>
          </text>
        </xsl:if>
<!-- A TABLE EXISTS HERE WITH 4 ROWS -->
        <xsl:if test="position()=5 and not(para/null)">
          <text x="10" y="105" style="text-anchor: start; font-size: 8pt;">
            <xsl:number format="1. " level="single"/>
              <xsl:value-of select="para/pcnarr"/>
          </text>
        </xsl:if>
<!-- A TABLE EXISTS HERE WITH 8 ROWS -->
      </xsl:for-each>
    </g>
    <xsl:apply-templates/>
  </svg>
</xsl:template>


My problem exists in that at any given time, these <step><para><pcnarr>'s may also include <table>'s between them, which in themselves may also contain any number of <row><entry><pcnarr>'s. Given the following <table>:

Code:
SOURCE XML:

<table frame="none" id=" ">
  <title><null/></title>
    <tgroup cols="2">
      <colspec align="right" colwidth="1.25in"/>
      <colspec align="left" colwidth="1.00in"/>
    <tbody>
      <row id="T00002-TS-11-5820-890-30-327">
        <entry align="right"><pcnarr>MODE:</pcnarr></entry>
        <entry align="left"><pcnarr>MTRS</pcnarr></entry>
      </row>
      <row id="T00002-TS-11-5820-890-30-328">
        <entry align="right"><pcnarr>SELECT:</pcnarr></entry>
        <entry align="left"><pcnarr>DMM</pcnarr></entry>
      </row>
      <row id="T00002-TS-11-5820-890-30-329">
        <entry align="right"><pcnarr>FUNCTION:</pcnarr></entry>
        <entry align="left"><pcnarr>DCV</pcnarr></entry>
      </row>
      <row id="T00002-TS-11-5820-890-30-330">
        <entry align="right"><pcnarr>RANGE:</pcnarr></entry>
        <entry align="left"><pcnarr>200 V</pcnarr></entry>
      </row>
    </tbody>
    </tgroup>
</table>


...and that this <table> falls after step #4 (having 4 rows) and that another similar <table> exists after step #5, is it at all possible to create some sort of a formula/counter/whatever which will be able to read the XML source file; determine that these <table>'s exist; and not only stream this tabulated data into the SVG, but provide the additional horizontal "Y" space necessary to accomodate however many <row><pcnarr>'s exist?

Or is this all just pushing the XSLT/SVG specifications too far? Perhaps possible with the assistance of JavaScript? If so...how?

Any help on this issue would be geatly appreciated.

David

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XSLT: Possible To Add X,Y Space If Additional XML Data Exists?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT