[xsl] Importing ns from xml to xslt (?!) ...

Subject: [xsl] Importing ns from xml to xslt (?!) ...
From: Kurt George Gjerde <kurt.gjerde@xxxxxxxxxxxxxxxxx>
Date: Wed, 8 May 2002 18:30:34 +0200 (MET DST)

I've just starting fiddling around with xforms in xslt.

My current problem is that the form elements (input, etc) should contain
xpath ref's to elements in xforms:model/instance. The XSL uses evaluate()
to do this so that's not a problem (except it being xslt off-spec).

BUT, these ref's will most often be namespaced. And, since the idea is to
make a general xsl to be used with all xforms, the xsl would not be aware
of these namespaces resulting in the evaluate() not being able to perform.

See the working example xml/xsl below. The current  xmlns:my=...  in
xsl:stylesheet  should not be there. Is this possible in some way?



<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="xforms.xsl" type="text/xsl"?>


      <project xmlns="http://my.com";>
        <title>The Dummy Project</title>

  <group xmlns="http://www.w3.org/2002/01/xforms";>
    <input ref="my:title">
    <input ref="my:leader/my:firstname">
      <caption>First name</caption>
    <input ref="my:leader/my:lastname">
      <caption>Last name</caption>



<?xml version="1.0" encoding="ISO-8859-1"?>

  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; xsl:version="1.0"
  xmlns:saxon="http://icl.com/saxon"; extension-element-prefixes="saxon"



  <xsl:output method="html" encoding="ISO-8859-1"/>

  <xsl:template match="thing">
    <H1>xforms-xslt // test 1</H1>

  <xsl:template match="xforms:group//xforms:input">
    <small><xsl:value-of select="xforms:caption"/></small><br/>
    <input name="{@ref}"

  <xsl:template match="xforms:model"/>


kurt george gjerde <kurt.gjerde@xxxxxxxxxxxx>
intermedia uib, university of bergen

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

Current Thread