|
Subject: RE: [xsl] end.tag minimization problem continued From: "Aron Bock" <aronbock@xxxxxxxxxxx> Date: Tue, 17 May 2005 13:18:27 +0000 |
<dataType>
<sequence>
<moRef name="ManagedObject"/>
<length>5</length>
</sequence>
</dataType> <xsl:template match="sequence">
<!-- Check if <sequence>-element has no <length> attribute.-->
foo
<xsl:if test="not(length)">
<xsl:message terminate="yes">
<!-- class name and attribute error message -->
Attribute:<xsl:value-of select="../@name"/>
Class: <xsl:value-of select="../../@name"/>
Error: sequence missing child element, length.
</xsl:message>
</xsl:if>
bar
</xsl:template> foo
barFrom: "Mikael Petterson (KI/EAB)" <mikael.petterson@xxxxxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: [xsl] end.tag minimization problem continued Date: Tue, 17 May 2005 07:35:07 +0200
Hi,
We are transforming and xml into java code using xsl/xslt in java. Ny xsl look like this;
...... <!-- Start: Sequence --> <xsl:when test="sequence"> <!-- Check if <sequence>-element has no <length> attribute.--> <xsl:if test="not(length)"> <xsl:message terminate="yes"> <!-- class name and attribute error message --> Attribute:<xsl:value-of select="../@name"/> Class: <xsl:value-of select="../../@name"/> Error: sequence missing child element, length. </xsl:message> </xsl:if> ........
When I execute my transformation it fails ( see error below). The following xml is ok:
<dataType> <sequence> <long> <range> <min>-500</min> <max>500</max> </range> </long> <length>12</length> </sequence> </dataType>
But when this xml is tranformed ( below) it fails:
<dataType> <sequence> <moRef name="ManagedObject"/> <length>5</length> </sequence> </dataType>
I interpret it as when I have a single <element/> I get the error but when I have <element></element> it is a ok.
Do I have to make any settings to the xml transformation?
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] end.tag minimization problem , Mikael Petterson \(K | Thread | [xsl] time difference help, Kent Seegmiller |
| [xsl] RE: Correction, Aron Bock | Date | Re: [xsl] time difference help, Jeni Tennison |
| Month |