Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] xsl:element will not create an output element, in any context

From: N David Brown <orieldave@-------------->
To:
Date: 5/31/2007 11:57:00 AM
Hi guys,



It seems that, no matter what the context of an 'xsl:element' element,
no element is output for me. I have performed tests on different
browsers (ff, ie) on different systems, and still get no output!

An example - this W3C-ripped example produces no 'singer' elements for
me in the output:

  http://www.w3schools.com/xsl/xsl_transformation.asp



My own code looks like this:



 XML:



   <?xml version="1.0" encoding="ISO-8859-1"?>
   <root>rootname
      <dir>dir1
         <file>file1</file>
         <file>file2</file>
      </dir>
      <dir>dir2
         <file>file3</file>
      </dir>
   </root>

 XSL:



   <?xml version="1.0" encoding="ISO-8859-1"?>
   <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

   <xsl:template match="*">
      <xsl:element name="test">
         <xsl:apply-templates/>
      </xsl:element>
   </xsl:template>

   </xsl:stylesheet>



(my XSL is, unsurprisingly, much different from this in reality but I'm
using this simple stylesheet as an easy test platform)

--> The output from my own code is nothing, in this case, or if I have a
xsl:value-of selection within the 'test' element, then those values
would be output, but no surrounding <test></test>.

My transformations were being done server-side by some PHP I'd coded,
but I now directly link the XSL stylesheet to the XML file and then load
the XML file in the browser, to facilitate this debugging and ensure the
PHP isn't causing the problem.

I've no idea why this is happening, and have been attempting (and
failing) to fix it for about 3 days now in my spare time. Any
suggestions would be really appreciated!

Cheers.



- Dave


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent