Ahmed Salman schrieb:

> Hi!
>
> I am running a very very simple style sheet on an empty svg file. I am
> not able to understand why its not matching the svg root element. I
> spent many hours and run the same code on different parsers including
> XML Spy, Oracle XML Parser, Oxygen. But svg element never matches.
> XSLT should display "I am svg". It seems that I am doing a very basic
> mistake. Pease help!


Hi Salman
i havent tested your example, but i would strongly recomment to use 
namespaces !(and no doctype)
so your svg file looks like this:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="C:\Program Files\Apache
Group\Apache2\htdocs\text\tspan1.xsl"?>

<svg width="500" height="500" xmlns="http://www.w3.org/2000/svg";>
               <text>
            <tspan x="100" y="100" dx="15">
                  SVG Text 1
            </tspan>
            <tspan x="100" y="115">
                  SVG Text 2           
                                </tspan>
      </text>
</svg>

and also in your XSLT stylesheet use namespaces !!

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:svg="http://www.w3.org/2000/svg";
xmlns="http://www.w3.org/2000/svg";
 >

      <xsl:template match="/">
            <xsl:apply-templates select="svg:svg"/>      
      </xsl:template>
     
      <xsl:template match="svg:svg">
            <!--there should be no text before your root element -->
            <svg width="100%" height="100%" viewBox="0 0 100 100"
preserveAspectRatio="none">
                  <xsl:apply-templates /> <!-- there are no other 
templates -->
<!-- you might want somthing like xsl:copy-of select="svg:*"
            </svg>
      </xsl:template>

</xsl:stylesheet>

here are my experiments on SVG and XSLT :
http://www.treebuilder.de/svg/extentSVG/artikel/tut.html
http://www.treebuilder.de/svg/extentSVG/documentation.html

hope it helps
Holger

>
> /////////// SVG FILE////////////////////////////
>
> <?xml version="1.0"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
>   "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd";>
> <?xml-stylesheet type="text/xsl" href="C:\Program Files\Apache
> Group\Apache2\htdocs\text\tspan1.xsl"?>
>
> <svg width="500" height="500">
>                <text>
>             <tspan x="100" y="100" dx="15">
>                   SVG Text 1
>             </tspan>
>             <tspan x="100" y="115">
>                   SVG Text 2           
>                                 </tspan>
>       </text>
> </svg>
>
>
> ///////////////// STYLE SHEET ///////////////////
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>             <xsl:output indent="yes" omit-xml-declaration="no"
> doctype-system="http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd";
> doctype-public="-//W3C//DTD SVG 20010904//EN" method="xml"/>
>      
>      
>       <xsl:template match="/">
>             <xsl:apply-templates select="svg"/>      
>       </xsl:template>
>      
>       <xsl:template match="svg">
>             I am svg!
>            
>             <svg width="100%" height="100%" viewBox="0 0 100 100"
> preserveAspectRatio="none">
>                   <xsl:apply-templates />
>             </svg>
>       </xsl:template>
>
> </xsl:stylesheet>
>
>
>
> Thanks,
> Salmi
>



------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12h3t1tr0/M=362131.6882499.7825260.1510227/D=groups/S=1706030389:TM/Y=YAHOO/EXP=1123605738/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life 
- brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~-> 

-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to