Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating xmlns:xsi and xsi:type "atributes" 1

Status
Not open for further replies.

Dijkstra30

Programmer
Oct 24, 2005
13
RO
Hello,

How do i create an element like this with xslt?

<myElement xmlns:xsi=" xsi:type="Herb" aType="Placeboom">


I mention that the xml I want to transform into this does not contain xmlns:xsi or xsi:type.

I googled a lot but i did not find a proper answer. I only found out that these are not regular attributes.
 
Like this?

[1] Make sure xmlns:xsi is declared in the xsl:stylesheet element.
[tt]
<xsl:stylesheet version="1.0" xmlns:xsl=" xmlns:xsi="[/tt]

[2] In the element, myElement, use the prefix xsi.
[tt]
<xsl:element name="myElement">
<xsl:attribute name="xsi:type">Herb</xsl:attribute>
<xsl:attribute name="aType">Placeboom</xsl:attribute>
</xsl:element>
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top