You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Brian Hüttner <ti...@Informatik.Uni-Bremen.DE> on 2000/06/20 21:48:08 UTC

Xalan-J: Bug(s) with attributes?

Hello,

I produce XSLT instances automatically and there are several
strange results when I use attributes.

1) Is there any need that attribute templates have to be 
   in order directly underneath there element?
   This example shows what happens if they are not directly
   underneath there element.
   Example:
	<xsl:template match="/child::node()[2]/child::node()[4]">
	<abstract>
	<xsl:processing-instruction name="PI1">
	name="test"
	</xsl:processing-instruction>
	<xsl:apply-templates
select="/child::node()[3]/child::node()[4]/attribute::*[1]" />
	<xsl:apply-templates
select="/child::node()[3]/child::node()[4]/attribute::*[2]" />
	<xsl:apply-templates
select="/child::node()[3]/child::node()[4]/child::node()[1]" />
	<xsl:apply-templates
select="/child::node()[3]/child::node()[4]/child::node()[2]" />
	<xsl:apply-templates
select="/child::node()[3]/child::node()[4]/child::node()[3]" />
	...
   In this example the following output was created:
	<abstract>
	<?PI2 name="test"?>
	<list #attribut1 #attribut2>
	...
   So the attributes should be in the abstract element but
   they appear in the list element 
   (/child::node()[3]/child::node()[4]/child::node()[1]).
   I thought that attributes always appear in that element
   they are deaclared in. Is this (above mentioned) a
   normal result?

2) The same effect we have in creating attributes:
   Example:
	<null>
	<xsl:attribute name="test">
	blablub
	</xsl:attribute>
	Ein Test der ER 
	<rArr>
	=>
	</rArr>
	<xsl:attribute name="test2">
	blablub2
	</xsl:attribute>
	.
	</null>
   The following output appears:
	<null test="blablub">
	Ein Test...
	</null>
   So the second xsl:attribute was ignored? Do attribute
   declarations have to follow directly the element they
   should appear to?

   This is not a problem I cannot handle, but I think
   these are really strange results.

Best regards
Brian Hüttner  
-- 
+--------------------------------------------------------+
| Brian Hüttner                   University of Bremen   |
| tim@informatik.uni-bremen.de    FB3 - Computer Science |
+--------------------------------------------------------+