Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 15th, 2006, 06:06 PM
Registered User
 
Join Date: Feb 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default XML to SVG with XSLT

Hi!

I´m trying to transform a xml-file to svg:

My XML:
 
Quote:
quote:
Quote:
<?xml version="1.0" encoding="ISO-8859-1"?>
      <?xml-stylesheet version="1.0" href="kreise.xsl" type="text/xsl"?>

      <kreise>

        <kreis>
          <mittelpunkt_x>100</mittelpunkt_x>
          <mittelpunkt_y>150</mittelpunkt_y>
          <radius>50</radius>
          <farbe>red</farbe>
        </kreis>

        <kreis>
          <mittelpunkt_x>300</mittelpunkt_x>
          <mittelpunkt_y>250</mittelpunkt_y>
          <radius>70</radius>
          <farbe>blue</farbe>
        </kreis>

      </kreise>
And here is my xsl:
 
Quote:
quote:
Quote:

  <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"
doctype-public="-//W3C//DTD SVG 1.0//EN"
doctype-system=
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"/>

      <xsl:template match="/">

      <svg>

      <text x="20" y="20">Dieses SVG-Dokument wurde mittels XSLT
        aus einem XML-Dokument generiert.</text>

      <xsl:for-each select="kreise/kreis">
      <circle>

      <xsl:attribute name="cx">
        <xsl:value-of select="mittelpunkt_x" />
      </xsl:attribute>

      <xsl:attribute name="cy">
        <xsl:value-of select="mittelpunkt_y" />
      </xsl:attribute>

      <xsl:attribute name="r">
        <xsl:value-of select="radius" />
      </xsl:attribute>

      <xsl:attribute name="fill">
        <xsl:value-of select="farbe" />
      </xsl:attribute>

      </circle>
      </xsl:for-each>


      </svg>

      </xsl:template>
      </xsl:stylesheet>
Can anyone tell me, why my IE6 can´t show me the kreis.svg ??

Thanx!
AJ


Reply With Quote
  #2 (permalink)  
Old February 15th, 2006, 06:30 PM
mhkay's Avatar
Wrox Author
Points: 18,481, Level: 59
Points: 18,481, Level: 59 Points: 18,481, Level: 59 Points: 18,481, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,960
Thanks: 0
Thanked 292 Times in 287 Posts
Default

This is like one of those questions that goes: a farmer has three daughters, ...[lots of details of the ages of the daughters]... and ends "does the farmer have a dog?"

Because the problem, as far as I can see, is nothing to do with the details of your source XML or your XSLT code, it's all to do with the capabilities and configuration of IE and its plugins. (Which is not something I can help you with.)

You didn't actually tell us whether you were running the transformation in the browser.

It would also be useful to know whether you can successfully display HTML pages that contain directly-embedded SVGs.



Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote
  #3 (permalink)  
Old February 15th, 2006, 07:26 PM
Registered User
 
Join Date: Feb 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanx for your reply.

I´m using IE6 and the SVG Plugin 3.03. I can view an svg-file embedded in HTML. My Problem is, how can I view the transformed xml-file ? I know, I have to save that transformed xml-file as SVG, but I can´t see anything in IE.
Viewing the saved svg-code, there is only the xml-code !!??
Why does my msxml6.0 (!) can´t transform the xml-file ??

Thanx !
AJ

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
xml and xsl templates as input to xslt gives xml rameshnarayan XSLT 5 August 3rd, 2005 01:58 AM
XSLT read through XML to transform another XML dendenx2 XSLT 8 July 7th, 2005 08:18 PM
XSLT for complicated xml to xml transf. required doug@sirvisetti XSLT 3 June 17th, 2005 04:26 PM
merge two xml file and make new xml using xslt ketan XSLT 0 September 21st, 2004 08:48 AM
Merge XML files into a xml file using xslt lxu XML 4 November 6th, 2003 06:01 PM



All times are GMT -4. The time now is 10:57 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.