xsl-list
[Top] [All Lists]

Re: [xsl] strip-spaces

2008-02-05 09:23:51

When you say add xmlns="http://www.w3.or/1999/xhtml"; to the style sheet where, exactly, should these name space assignments be added? As far as I am aware, that is I believe that I am only placing valid xhtml in the result and I am translating everything - I copy nothing.

With respect,
Steven


On Feb 5, 2008, at 1:58 AM, David Carlisle wrote:



requiring only that I remove the xmlns=""
that is generated on nodes by the XSL serializer.

If you modify your stylesheet to generate these elements in the xhtmol
namespace then the XSLt serialiser will not put xmlns="" on them, which
it only needs to do because they have been generated in no-namespace,
while the parent of the element is in the xhtml namespace.

specially when given that an xhtml  document "is not xml,
XHTML is XML, it is HTML that is not XML, but you are generating XHTML.

If you are generating xhtml output and you create a result node -
should it not simply be the case that it is in the xhtml name space.

specifying the output method never changes the namesspace or element
names. If you specify <xsl:output =xhtml"/> and generaate <foobar/>
then that is not an XSLTY error, it's just that you have generated
invalid XHTML. If you generate elements in the wrong namespace the
situation is exactly the same (an element name consists of two parts the
local name and the namespace) so if you specify xhtml output but
generate a p in no namespace then that is not an XSLT error but the
result is invalid xhtml.

You haven't shown how you are generating these elements. If they are
being generated by the stylesheet, then make xhtml the default by adding xmlns="http://www.w3.or/1999/xhtml"; to xsl:stylesheet. If they are being copied from a source file, then don't do that, as you don't want a copy,
you need to change the name to the xhtmml namespace so go
<xsl:element name="{local-name()}">
so you generate a new eleemnt with the same local name but in the
default namespace for the stylesheet, which should be xhtml.




David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs.
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>