Hi 
There is no problem in xsl and svg just assign the schema  like this it will 
work
 

<?xml version="1.0" encoding="ISO-8859-1"?>

<?xmlspysamplexml C:\Documents and Settings\Jagadish 
Pampatwar\Desktop\XSLT\abcd.svg?>

<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>

 

this is svg

<?xml version="1.0"?>

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" 

"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd";>

<svg width="500" height="500" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:noNamespaceSchemaLocation="C:\Documents and Settings\Jagadish 
Pampatwar\Desktop\XSLT\xs1.xsd">

<text>

<tspan x="100" y="100" dx="15">

SVG Text 1

</tspan>

<tspan x="100" y="115">

SVG Text 2 

</tspan>

</text>

</svg>

 

xsd which i have generated

<?xml version="1.0" encoding="UTF-8"?>

<!--W3C Schema generated by XMLSPY v5 rel. 4 U (http://www.xmlspy.com)-->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
elementFormDefault="qualified">

<xs:element name="svg">

<xs:complexType>

<xs:sequence>

<xs:element name="text" type="textType"/>

</xs:sequence>

<xs:attribute name="width" type="xs:short" use="required"/>

<xs:attribute name="height" type="xs:short" use="required"/>

</xs:complexType>

</xs:element>

<xs:complexType name="textType">

<xs:sequence>

<xs:element name="tspan" type="tspanType" maxOccurs="unbounded"/>

</xs:sequence>

</xs:complexType>

<xs:complexType name="tspanType">

<xs:simpleContent>

<xs:extension base="xs:string">

<xs:attribute name="x" type="xs:byte" use="required"/>

<xs:attribute name="y" use="required">

<xs:simpleType>

<xs:restriction base="xs:NMTOKEN">

<xs:enumeration value="100"/>

<xs:enumeration value="115"/>

</xs:restriction>

</xs:simpleType>

</xs:attribute>

<xs:attribute name="dx" type="xs:byte"/>

</xs:extension>

</xs:simpleContent>

</xs:complexType>

</xs:schema>

 

 

 

 

 


Ahmed Salman <[EMAIL PROTECTED]> wrote:
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!

/////////// 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


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



SPONSORED LINKS 
Format Data Svg Computer internet 

---------------------------------
YAHOO! GROUPS LINKS 


    Visit your group "svg-developers" on the web.
  
    To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
  
    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


---------------------------------



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12hfe54fn/M=362131.6882499.7825260.1510227/D=groups/S=1706030389:TM/Y=YAHOO/EXP=1123596911/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