XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
- Stylus Studio Technical Forum (14621)
-> + What Pipeline standard do you ... (4)
-> + How can i increase sylus memor... (2)
-> - Tutorial & Tech support needed (1)
-> + Generate HTML Documentation fr... (3)
-> + Use of saxonsa outside stylus ... (2)
-> + Schema to DTD (6)
-> + Trial version requires interne... (4)
-> - APACHE FOP text box (1)
-> + Cannot create SQL Server datas... (11)
-> + StylusValidator Crashes (2)
-> + XML diff with optimize Change ... (2)
-> + how do I get the .xsl page to ... (3)
-> + Can't Use WYSIWYG from the Fil... (6)
-> + EDI Help (2)
-> + XInclude support (3)
-> + Editor options and customized ... (3)
-> + Licensed version connectes to ... (6)
-> + handling abstract types in the... (5)
-> + XML not validating against its... (4)
-> + SS gets into state where the "... (6)
-> + Download Link from Order email... (2)
-> + Stylus Studio doesn't run (2)
-> + Indent XML Tags uses pretty sh... (2)
-> + Some questions on supported pl... (3)
-> + Apache FOP Border (2)
-> + line numbers, line-wrap.. (11)
-> + Not Able to Load Siebel Web Se... (3)
-> + XSLT node or nodeset as scenar... (4)
-> - tree view parsing error: Expec... (1)
-> + reactivating the license key f... (2)
-> + XSL FO region-body border (2)
-> + WhiteSpace facet default (2)
-> - Web Service Call (1)
-> + DB to XML convertion (6)
-> + Converting: How to handle data... (2)
-> + Toss Character Exception (2)
-> + EDI conversion COM segment (5)
-> - SS passing invalid CALS table ... (1)
-> + Carrier Related EDI SAP questi... (2)
-> + How to generate 1 output XML f... (2)
-> + Urgent Eval: How2 w/ Possibly ... (4)
-> + Preview Problems (7)
-> + Mapping to EDIFACT ORDERS UNT0... (8)
-> + Deploying Conversion XML to ED... (2)
-> + Use EDI Adapter within Sap BC (3)
-> + Uninstall->instal entepr. 2007 (2)
-> - xml data to sql 2000 table (1)
-> - Convert from Oracle DB to XML ... (1)
-> + NTFShardlink broken (5)
-> + Can't get catalog to work (3)
-> + Only One of each EDI segment g... (3)
-> + convert (2)
-> + convert (4)
-> + EDIFACT to XSD problem (3)
-> + quark xpress tags (2)
-> + Duplicating nodes allows to cr... (2)
-> + Duplicated, unused nodes are r... (3)
-> + Converting to XML from a varie... (5)
-> + xsd:import's with escaped char... (8)
-> + Viewing the FO Sample Applicat... (3)
-> + Stylus Studio - Window tiling (3)
-> + Question about XML->Java Objec... (2)
-> + SVG web-based editor (2)
-> + conversion process for the pdf... (2)
-> + GUI Mapper does not create pro... (4)
-> + JavaScript working inside prev... (4)
-> + Stylus Studio Crashes when I a... (4)
-> + SVG ImageReader for FOP (2)
-> + Web Service Call Using HTTPS (8)
-> + Meditech database (2)
-> + How to connect to Informix (5)
-> + long filenames in Berkeley XML... (3)
-> + Opening multiple documents = m... (3)
-> + MySQL Connectivity (2)
-> + using .xsd to create forms (3)
-> + Convert-to-XML Engine could no... (2)
-> + editor questions (2)
-> + Cannot connect to SQL server (7)
-> + Convert Cobol file to XML (2)
-> + XML Diff problem (4)
-> + running XSLT - time + memory m... (7)
-> + New wsdl creation (4)
-> + DB to XML Parameters (2)
-> + Help (html in xml) need to out... (8)
-> + Stylesheet questions (2)
-> + Verion 1.0 XPATH for testing "... (5)
-> + Berkely XML DB file system (2)
-> + WYSIWYG in 2007 demo (2)
-> + EDIFACT code list problem (3)
-> + XQuery over a Berkeley XML DB ... (3)
-> + Href and display linked ref. (2)
-> + How my applications can gener... (11)
-> + CLASSPATH (2)
-> + Fixed order of attributes (2)
-> + merging XML files (13)
-> - The Struzzo.exe hung with no G... (1)
-> + Problem Registering Old Versio... (4)
-> - CHART.XML + CHART.XSL to CHART... (17)
-> ->CHART.XML + CHART.XSL to ...
-> ->CHART.XML + CHART.XSL to ...
-> ->CHART.XML + CHART.XSL to ...
-> ->CHART.XML + CHART.XSL to ...
-> ->CHART.XML + CHART.XSL to ...
-> ->CHART.XML + CHART.XSL to ...
-> ->Re: CHART.XML + CHART.XSL...
-> ->Re: CHART.XML + CHART.XSL...
-> ->Re: CHART.XML + CHART.XSL...
-> ->Re: CHART.XML + CHART.XSL...
-> ->Re: CHART.XML + CHART.XSL...
-> ->Re: CHART.XML + CHART.XSL...
-> ->Re: CHART.XML + CHART.XSL...
-> ->Re: CHART.XML + CHART.XSL...
-> ->Re: CHART.XML + CHART.XSL...
-> ->Re: CHART.XML + CHART.XSL...
-> + Aplication not loading (6)
-> + Can Stylus Studio be used to s... (2)
-- Previous [1801-1820] [1821-1840] [1841-1860] Next
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Glenn MeadowsSubject: CHART.XML + CHART.XSL to CHART.SVG ?
Author: Glenn Meadows
Date: 24 Oct 2006 01:02 PM
Hello,

