xsl-list
[Top] [All Lists]

RE: creating namespaces in a generated script

2002-09-18 02:19:05
Hi,

as input to my xslt script, I have an xml file, which 
contains a path P as a
string. The nodes on this path have namespaces.
  From this xml file I want to generate a stylesheet S in which P is
actually used as xpath. The URIs mathing the prefixes could be easily
created but how can I include these namespaces in S if they 
are not part of
the input?

Having not seen P or S, one possibility would be if P.xml is

  <xpath xmlns:foo="http://xorcist.com/"; 
xmlns:bar="http://assemblage23.com/";>foo:root/bar:kid</xpath>

And in you stylesheet do

  <xsl:for-each select="document('P.xml')/xpath">
    <xsl:copy-of select="namespace::*" />
    <xsl:attribute name="select">
      <xsl:value-of select="."
    </xsl:attribute>
  </xsl:for-each>

It's Wednesday, so that might not make any sense,

Jarno - Suicide Commando: Hellraiser (VNV Nation remix)

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



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