xsl-list
[Top] [All Lists]

Re: [xsl] Why is copy-namespaces="no" required?

2009-11-18 07:37:04

Why is copy-namespaces="no" required to avoid duplication of namespace
declarations

because you have used

 <xsl:element name="{name(.)}" namespace="{namespace-uri(.)}">
rather than simply
<xsl:copy>
to generate the parent element this means that the only namespace node
on the parent is the one bound to xs: so when you copy the children
any other namespaces that are copied have to be declared on each child.
If you only want then declared once you need them to be in scope on the
parent and <xsl:element name="{name(.)}" namespace="{namespace-uri(.)}">
is essentially the xslt 1 vesrsion of copy-namespaces="no" and explictly
does not copy namespaces.


Is there a simple way of passing in a list of N pathnames in a param

If you are calling it from the java spi then you can construct any XDM
value and pass it in, from teh command line do


saxon a.xml style.xsl doclist="1.xml 2.xml 3.xml"

then you can do
<xsl:param name="doclist"/>
<xsl:variable name="docs" select="
for $d in tokenize($doclist,'\s+') return doc($d)"/>

then  <xsl:copy-of select="$docs/xs:schema/xs:complexType "
would copy all the complex type elements from all the documents.

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>
--~--

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