From the SS Examples\SVG directory.

I have a CHART.XML and a CHART.XSL.

I need to create a CHART.SVG on the fly using ASP.NET.

Can someone offer any guidance ?

Thanks,
- Glenn




Postnext
Glenn MeadowsSubject: CHART.XML + CHART.XSL to CHART.SVG ?
Author: Glenn Meadows
Date: 24 Oct 2006 08:38 PM
...append this to original post

I have used the attached ASP.NET file which delivers SVG output to the browser in text format and not as a graphic.

The ASP.NET file transforms the CHART.XML file using the CHART.XSL file.

Any ideas on why I am getting text to the browser in lieu of the expected graphic image, would be appreciated.

thanks,
- Glenn


Unknownchart.xml
CHART.XML

Unknownchart.xsl
CHART.XSL

Postnext
Glenn MeadowsSubject: CHART.XML + CHART.XSL to CHART.SVG ?
Author: Glenn Meadows
Date: 24 Oct 2006 08:41 PM
...please refer to previous post as the upload of my asp.net file was not successful.


UnknownDefault.aspx
ASP.NET

Postnext
Glenn MeadowsSubject: CHART.XML + CHART.XSL to CHART.SVG ?
Author: Glenn Meadows
Date: 24 Oct 2006 08:45 PM
...please refer to previous post

The ASP.NET page did not show up as an attachment, so here it is...

//ASP.NET file to transform chart.xml with chart.xsl
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Xml.Xsl" %>
<%@ Import Namespace="System.Xml.XPath" %>

<script runat="server">
void Page_Load(object sender, System.EventArgs e)
{
string xmlPath = Request.PhysicalApplicationPath + @"\App_Data\chart.xml";
string xslPath = Request.PhysicalApplicationPath + @"\App_Data\chart.xsl";
XPathDocument xpathDoc = new XPathDocument(xmlPath);
XslCompiledTransform transform = new XslCompiledTransform();
//Load the XSL stylsheet into the XslCompiledTransform object
transform.Load(xslPath);
transform.Transform(xpathDoc, null, Response.Output);
}
</script>

Postnext
Glenn MeadowsSubject: CHART.XML + CHART.XSL to CHART.SVG ?
Author: Glenn Meadows
Date: 24 Oct 2006 08:52 PM
... again, see the previous post

The browser posts the following text to the browser and not the graphic??

Any thoughts appreciated...

