You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Olaf Raether <o....@epro.de> on 2009/10/21 16:26:58 UTC

recursive use tag doesn´t work in batik - in Firefox 3.5 it´s ok

hi,

i have an svg file which looks very similar like the one at the end of this
message.
when i load this with Firefox 3.5 everything looks like expected. 
But Batik only displays the file in the first use tag. The use tags inside
the first 
one are ignored. Can anyone help me out of this ?


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg version="1.2" xmlns:svg="http://www.w3.org/2000/svg" 
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" width="1849" height="2340" >
<g transform="translate(0.0,2340) scale(1,-1)" 
style="overflow:visible;color:#000000;fill:none;stroke:currentColor;stroke-width:0.07">
<g transform="translate(100,100)">
<g transform="rotate(90,0,0) translate(0,-300)">
<use xlink:href="file:/C:/file1.svg" x="0" y="0">
  <use xlink:href="file:/C:/file2.svg" x="0" y="0"
transform="translate(8,232) rotate(0,0,0)">
    <use xlink:href="file:/C:/file3.svg" x="0" y="0"
transform="translate(130,-10) rotate(0,0,0)"/>    
  </use>
</use>
</g>
</g>
</g>
</svg>
-- 
View this message in context: http://www.nabble.com/recursive-use-tag-doesn%C2%B4t-work-in-batik---in-Firefox-3.5-it%C2%B4s-ok-tp25993576p25993576.html
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: recursive use tag doesn´t work in batik - in Firefox 3.5 it´s ok

Posted by Helder Magalhães <he...@gmail.com>.
Hi Olaf,


> i modified my code and then it works - thanks.

Glad to know. :-)


> i guess FF is a little bit more tolerant than batik - or incorrect, i don´t
> know.

It's not a matter of tolerance, it's a matter of conformance to the
specification. ;-)

I created a reduced test case and was about to file an issue in the
Mozilla bug tracker when I noticed this fixed post Firefox 3.5 (tested
with 3.6b1pre and 3.7a1pre nightly builds), so just wait until the
next release or get a nightly build! :-)

I'm attaching the reduced test case anyway, in case anyone wants to
take a look or bumps into the same issue again.

Regards,
 Helder

Re: recursive use tag doesn´t work in batik - in Firefox 3.5 it´s ok

Posted by Olaf Raether <o....@epro.de>.
i modified my code and then it works - thanks.
i guess FF is a little bit more tolerant than batik - or incorrect, i don´t
know.


Modified file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg version="1.2" xmlns:svg="http://www.w3.org/2000/svg" 
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" width="1849" height="2340" >
<g transform="translate(0.0,2340) scale(1,-1)" 
style="overflow:visible;color:#000000;fill:none;stroke:currentColor;stroke-width:0.07">
  <g transform="translate(100,100)">
    <g transform="rotate(90,0,0) translate(0,-300)">
      <g>
        <use xlink:href="file:/C:/file1.svg" x="0" y="0"/>
	    <g transform="translate(8,232) rotate(0,0,0)">
		  <use xlink:href="file:/C:/file2.svg" x="0" y="0"/>
		  <g transform="translate(90,-22) rotate(0,0,0)">
		    <use xlink:href="file:/C:/file3.svg" x="0" y="0"/>
		  </g>		  
        </g>
     </g>
  </g>
</g>
</svg>
-- 
View this message in context: http://www.nabble.com/recursive-use-tag-doesn%C2%B4t-work-in-batik---in-Firefox-3.5-it%C2%B4s-ok-tp25993576p26007597.html
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: recursive use tag doesn´t work in batik - in Firefox 3.5 it´s ok

Posted by Helder Magalhães <he...@gmail.com>.
Hi Olaf,


> i have an svg file which looks very similar like the one at the end of this
> message.
> when i load this with Firefox 3.5 everything looks like expected.

It's awkward to me that it works in Firefox, as far as I know the use
element [1] should be empty and therefore no child content is
expected... :-|


> But Batik only displays the file in the first use tag. The use tags inside
> the first
> one are ignored. Can anyone help me out of this ?

Just remove the nesting from your use elements. Basically, change those

<use>
  <use>
    <use/>
  </use>
</use>

To something like:

<use/>
<use/>
<use/>


Hope this helps,
 Helder


[1] http://www.w3.org/TR/SVG/struct.html#UseElement

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: recursive use tag doesn´t work in batik - in Firefox 3.5 it´s ok

Posted by th...@kodak.com.
Hi Olaf,

Olaf Raether <o....@epro.de> wrote on 10/21/2009 10:26:58 AM:

> when i load this with Firefox 3.5 everything looks like expected. 
> But Batik only displays the file in the first use tag. The use tags 
inside
> the first one are ignored. Can anyone help me out of this ?

   As Helder mentions the problem is the nested use elements.  If you
check the SVG standard it doesn't allow the use element to contain
other graphical elements (http://www.w3.org/TR/SVG/struct.html#UseElement
):

<!ENTITY % SVG.use.content
    "(( %SVG.Description.class; )*, ( %SVG.Animation.class;
        %SVG.use.extra.content; )*)"
>
<!ELEMENT %SVG.use.qname; %SVG.use.content; >


   So a use element can have desc/title/metadata and animation 
elements as children.  In fact you will get a validation error 
in Batik if you enable using a validating XML parser (and add
appropriate DTD, etc):

The content of element type "use" must match 
"(((desc,((title,metadata?)|(metadata,title?))?)|(title,((desc,metadata?)|(metadata,desc?))?)|(metadata,((desc,title?)|(title,desc?))?))?,(animate|set|animateMotion|animateColor|animateTransform)*)".