[jdom-interest] XSL and JDOM

std00047 at di.uoa.gr std00047 at di.uoa.gr
Tue Feb 3 10:33:50 PST 2004


Hello to everybody...

I am a newbie to XSL and JDOM and I would like your help!

I have a configuration file in XML describing the contents of a SMIL file. My 
aim is to write an XSL file to convert these data into a SMIL file, using JDOM 
(XSLTransform.java).

The problem is the following:

====================================
XML file
====================================
<?xml version="1.0" encoding="UTF-8" ?> 
<presentation>
  <content /> 
</presentation>

====================================
XSL file
====================================
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="smil" omit-xml-declaration="yes" indent="yes"/>

    <xsl:template match="presentation">
        <smil xmlns="http://www.w3.org/2001/SMIL20/Language">
            <head>
                <layout>
                    <root-layout width="700" height="550" 
backgroundColor="white"/>
		    <region id="testregion"/>
                </layout>
            </head>
            <body>
                <excl dur="indefinite">
                   <xsl:call-template name="parSector">
                       <xsl:with-param name="parSec">1</xsl:with-param>
                   </xsl:call-template>
                </excl>
            </body>
        </smil>
    </xsl:template>
    
    <xsl:template name="parSector">
        <lala><xsl:value-of select="local-name(current())"/></lala>
        <par dur="indefinite"/>
    </xsl:template>
</xsl:stylesheet>

============================================
SMIL file: result
============================================
<?xml version="1.0" encoding="UTF-8"?>
<smil xmlns="http://www.w3.org/2001/SMIL20/Language">
  <head>
    <layout>
      <root-layout backgroundColor="white" height="550" width="700" />
      <region id="testregion" />
    </layout>
  </head>
  <body>
    <excl dur="indefinite">
      <lala xmlns="">presentation</lala>
      <par xmlns="" dur="indefinite" />
    </excl>
  </body>
</smil>
------------------------------------------------

You may notice that in the result SMIL file, in the 
<body>
  <excl>
    <lala xmlns="">
there is the attribute: xmlns="" , which is not acceptable for a SMIL file.
I noticed that this appears when i <xsl:call-template>...

Is there anything wrong in my code... I don't know
I would be thankful if you could help me...

-- George




More information about the jdom-interest mailing list