You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Sanne de Roever <sa...@newfoundland.nl> on 2002/09/12 14:23:38 UTC

(Related) XSP Bug: xsp:element used as root element

Hi,

I've been using the xsp:element, and xsp:attribute tags with succes when creating svg. 
But now I would like to wrap the root element svg in such a tag, so I can
adjust the width and height.

The could/should be like this:

<?xml version="1.0"?>
<xsp:page language="java"
 xmlns:xsp="http://apache.org/xsp"
 xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>
<xsp:element name="svg">
 <xsp:attribute name="width">500</xsp:attribute>
 <xsp:attribute name="height">500</xsp:attribute>
 <xsp:element name="path">
  <xsp:attribute name="fill">none</xsp:attribute>
  <xsp:attribute name="d">M 100,200 z</xsp:attribute>
 </xsp:element>
 <xsp:element name="text">
  <xsp:attribute name="transform">matrix(1 0 0 1 0 26)</xsp:attribute>
  Hello world
 </xsp:element>
</xsp:element>
</xsp:page>

My own svg is more complex, but the bottom line is that using an xsp:element
tag for a root element doesn't work. If I start with <svg width="500" height="500"> and end with </svg> then everything goes ok.,
but starting with <xsp:element name="svg"> doesn't work.

Could this be a bug?

Regards,

Sanne

Re: (Related) XSP Bug: xsp:element used as root element

Posted by Ugo Cei <u....@cbim.it>.
[I think this is more appropriate for cocoon-users. Also, don't post 
HTML messages to the list, please.]

Sanne de Roever wrote:
> Hi,
> 
> I've been using the xsp:element, and xsp:attribute tags with succes when 
> creating svg.
> But now I would like to wrap the root element svg in such a tag, so I can
> adjust the width and height.
> 
> The could/should be like this:
> 
> <?xml version="1.0"?>
> <xsp:page language="java"
>  xmlns:xsp="http://apache.org/xsp"
>  xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>  >
> <xsp:element name="svg">
>  <xsp:attribute name="width">500</xsp:attribute>
>  <xsp:attribute name="height">500</xsp:attribute>

<svg>
   <xsp:attribute name="width">500</xsp:attribute>
   <xsp:attribute name="height">500</xsp:attribute>
   ...

Should work.

> Could this be a bug?

I think XSP requires that the contents of xsp:page be single-rooted with 
a root element that is not in the xsp namespace (apart from xsp:logic 
and xsp:structure elements). This is because the output of the XSP 
generator must be a well-formed XML document that has the <svg> element 
as its root.

	Ugo


-- 
Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail: u.cei@cbim.it


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: (Related) XSP Bug: xsp:element used as root element

Posted by Ugo Cei <u....@cbim.it>.
[I think this is more appropriate for cocoon-users. Also, don't post 
HTML messages to the list, please.]

Sanne de Roever wrote:
> Hi,
> 
> I've been using the xsp:element, and xsp:attribute tags with succes when 
> creating svg.
> But now I would like to wrap the root element svg in such a tag, so I can
> adjust the width and height.
> 
> The could/should be like this:
> 
> <?xml version="1.0"?>
> <xsp:page language="java"
>  xmlns:xsp="http://apache.org/xsp"
>  xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>  >
> <xsp:element name="svg">
>  <xsp:attribute name="width">500</xsp:attribute>
>  <xsp:attribute name="height">500</xsp:attribute>

<svg>
   <xsp:attribute name="width">500</xsp:attribute>
   <xsp:attribute name="height">500</xsp:attribute>
   ...

Should work.

> Could this be a bug?

I think XSP requires that the contents of xsp:page be single-rooted with 
a root element that is not in the xsp namespace (apart from xsp:logic 
and xsp:structure elements). This is because the output of the XSP 
generator must be a well-formed XML document that has the <svg> element 
as its root.

	Ugo


-- 
Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail: u.cei@cbim.it


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>