<?xml version="1.0" encoding="utf-8" ?>
- <svg width="800" height="500" viewBox="0 0 600 100" xmlns="http://www.w3.org/2000/svg">
- <g transform="translate(-10,-120)">
<text style="font-size:18" x="20" y="5">Sales Figures by Region</text>
- <g style="stroke-width:2; stroke:black">
<path d="M 40 230 L 40 10 L 40 230 L 200 230 Z" />
</g>
- <g style="text-anchor:end; font-size:9">
<text x="36" y="203">10</text>
<text x="36" y="183">20</text>
<text x="36" y="163">30</text>
<text x="36" y="143">40</text>
<text x="36" y="123">50</text>
<text x="36" y="103">60</text>
<text x="36" y="83">70</text>
<text x="36" y="63">80</text>
<text x="36" y="43">90</text>
<text x="36" y="23">100</text>
</g>
<path style="stroke-width:2; stroke:black; fill: red" d="M 50 230 L 50 65 L 70 65 L 70 230 Z" />
<text style="text-anchor:middle" x="60" y="245">NE</text>
<path style="stroke-width:2; stroke:black; fill: gray" d="M 80 230 L 80 180 L 100 180 L 100 230 Z" />
<text style="text-anchor:middle" x="90" y="245">NW</text>
<path style="stroke-width:2; stroke:black; fill: purple" d="M 110 230 L 110 130 L 130 130 L 130 230 Z" />
<text style="text-anchor:middle" x="120" y="245">SE</text>
<path style="stroke-width:2; stroke:black; fill: blue" d="M 140 230 L 140 130 L 160 130 L 160 230 Z" />
<text style="text-anchor:middle" x="150" y="245">SW</text>
<path style="stroke-width:2; stroke:black; fill: green" d="M 170 230 L 170 155 L 190 155 L 190 230 Z" />
<text style="text-anchor:middle" x="180" y="245">Other</text>
</g>
</svg>

Postnext
Ivan PedruzziSubject: CHART.XML + CHART.XSL to CHART.SVG ?
Author: Ivan Pedruzzi
Date: 24 Oct 2006 10:14 PM
Hi Glenn,

IE doesn't understand SVG unless you install a SVG viewer like the one from Adobe http://www.adobe.com/svg. Unfortunately Adobe is planning to end support for its player January 1, 2008 leaving IE users out to the cold.

Other browsers like FireFox and Opera have built-in support for SVG
http://www.mozilla.com
http://www.opera.com


Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Postnext
Glenn MeadowsSubject: CHART.XML + CHART.XSL to CHART.SVG ?
Author: Glenn Meadows
Date: 25 Oct 2006 07:38 AM
Hi Ivan,

I already have Adobe's SVG viewer installed. If I cut and paste what the browser is displaying as text and save it as an SVG file, I can then view the file in my browser with the graphics being displayed.

I am quite puzzled on this one.

Thanks for your help. I will try to be creative but any additional thoughts on this would be appreciated.

- Glenn

Postnext
(Deleted User) Subject: Re: CHART.XML + CHART.XSL to CHART.SVG ?
Author: (Deleted User)
Date: 25 Oct 2006 07:58 AM
Hi Glenn,
you should try specifying the MIME type of image/svg+xml, e.g. adding

<%@ Page contentType="image/svg+xml"%>

at the beginning of your .aspx page.

Hope this helps,
Alberto

Postnext
Glenn MeadowsSubject: Re: CHART.XML + CHART.XSL to CHART.SVG ?
Author: Glenn Meadows
Date: 25 Oct 2006 08:16 AM
Hi Ivan,

My aspx file can only accept one Page directive and it currently has
<%@ Page Language="C#" %>

If I add <%@ Page contentType="image/svg+xml"%>,below the line
<%@ Page Language="C#" %>, it complains that my aspx file can only have one page directive.

If I add the contentType as an attribute to the Page directive as
<%@ Page Language="C#" contentType="image/svg+xml"%>, my aspx file does not complain but does not display anything in the browser only to show a blank screen.

Thank you for your help.
- Glenn

Postnext
(Deleted User) Subject: Re: CHART.XML + CHART.XSL to CHART.SVG ?
Author: (Deleted User)
Date: 25 Oct 2006 09:08 AM
Hi Glenn,
you can try adding the command

Response.AddHeader("Content-Type","image/svg+xml")

