Re: XSLT + java: namespace problem

Dave Pawson <[email protected]> Fri, 9 Sep 2005 13:29:36 +0100
Newsgroups gmane.comp.openoffice.devel.xml
Message-ID <[email protected]>
On 09/09/05, Guillon Benoit <[email protected]> wrote:

>=20
> Thanks for your reply. The element I want to match is the root element
> of the content.xml file in a sxw document: office:document-content.
>=20
> In the input file all the namespaces are well declared:
>=20
> <office:document-content
>     xmlns:office=3D"http://openoffice.org/2000/office"


>=20
> and I declare the one I use in my XSL stylesheet:
>=20
> <xsl:stylesheet
>     xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform"
>     xmlns:text=3D"http://openoffice.org/2000/text"
>     xmlns:meta=3D"http://openoffice.org/2000/meta"
>     xmlns:table=3D"http://openoffice.org/2000/table"
>     xmlns:office=3D"http://openoffice.org/2000/office"
>     xmlns:dc=3D"http://purl.org/dc/elements/1.1/"
>     xmlns:draw=3D"http://openoffice.org/2000/drawing"
>     xmlns:xlink=3D"http://www.w3.org/1999/xlink"
>     xmlns:style=3D"http://openoffice.org/2000/style"
>     version=3D"1.0">


Oh look! The ofice prefix (ns http://openoffice.org/2000/office)
isn't declared in the xslt.

  There's the problem
assuming document-content has the office:prefix

<xsl:value-of select=3D"count(/office:document-content/*)"/> will return=20
the actual count?

which is probably one, since it is the root of the document?




>=20
> I really think that the problem is not related to the XSL because it
> works fine outside Openoffice, with different .

Different to what?
A compliant xslt engine shouldn't match.

 It seems that inside
> Openoffice the parser used to parse my stylesheet or the input file - or
> both - is not namespace aware

Since office uses namespaces so widely, I think that unlikely?


HTH


--=20
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk