[xslt] Trouble printing xmlns: attribute in name space.




Hi

This is how my root node should look like in the resulting output file:

<?xml version="1.0"?>
<oval xmlns="http://oval.mitre.org/XMLSchema/oval";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:oval="http://oval.mitre.org/XMLSchema/oval";
xsi:schemaLocation="http://oval.mitre.org/XMLSchema/oval oval-schema.xsd
http://oval.mitre.org/XMLSchema/oval#redhat redhat-schema.xsd"
oval:schemaVersion="3.0"
>



Unfortunately, I am not able to print it etc.    My code looks like:


<xsl:element name="oval" namespace="http://oval.mitre.org/XMLSchema/oval";>
        <xsl:attribute name="xmlns:oval">
                http://oval.mitre.org/XMLSchema/oval
        </xsl:attribute>
</xsl:element>


I get this output:

<oval xmlns="http://oval.mitre.org/XMLSchema/oval";>


The xmlns:oval is just deleted. I referred the documentation at

http://www.w3.org/TR/xslt#creating-attributes

It does not say how to do it.  It just says that the declaration will not
be output. Docs:


<begin>
Thus, although it is not an error to do:

<xsl:attribute name="xmlns:xsl"
namespace="whatever">http://www.w3.org/1999/XSL/Transform</xsl:attribute>

it will not result in a namespace declaration being output.
<end>


Can someone guide me?


thanks for helping out
--Sudhakar

PS: Am I asking too dumb questions? Please let me know if these questions
are inappropriate for the list.



Sudhakar Govindavajhala	                  Department of Computer Science
Graduate Student,                         Princeton University
Ph : (lab) +1 609 258 1763                   (office) +1 609 258 1798
               http://www.cs.princeton.edu/~sudhakar


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]