• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

XSLT with name space

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to create a xml line:
<originalLocale xml:lang="EN"/>
from
<develLc>EN</develLc>,
so I wrote the xslt as:
<xsl:element name="originalLocale">
<xsl:attribute name="xml:lang" namespace="http://www.w3.org/XML/1998/namespace">
<xsl:value-of select="locale/develLc"/>
</xsl:attribute>
<xsl:element>
But the result is always like:
<originalLocale xmlns:xml="http://www.w3.org/XML/1998/namespsace" xml:lang="EN"/> which not supported by the xml IE browser
How can I remove the xmlns attribute?
Thanks in advance,
Roy
[ June 08, 2003: Message edited by: Roy Huang ]
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Instead of using <xsl:element> and <xsl:attribute>, you can write
<originalLocale xml:lang="{locale/develLc}"/>
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take this out of your XSLT
namespace="http://www.w3.org/XML/1998/namespace"
then your problem is also solved.
 
Yes, my master! Here is the tiny ad you asked for:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic