You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Berin Loritsch <bl...@apache.org> on 2001/04/24 20:08:50 UTC
I can't declare a namespace in XSP
I am trying to declare the xforms namespace in a page I am using,
however, I am suffering from issues dealing with the namespace
stripping algorithm in XSP.
I want to use <xform:button> et. al., but every time I try to
declare the namespace it gets stripped out.
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: I can't declare a namespace in XSP
Posted by Berin Loritsch <bl...@apache.org>.
Sylvain Wallez wrote:
>
> Berin Loritsch a écrit :
> >
> > I am trying to declare the xforms namespace in a page I am using,
> > however, I am suffering from issues dealing with the namespace
> > stripping algorithm in XSP.
> >
> > I want to use <xform:button> et. al., but every time I try to
> > declare the namespace it gets stripped out.
> >
> Can you please post a sample ? I checked on the latest CVS by altering
> simple.xsp and it's OK.
>
> BTW, I noticed that requesting foo.xsp?cocoon-view=content strips all
> namespace declarations, resulting in an incorrect document, but the
> start/endPrefixMapping are in the generated java source code.
Use it in conjunction with the new aggregation stuff.
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: I can't declare a namespace in XSP
Posted by Berin Loritsch <bl...@apache.org>.
giacomo wrote:
>
> On Wed, 25 Apr 2001, Sylvain Wallez wrote:
>
> >
> >
> > Berin Loritsch a écrit :
> > >
> > > I am trying to declare the xforms namespace in a page I am using,
> > > however, I am suffering from issues dealing with the namespace
> > > stripping algorithm in XSP.
> > >
> > > I want to use <xform:button> et. al., but every time I try to
> > > declare the namespace it gets stripped out.
> > >
> > Can you please post a sample ? I checked on the latest CVS by altering
> > simple.xsp and it's OK.
> >
> > BTW, I noticed that requesting foo.xsp?cocoon-view=content strips all
> > namespace declarations, resulting in an incorrect document, but the
> > start/endPrefixMapping are in the generated java source code.
>
> I think you discovered a bug in the XSP engine. I've put a
> LogTransformer after the xsp generator into the sitemap. Yes, it report
> the start-/endPrefixMappings correctly but as I think having discovered
> with the ContentAggregator that is not enough. It should add them as
> xmlns attributes to the following element.
>
> Can anybody take a look at it, must be in the xsp.xsl file.
I doubt it. The class has the start and stop Namespace events in the
correct location. It's just that when the output is merged with
the ContentAggregator, those events are somehow stripped. I moved the
namespace declaration to a subelement (instead of the root one), and
it was still ignored.
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [C2][Patch] XSP namespace attributes (was: I can't declare a
namespace in XSP)
Posted by Berin Loritsch <bl...@apache.org>.
Sylvain Wallez wrote:
>
> Sylvain Wallez a écrit :
> >
> > giacomo a écrit :
> <snip/>
> > >
> > > I think you discovered a bug in the XSP engine. I've put a
> > > LogTransformer after the xsp generator into the sitemap. Yes, it report
> > > the start-/endPrefixMappings correctly but as I think having discovered
> > > with the ContentAggregator that is not enough. It should add them as
> > > xmlns attributes to the following element.
> > >
> >
> > Quoting the org.xml.sax.ContentHandler#startElement javadoc :
> > The attribute list will contain attributes used for Namespace
> > declarations (xmlns* attributes) only if the
> > http://xml.org/sax/features/namespace-prefixes property is true (it is
> > false by default, and support for a true value is optional).
> >
> > I grep'ed the sources for this feature and found it in
> > AbstractMarkupLanguage.java, LogicSheet.java and JaxpParser.java (does
> > it mean all places where parsing occurs?). So obviously Cocoon needs it.
> >
> > > Can anybody take a look at it, must be in the xsp.xsl file.
> >
> > I can do it (I did a previous patch for removing unneeded namespace
> > generation), but could someone explain me why it's needed and
> > start/endPrefixMappings aren't enough ?
> >
>
> Done ! Please find attached patches that (I hope finally) solve the XSP
> namespace problems.
>
> Here are the changes :
> - check if we should declare namespaces as attributes. This depends on
> the parser/xsl processor combination that's used : Xerces+Xalan require
> it, while Xerces+Saxon do not (xmlns attributes are generated).
>
> - moved top-level namespaces declaration from the "xsp:page" template to
> the "process-first-element" template because we need namespace
> information from that first element to avoid duplicate namespace
> generation.
>
> - after the previous change, the generate() method only contains a call
> to generateContent(), so I merged both.
>
> - added XML_NAMESPACE_URI Constants.java for the xmlns namespace URI
> used in namespaces attributes.
>
> Could you please apply these patches ?
Patches tested and applied.
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
[C2][Patch] XSP namespace attributes (was: I can't declare a namespace
in XSP)
Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Sylvain Wallez a écrit :
>
> giacomo a écrit :
<snip/>
> >
> > I think you discovered a bug in the XSP engine. I've put a
> > LogTransformer after the xsp generator into the sitemap. Yes, it report
> > the start-/endPrefixMappings correctly but as I think having discovered
> > with the ContentAggregator that is not enough. It should add them as
> > xmlns attributes to the following element.
> >
>
> Quoting the org.xml.sax.ContentHandler#startElement javadoc :
> The attribute list will contain attributes used for Namespace
> declarations (xmlns* attributes) only if the
> http://xml.org/sax/features/namespace-prefixes property is true (it is
> false by default, and support for a true value is optional).
>
> I grep'ed the sources for this feature and found it in
> AbstractMarkupLanguage.java, LogicSheet.java and JaxpParser.java (does
> it mean all places where parsing occurs?). So obviously Cocoon needs it.
>
> > Can anybody take a look at it, must be in the xsp.xsl file.
>
> I can do it (I did a previous patch for removing unneeded namespace
> generation), but could someone explain me why it's needed and
> start/endPrefixMappings aren't enough ?
>
Done ! Please find attached patches that (I hope finally) solve the XSP
namespace problems.
Here are the changes :
- check if we should declare namespaces as attributes. This depends on
the parser/xsl processor combination that's used : Xerces+Xalan require
it, while Xerces+Saxon do not (xmlns attributes are generated).
- moved top-level namespaces declaration from the "xsp:page" template to
the "process-first-element" template because we need namespace
information from that first element to avoid duplicate namespace
generation.
- after the previous change, the generate() method only contains a call
to generateContent(), so I merged both.
- added XML_NAMESPACE_URI Constants.java for the xmlns namespace URI
used in namespaces attributes.
Could you please apply these patches ?
--
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com
Re: I can't declare a namespace in XSP
Posted by Sylvain Wallez <sy...@anyware-tech.com>.
giacomo a écrit :
>
> On Wed, 25 Apr 2001, Sylvain Wallez wrote:
>
> >
> >
> > Berin Loritsch a écrit :
> > >
> > > I am trying to declare the xforms namespace in a page I am using,
> > > however, I am suffering from issues dealing with the namespace
> > > stripping algorithm in XSP.
> > >
> > > I want to use <xform:button> et. al., but every time I try to
> > > declare the namespace it gets stripped out.
> > >
> > Can you please post a sample ? I checked on the latest CVS by altering
> > simple.xsp and it's OK.
> >
> > BTW, I noticed that requesting foo.xsp?cocoon-view=content strips all
> > namespace declarations, resulting in an incorrect document, but the
> > start/endPrefixMapping are in the generated java source code.
>
> I think you discovered a bug in the XSP engine. I've put a
> LogTransformer after the xsp generator into the sitemap. Yes, it report
> the start-/endPrefixMappings correctly but as I think having discovered
> with the ContentAggregator that is not enough. It should add them as
> xmlns attributes to the following element.
>
Quoting the org.xml.sax.ContentHandler#startElement javadoc :
The attribute list will contain attributes used for Namespace
declarations (xmlns* attributes) only if the
http://xml.org/sax/features/namespace-prefixes property is true (it is
false by default, and support for a true value is optional).
I grep'ed the sources for this feature and found it in
AbstractMarkupLanguage.java, LogicSheet.java and JaxpParser.java (does
it mean all places where parsing occurs?). So obviously Cocoon needs it.
> Can anybody take a look at it, must be in the xsp.xsl file.
I can do it (I did a previous patch for removing unneeded namespace
generation), but could someone explain me why it's needed and
start/endPrefixMappings aren't enough ?
>
> Giacomo
>
--
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: I can't declare a namespace in XSP
Posted by giacomo <gi...@apache.org>.
On Wed, 25 Apr 2001, Sylvain Wallez wrote:
>
>
> Berin Loritsch a �crit :
> >
> > I am trying to declare the xforms namespace in a page I am using,
> > however, I am suffering from issues dealing with the namespace
> > stripping algorithm in XSP.
> >
> > I want to use <xform:button> et. al., but every time I try to
> > declare the namespace it gets stripped out.
> >
> Can you please post a sample ? I checked on the latest CVS by altering
> simple.xsp and it's OK.
>
> BTW, I noticed that requesting foo.xsp?cocoon-view=content strips all
> namespace declarations, resulting in an incorrect document, but the
> start/endPrefixMapping are in the generated java source code.
I think you discovered a bug in the XSP engine. I've put a
LogTransformer after the xsp generator into the sitemap. Yes, it report
the start-/endPrefixMappings correctly but as I think having discovered
with the ContentAggregator that is not enough. It should add them as
xmlns attributes to the following element.
Can anybody take a look at it, must be in the xsp.xsl file.
Giacomo
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: I can't declare a namespace in XSP
Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Berin Loritsch a écrit :
>
> I am trying to declare the xforms namespace in a page I am using,
> however, I am suffering from issues dealing with the namespace
> stripping algorithm in XSP.
>
> I want to use <xform:button> et. al., but every time I try to
> declare the namespace it gets stripped out.
>
Can you please post a sample ? I checked on the latest CVS by altering
simple.xsp and it's OK.
BTW, I noticed that requesting foo.xsp?cocoon-view=content strips all
namespace declarations, resulting in an incorrect document, but the
start/endPrefixMapping are in the generated java source code.
--
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org