inside the Page_Load method. Have a look at this article http://www.15seconds.com/issue/030630.htm for more informations.

Hope this helps,
Alberto

Postnext
Glenn MeadowsSubject: Re: CHART.XML + CHART.XSL to CHART.SVG ?
Author: Glenn Meadows
Date: 25 Oct 2006 11:13 AM
Hi Alberto,

I placed the line you suggested into my Page_Load method as the first line of code being

Response.AddHeader("Content-Type","image/svg+xml");

This time I received a blank screen in the browser in lieu of the svg text output. If I put both the chart.xml and chart.xsl into SS and run them, I get the desired graphical results in the output method.

In my aspx file shown here, I think the Response.Output param in my transform method is outputting text and not the expected svg graphic.

// ASP.NET FILE
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Xml.Xsl" %>
<%@ Import Namespace="System.Xml.XPath" %>

<script runat="server">
void Page_Load(object sender, System.EventArgs e)
{
Response.AddHeader("Content-Type", "image/svg+xml");

string xmlPath = Request.PhysicalApplicationPath + @"datum.xml";
string xslPath = Request.PhysicalApplicationPath + @"datum.xsl";
XPathDocument xpathDoc = new XPathDocument(xmlPath);
XslCompiledTransform transform = new XslCompiledTransform();
//Load the XSL stylsheet into the XslCompiledTransform object
transform.Load(xslPath);
transform.Transform(xpathDoc, null, Response.Output);
}
</script>

Any thoughts,
- Glenn

Postnext
Ivan PedruzziSubject: Re: CHART.XML + CHART.XSL to CHART.SVG ?
Author: Ivan Pedruzzi
Date: 25 Oct 2006 12:17 PM
Glenn,

You have to add the image/svg+xml mime types to you web server and stop re-start the server

See the attached screenshot


Ivan Pedruzzi
Stylus Studio Team


Imagemimetype.png

Postnext
Glenn MeadowsSubject: Re: CHART.XML + CHART.XSL to CHART.SVG ?
Author: Glenn Meadows
Date: 25 Oct 2006 01:00 PM
Hi Ivan,

I have added the mime type to my IIS web server with *.svg being associated with image/svg+xml and I still receive a blank screen after restarting my web server.

My ASP.NET, XSL and XML files have not changed.

Thanks,
- Glenn

Postnext
Tony LavinioSubject: Re: CHART.XML + CHART.XSL to CHART.SVG ?
Author: Tony Lavinio
Date: 25 Oct 2006 02:42 PM
Did you try doing a 'View Source' to see if the output actually
came as you expected? Then at least you can narrow the problem
down to a MIME-type one.

Postnext
Glenn MeadowsSubject: Re: CHART.XML + CHART.XSL to CHART.SVG ?
Author: Glenn Meadows
Date: 25 Oct 2006 02:51 PM
Hi Ivan,

I have found that if I strip out all of the white spaces from the SVG text that is displayed to the browser and then I cut and paste this text to a SVG file, the graphic is then correctly displayed in the browser when I do a File->Open from IE.

I guess I need to find a way to strip white spaces out on the fly...

- Glenn

Postnext
Glenn MeadowsSubject: Re: CHART.XML + CHART.XSL to CHART.SVG ?
Author: Glenn Meadows
Date: 25 Oct 2006 03:20 PM
Thanks to the SS team for help on this.

I think that I have exhausted looking at all possible solutions.

I will now attempt to take my SVG file generated by my SVG editor and use the file as a template where I will use the XML DOM to generate the output I need.

Certainly if anyone has any further ideas on how to solve the aspx solution, I would love to hear from you.

Kind Regards,
- Glenn

Posttop
Glenn MeadowsSubject: Re: CHART.XML + CHART.XSL to CHART.SVG ?
Author: Glenn Meadows
Date: 25 Oct 2006 09:28 PM
Originally Posted: 25 Oct 2006 09:29 PM
Hi Ivan and Alberto,

Success at last. My problem was that my height, width and viewbox attributes of my svg element did not have the correct size to see the graphics.

It always ends up being something simple.

Thank you both for your help on this today. I truly appreciate it.

- Glenn

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.