I need to convert one XML into another XML document using xslt and add a namespace to an element.
I need to be able to add the xmlns="
http://www.opentravel.org/OTA/2003/05" to the POS element to produce the following:
<OTA_HotelDescriptiveInfoR
Q xmlns:xsd="
http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" EchoToken="Test" PrimaryLangID="en" xmlns="
http://www.opentravel.org/OTA/2003/05">
<POS xmlns="
http://www.opentravel.org/OTA/2003/05">
<Source>
<RequestorId ID="999" ID_Context="Me" />
</Source>
</POS>
Here is what I thought would work in the xslt document:
<xsl:element name="POS" namespace="
http://www.opentravel.org/OTA/2003/05">
<xsl:element name="Source">
<xsl:element name="RequestorId" use-attribute-sets="reques
tor" />
</xsl:element>
</xsl:element>
However the resulting xml document comes out without the namespace as:
<POS>
<Source>
<RequestorId ID="999" ID_Context="Me"/>
</Source>
</POS>
I also need to insert the same namespace in another element further down the document, but obviously that fails too.
Any help would be really appreciated.