tkormann 01/10/12 08:25:00 Modified: samples/tests defs.svg Added: samples/tests useStylingURI.svg Log: Add a new test for use element (external or internal) that illustrates CSS properties inheritance and URIs resolver. This test works with batik 1.1rc2 and fails with the current CVS code base. After some investigation, URIResolver seems to be the guilty !!! Revision Changes Path 1.2 +30 -1 xml-batik/samples/tests/defs.svg Index: defs.svg =================================================================== RCS file: /home/cvs/xml-batik/samples/tests/defs.svg,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- defs.svg 2001/10/12 08:52:51 1.1 +++ defs.svg 2001/10/12 15:25:00 1.2 @@ -14,7 +14,7 @@ <!-- Test description here --> <!-- --> <!-- @author [EMAIL PROTECTED] --> -<!-- @version $Id: defs.svg,v 1.1 2001/10/12 08:52:51 tkormann Exp $ --> +<!-- @version $Id: defs.svg,v 1.2 2001/10/12 15:25:00 tkormann Exp $ --> <!-- ========================================================================= --> <?xml-stylesheet type="text/css" href="test.css" ?> @@ -26,6 +26,8 @@ <defs> <!-- ###################################################################### --> +<!-- used by externalPaints.svg --> +<!-- ###################################################################### --> <linearGradient id="linearSimpleReference" x1=".5" y1="0" x2=".5" y2="1"> <stop style="stop-color:blue" offset="0" /> <stop style="stop-color:white" offset=".5" /> @@ -72,6 +74,33 @@ patternContentUnits="userSpaceOnUse" patternUnits="userSpaceOnUse" patternTransform="rotate(45)" xlink:href="defs2.svg#pattern" /> + +<!-- ###################################################################### --> +<!-- useStyling.svg --> +<!-- ###################################################################### --> + + <radialGradient id="extGrad1"> + <stop style="stop-color:gold" offset="0" /> + <stop style="stop-color:crimson" offset="1" /> + </radialGradient> + + <radialGradient id="extGrad2"> + <stop style="stop-color:white" offset="0" /> + <stop style="stop-color:black" offset="1" /> + </radialGradient> + + <radialGradient id="extGrad3"> + <stop style="stop-color:gold" offset="0" /> + <stop style="stop-color:green" offset="1" /> + </radialGradient> + +<g> + <circle id="extE" cx="25" cy="25" r="20" /> + + <circle id="extE1" cx="25" cy="25" r="20" style="fill:url(#extGrad1)" /> + + <circle id="extE2" cx="25" cy="25" r="20" style="fill:url(useStylingURI.svg#grad1)" /> +</g> </defs> 1.1 xml-batik/samples/tests/useStylingURI.svg Index: useStylingURI.svg =================================================================== <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> <!-- ========================================================================= --> <!-- Copyright (C) The Apache Software Foundation. All rights reserved. --> <!-- --> <!-- This software is published under the terms of the Apache Software License --> <!-- version 1.1, a copy of which has been included with this distribution in --> <!-- the LICENSE file. --> <!-- ========================================================================= --> <!-- ========================================================================= --> <!-- Test use and styling --> <!-- --> <!-- @author [EMAIL PROTECTED] --> <!-- @version $Id: useStylingURI.svg,v 1.1 2001/10/12 15:25:00 tkormann Exp $ --> <!-- ========================================================================= --> <?xml-stylesheet type="text/css" href="test.css" ?> <svg width="450" height="500" viewBox="0 0 450 500"> <title>Test use and styling using URIs</title> <!-- ============================================================= --> <!-- Test content --> <!-- ============================================================= --> <g id="testContent" transform="translate(0 -40)"> <text x="225" y="60" class="title"><use> and styling using URIs</text> <text x="225" y="80" style="text-anchor:middle; font-size:12; font-style:italic">This file is using the defs.svg file to get the external resources</text> <g font-size="10"> <text x="20" y="496">- linearGradient defined in this file (local)</text> <text x="20" y="508">- radialGradient defined in defs.svg (external)</text> <text x="20" y="520">- gold/crimson: gradient on <rect>, white/black: gradient on <use></text> <text x="26" y="532">yellow/green: inherited from <g></text> </g> <!-- ############################### --> <g id="board" style="fill:none; stroke:black;"> <g style="fill:#eee"> <rect x="75" y="100" width="150" height="20" /> <rect x="225" y="100" width="150" height="20" /> <rect x="35" y="120" width="20" height="120" /> <rect x="35" y="240" width="20" height="120" /> <rect x="35" y="360" width="20" height="120" /> </g> <g style="fill:#ccc"> <rect x="55" y="120" width="20" height="60" /> <rect x="55" y="180" width="20" height="60" /> <rect x="55" y="240" width="20" height="60" /> <rect x="55" y="300" width="20" height="60" /> <rect x="55" y="360" width="20" height="60" /> <rect x="55" y="420" width="20" height="60" /> </g> <rect x="75" y="120" width="150" height="360" /> <rect x="225" y="120" width="150" height="360" /> <line x1="75" y1="180" x2="375" y2="180" /> <line x1="75" y1="240" x2="375" y2="240" /> <line x1="75" y1="300" x2="375" y2="300" /> <line x1="75" y1="360" x2="375" y2="360" /> <line x1="75" y1="420" x2="375" y2="420" /> <line x1="75" y1="480" x2="375" y2="480" /> <g style="font-size:12; text-anchor:middle; fill:black; stroke:none"> <text x="150" y="114">Local <use></text> <text x="300" y="114">External <use></text> <text x="0" y="0" transform="translate(50 180) rotate(-90)">internal style on</text> <text x="0" y="0" transform="translate(50 300) rotate(-90)">external style on</text> <text x="0" y="0" transform="translate(50 420) rotate(-90)">inherited style</text> <text x="0" y="0" transform="translate(70 150) rotate(-90)"><rect></text> <text x="0" y="0" transform="translate(70 210) rotate(-90)"><use></text> <text x="0" y="0" transform="translate(70 270) rotate(-90)"><rect></text> <text x="0" y="0" transform="translate(70 330) rotate(-90)"><use></text> <text x="0" y="0" transform="translate(70 390) rotate(-90)">internal</text> <text x="0" y="0" transform="translate(70 450) rotate(-90)">external</text> </g> </g> <!-- ############################### --> <defs> <linearGradient id="grad1"> <stop style="stop-color:gold" offset="0" /> <stop style="stop-color:crimson" offset="1" /> </linearGradient> <linearGradient id="grad2"> <stop style="stop-color:white" offset="0" /> <stop style="stop-color:black" offset="1" /> </linearGradient> <linearGradient id="grad3"> <stop style="stop-color:gold" offset="0" /> <stop style="stop-color:green" offset="1" /> </linearGradient> <g style="fill:black;"> <!-- ### NOTHING SHOULD BE BLACK ON THE SCREEN ### --> <circle id="e" cx="25" cy="25" r="20" /> <circle id="e1" cx="25" cy="25" r="20" style="fill:url(#grad1)" /> <circle id="e3" cx="25" cy="25" r="20" style="fill:url(defs.svg#extGrad1)" /> </g> </defs> <!-- ############################### --> <!-- LOCAL USE --> <!-- ############################### --> <g> <!-- fill: internal URI on the referenced element --> <use xlink:href="#e1" x="125" y="125" /> <!-- fill:internal URI on the use --> <use xlink:href="#e" x="125" y="185" style="fill:url(#grad2)"/> <!-- fill: external URI on the referenced element --> <use xlink:href="#e3" x="125" y="245" /> <!-- fill: external URI on the use --> <use xlink:href="#e" x="125" y="305" style="fill:url(defs.svg#extGrad2)" /> <g style="fill:url(#grad3)"> <!-- fill: inherited local URI --> <use xlink:href="#e" x="125" y="365" /> </g> <g style="fill:url(defs.svg#extGrad3)"> <!-- fill: inherited external URI --> <use xlink:href="#e" x="125" y="425" /> </g> </g> <!-- ############################### --> <!-- EXTERNAL USE --> <!-- ############################### --> <g> <!-- fill: internal URI on the referenced element --> <use xlink:href="defs.svg#extE1" x="275" y="125" /> <!-- fill:internal URI on the use --> <use xlink:href="defs.svg#extE" x="275" y="185" style="fill:url(#grad2)"/> <!-- fill: external URI on the referenced element --> <use xlink:href="defs.svg#extE2" x="275" y="245" /> <!-- fill: external URI on the use --> <use xlink:href="defs.svg#extE" x="275" y="305" style="fill:url(defs.svg#extGrad2)"/> <!-- fill: inherited local URI --> <g style="fill:url(#grad3)"> <use xlink:href="defs.svg#extE" x="275" y="365" /> </g> <!-- fill: inherited external URI --> <g style="fill:url(defs.svg#extGrad3)"> <use xlink:href="defs.svg#extE" x="275" y="425" /> </g> </g> </g> <!-- ============================================================= --> <!-- Batik sample mark --> <!-- ============================================================= --> <use xlink:href="../batikLogo.svg#Batik_Tag_Box" /> </svg>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]