Click here to Skip to main content
15,921,905 members
Home / Discussions / XML / XSL
   

XML / XSL

 
Generalroot element is missing Pin
Ahmed Galal21-Jun-05 23:04
Ahmed Galal21-Jun-05 23:04 
GeneralRe: root element is missing Pin
DavidNohejl22-Jun-05 7:33
DavidNohejl22-Jun-05 7:33 
GeneralRe: root element is missing Pin
Ahmed Galal22-Jun-05 12:53
Ahmed Galal22-Jun-05 12:53 
GeneralRe: root element is missing Pin
DavidNohejl22-Jun-05 12:58
DavidNohejl22-Jun-05 12:58 
GeneralRe: root element is missing Pin
Ahmed Galal22-Jun-05 13:04
Ahmed Galal22-Jun-05 13:04 
Generalconfused Pin
Anonymous21-Jun-05 3:41
Anonymous21-Jun-05 3:41 
GeneralRe: confused Pin
Anonymous21-Jun-05 3:47
Anonymous21-Jun-05 3:47 
Questionhow to contract empty tag <col></col> to <col/> in XSLT Pin
Lyteck21-Jun-05 1:54
Lyteck21-Jun-05 1:54 
Hello:

I am trying to contract an empty tag (with attributes) to the short XML form.

For example:

[current] <col width="100"></col>

[desired] <col width="100"/>

My current XSLT template, outputs beginning <col> and end </col> tags:

<xsl:for-each select="colspec">
<col>
<xsl:for-each select="@*">
<xsl:choose>
<xsl:when test="(name() = 'colwidth') or (name() = 'colsep') or (name() = 'colname') or (name() = 'colnum')">
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:if test="@colwidth"><xsl:attribute name="width"><xsl:value-of select="@colwidth"/></xsl:attribute></xsl:if>
<xsl:apply-templates/>
</col>
</xsl:for-each>

I am wondering how to collapse the end tag when the element is actually empty. Any insight would be greatly appreciated.

Lyteck
AnswerRe: how to contract empty tag &lt;col&gt;&lt;/col&gt; to &lt;col/&gt; in XSLT Pin
Javier Lozano22-Jun-05 11:48
Javier Lozano22-Jun-05 11:48 
GeneralRe: how to contract empty tag &lt;col&gt;&lt;/col&gt; to &lt;col/&gt; in XSLT Pin
Lyteck27-Jun-05 3:13
Lyteck27-Jun-05 3:13 
GeneralLoading custom control from XSLT Pin
randomnumber21-Jun-05 0:59
randomnumber21-Jun-05 0:59 
GeneralXSD Problem Pin
matt cole20-Jun-05 16:06
matt cole20-Jun-05 16:06 
GeneralXSD Problem Pin
Chetan Ranpariya13-Jul-05 22:29
Chetan Ranpariya13-Jul-05 22:29 
GeneralProblem creating working XSD with restrictions Pin
clatten20-Jun-05 1:42
clatten20-Jun-05 1:42 
GeneralProblem Creating XML [SOLVED] Pin
Paolo Ponzano20-Jun-05 0:16
Paolo Ponzano20-Jun-05 0:16 
QuestionWhy do i allways get the same value? Pin
shapper18-Jun-05 12:57
shapper18-Jun-05 12:57 
QuestionIs this possible ? Pin
Wilbur J. Pereira18-Jun-05 0:38
Wilbur J. Pereira18-Jun-05 0:38 
GeneralXML As Database Pin
Gaurang Desai17-Jun-05 22:45
Gaurang Desai17-Jun-05 22:45 
GeneralRe: XML As Database Pin
Ahmed Galal22-Jun-05 12:57
Ahmed Galal22-Jun-05 12:57 
Generalsetting the parameter value based on condition Pin
D.Sridhar17-Jun-05 10:38
D.Sridhar17-Jun-05 10:38 
GeneralSuitability of XML Pin
Anonymous17-Jun-05 5:50
Anonymous17-Jun-05 5:50 
GeneralRe: Suitability of XML Pin
DavidNohejl17-Jun-05 5:58
DavidNohejl17-Jun-05 5:58 
QuestionHow to improve my code? Thank You. Pin
shapper17-Jun-05 5:31
shapper17-Jun-05 5:31 
Generalcreating nested comparison through the xml property Pin
Member 205376617-Jun-05 4:20
Member 205376617-Jun-05 4:20 
QuestionHow to format this date? Pin
shapper16-Jun-05 14:01
shapper16-Jun-05 14:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.