You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Ginger Young <gi...@lanl.gov> on 2001/04/18 19:29:09 UTC

Bug with Attribute's default?

I'm rather new at using these tools (Xalan Java 2 on an NT), so I am not 
sure if I am causing my own problem.

I am not able to "see" a default attribute set in my DTD.

Here's an example:

Section out of foo_dtd.dtd:

     <!ELEMENT table (#PCDATA)
          align            ( left | center | right ) 'center'
      >


Section out of foo_xml.xml:

<table align='right'> some text here and table data... </table>

<table> Second table with its text and table data... </table>

Section out of foo_xsl.xsl

   <xsl:template match="table">
          <br></br>
          <xsl:variable name="alignment" select="@align"/>
	<xsl:text>Alignment: </xsl:text>
	<xsl:value-of select="$alignment"/>
	<br></br>

   </xsl:template>

Results:

Alignment: right
Alignment:

When trying to use the default the value of the attribute align appears to 
be NULL.

Is this a bug or am I doing something wrong?

Thanks for your time.

Ginger

Ginger Young         Los Alamos National Laboratory
gingery@lanl.gov    (505) 667-5133