xsl xmlns question
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 3
- Joined: Thu Nov 25, 2010 6:21 pm
xsl xmlns question
Hi!
I'm using oxygen to convert xml to xhtml. In the process I get an xmlns attribute in some of the resulting xhtml tags -- like this:
<xmltag>Heading</xmltag>
becomes
<h1 xmlns:"">Heading<h1>
xsl says: <xsl:template match="xmltag"><h1><xsl:value-of select="."/></h1></xsl:template>
How to get rid of the xmlns:""?
Thomas
I'm using oxygen to convert xml to xhtml. In the process I get an xmlns attribute in some of the resulting xhtml tags -- like this:
<xmltag>Heading</xmltag>
becomes
<h1 xmlns:"">Heading<h1>
xsl says: <xsl:template match="xmltag"><h1><xsl:value-of select="."/></h1></xsl:template>
How to get rid of the xmlns:""?
Thomas
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: xsl xmlns question
Hello,
Are you sure it's not really xmlns="" ? xmlns:"" seems unlikely, it's not even XML well formed.
The problem is namespace related. You probably have an element in the stylehseet that specifies the XHTML namespace.
e.g.
<html xmlns="http://www.w3.org/1999/xhtml">
But then subsequent elements don't have the namespace specified.
If all the elements from the output are from the same namespace as is the case for XHTML you can either specify the namespace for each of them(which is a burden) or add add the default namespace declaration:
xmlns="http://www.w3.org/1999/xhtml" to the stylesheet root: <xsl: stylesheet.
Regards,
Adrian
Are you sure it's not really xmlns="" ? xmlns:"" seems unlikely, it's not even XML well formed.
The problem is namespace related. You probably have an element in the stylehseet that specifies the XHTML namespace.
e.g.
<html xmlns="http://www.w3.org/1999/xhtml">
But then subsequent elements don't have the namespace specified.
If all the elements from the output are from the same namespace as is the case for XHTML you can either specify the namespace for each of them(which is a burden) or add add the default namespace declaration:
xmlns="http://www.w3.org/1999/xhtml" to the stylesheet root: <xsl: stylesheet.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 3
- Joined: Thu Nov 25, 2010 6:21 pm
Re: xsl xmlns question
Hmm... did some typing errors in my post. You're right, it is xmlns="".
Removed xmlns="http://www.w3.org/1999/xhtml" in the <html> tag and put it in the <xsl:stylesheet instead.
Now everything is fine! Thanks a lot for helping!
Thomas
Removed xmlns="http://www.w3.org/1999/xhtml" in the <html> tag and put it in the <xsl:stylesheet instead.
Now everything is fine! Thanks a lot for helping!
Thomas
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service