cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Gritsenko" <vadim.gritse...@verizon.net>
Subject RE: LinkSerializer not seeing links (href, src)
Date Thu, 01 Aug 2002 14:13:26 GMT
> From: Torsten Knodt [mailto:torstenknodt@datas-world.de]
> 
> Hello Vadim,
> > > I have a second problem with LinkSerializer. Sometimes I can only
> > > see href's (no src),
> > Give an example (reproducible).
> > > sometimes I can't see any links.
> > Same here.
> I wasn't able to reproduce the version, where only href's where
recognised,
> but here's a version, which doesn't produce any links.
> It's stripped down as much as possible. When it would work, you should
see a
> broken link to test2.html.
> The error xsl isn't included, it's the sample.

Thanks for the example.

Let me clarify how link serializer works. It react only on elements
which has "href" or "src" or "background" attributes in the *same*
namespace as element.

>From your HTML (skipping unessential stuff):

<html xmlns="http://www.w3.org/1999/xhtml">
    <img src="test2.html" alt="" />
</html>

You are defining element img in XHTML namespace. I will write this as:

  'http://www.w3.org/1999/xhtml':img

Then, you are adding *non-namespaced* attribute src (default namespace
does not affect attributes, see
http://www.w3.org/TR/1999/REC-xml-names-19990114/#defaulting):

  '':src

The result is that src and img are in *different* namespaces. To make
LinkSerializer work, they must be in the same namespace. This can be
achieved by two ways:

1. Add namespace to the attribute:

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ns="http://www.w3.org/1999/xhtml">
    <img ns:src="test2.html" ns:alt="" />
</html>

2. Remove namespace from the element:

<html>
    <img src="test2.html" alt="" />
</html>


Regards,
Vadim


> With kind regards
> 	Torsten Knodt


---------------------------------------------------------------------
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:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message