You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Peter Neu <pe...@gmx.net> on 2006/05/03 15:43:26 UTC
Problem with prefixes
Hello,
I'm using fop to generate documents in my webapps. Like most people
I build a sax stream and pass it fop. Until now it worked fine but now I
have to use "evil" namespaces. *grr*
Normally I would write tags like this:
hd.startElement(null,"Menge","Menge",atts);
hd.characters(Menge[0].toCharArray(),0,Menge[0].length());
hd.endElement(null,"Menge","Menge");
Now I need to have prefixes in my tags
hd.startElement(null,"Menge","cbc:Menge",atts);
...
hd.endElement(null,"Menge","cbc:Menge");
The xml document looks ok. But the xsl file can't find the tags with
namespaces although I declared the namespace-uri's both in the original xml
and also the xsl file.
Does anyone know what's wrong?
Cheers,
Pete
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
AW: Problem with prefixes
Posted by Peter Neu <pe...@gmx.net>.
Thanks. Sax is for me, what was Russian politics for Churchill:
a riddle, wrapped in a mystery, inside an enigma....
cheers,
Pete
-----Ursprüngliche Nachricht-----
Von: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
Gesendet: Mittwoch, 3. Mai 2006 15:52
An: fop-users@xmlgraphics.apache.org
Betreff: Re: Problem with prefixes
Not really a FOP question, is it? :-) You simply forgot to specify the
namespace URI for each SAX call, i.e. substitute the first parameter "null"
with "http://evil.org/ns" (or whatever). With the prefix alone, the SAX
consumer doesn't know about the namespace. That's one of the parts where
SAX is a bit messed up. But you get used to it. Have fun.
On 03.05.2006 15:43:26 Peter Neu wrote:
> Hello,
>
> I'm using fop to generate documents in my webapps. Like most people
> I build a sax stream and pass it fop. Until now it worked fine but now I
> have to use "evil" namespaces. *grr*
>
> Normally I would write tags like this:
>
> hd.startElement(null,"Menge","Menge",atts);
> hd.characters(Menge[0].toCharArray(),0,Menge[0].length());
> hd.endElement(null,"Menge","Menge");
>
>
> Now I need to have prefixes in my tags
>
> hd.startElement(null,"Menge","cbc:Menge",atts);
> ...
> hd.endElement(null,"Menge","cbc:Menge");
>
> The xml document looks ok. But the xsl file can't find the tags with
> namespaces although I declared the namespace-uri's both in the original
xml
> and also the xsl file.
>
> Does anyone know what's wrong?
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: Problem with prefixes
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Not really a FOP question, is it? :-) You simply forgot to specify the
namespace URI for each SAX call, i.e. substitute the first parameter "null"
with "http://evil.org/ns" (or whatever). With the prefix alone, the SAX
consumer doesn't know about the namespace. That's one of the parts where
SAX is a bit messed up. But you get used to it. Have fun.
On 03.05.2006 15:43:26 Peter Neu wrote:
> Hello,
>
> I'm using fop to generate documents in my webapps. Like most people
> I build a sax stream and pass it fop. Until now it worked fine but now I
> have to use "evil" namespaces. *grr*
>
> Normally I would write tags like this:
>
> hd.startElement(null,"Menge","Menge",atts);
> hd.characters(Menge[0].toCharArray(),0,Menge[0].length());
> hd.endElement(null,"Menge","Menge");
>
>
> Now I need to have prefixes in my tags
>
> hd.startElement(null,"Menge","cbc:Menge",atts);
> ...
> hd.endElement(null,"Menge","cbc:Menge");
>
> The xml document looks ok. But the xsl file can't find the tags with
> namespaces although I declared the namespace-uri's both in the original xml
> and also the xsl file.
>
> Does anyone know what's wrong?
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: Problem with prefixes
Posted by Web Maestro Clay <th...@gmail.com>.
On May 3, 2006, at 6:43 AM, Peter Neu wrote:
> The xml document looks ok. But the xsl file can't find the tags with
> namespaces although I declared the namespace-uri's both in the
> original xml
> and also the xsl file.
>
> Does anyone know what's wrong?
>
> Cheers,
> Pete
I don't recall if this is the problem you're experiencing but there's
a bug in Saxon that sounds familiar. Have you tried Xalan?
Web Maestro Clay
the.webmaestro@gmail.com
My religion is simple. My religion is kindness.
-- HH Dalai Lama of Tibet
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org