XTDE0410: An attribute node (color) cannot be created after the children of the containing element

678 views
Skip to first unread message

Roopesh Navath

unread,
Feb 19, 2018, 3:40:45 AM2/19/18
to DITA-OT Users
Hi Developers,

I am getting an error "XTDE0410: An attribute node (color) cannot be created after the children of the containing element" in flagging.xsl.

<xsl:template name="outputFlagStyle">
      <xsl:param name="value"/>

      <xsl:choose>
         <xsl:when test="$value = ''"/>
         <xsl:when test="contains($value,':')">
            <xsl:variable name="attr" select="substring-before($value,':')"/>
            <xsl:variable name="val" select="substring-after($value,':')"/>
           
            <xsl:attribute name="{$attr}">
               <xsl:value-of select="$val"/>
            </xsl:attribute>
           

         </xsl:when>
         <xsl:otherwise>
            <!-- do nothing -->
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

When i add <xsl:copy> sorround the attribute error disappears, but flagging not working(compare result for added and deleted words)

Thanks in Advance

Roopesh

Eliot Kimber

unread,
Feb 20, 2018, 1:22:27 PM2/20/18
to Roopesh Navath, DITA-OT Users
This means that the attribute is being emitted after something, probably a text node, has been created before this code is called. You'll have to look for who is calling the outputFlagStyle template and see what's happened before it in order to determine what you have to do to make it work.

Cheers,

Eliot

--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Eliot Kimber

Roopesh Navath

unread,
Feb 21, 2018, 5:02:18 AM2/21/18
to DITA-OT Users
Thank you Elliot for your help.

Sorry for troubling again.

outputFlagStyle
is calling in the below two places, but i am not able to see any text node before the template call. 


 <xsl:template name="parseFlagStyle">

      <xsl:param name="value"/>

      <xsl:choose>
         <xsl:when test="$value = ''"/>
         <xsl:when test="contains($value,';')">
            <xsl:variable name="firstValue" select="substring-before($value,';')"/>
            <xsl:call-template name="outputFlagStyle">
               <xsl:with-param name="value">
                  <xsl:value-of select="$firstValue"/>
               </xsl:with-param>
            </xsl:call-template>

            <xsl:call-template name="parseFlagStyle">
               <xsl:with-param name="value" select="substring-after($value,';')"/>
            </xsl:call-template>
         </xsl:when>
         <xsl:otherwise>
            <xsl:call-template name="outputFlagStyle">
               <xsl:with-param name="value">
                  <xsl:value-of select="$value"/>
               </xsl:with-param>
            </xsl:call-template>

         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>



<xsl:template match="suitesol:flagging-inside">
      <xsl:call-template name="parseFlagStyle">
         <xsl:with-param name="value">
            <xsl:value-of select="@style"/>
         </xsl:with-param>
         <xsl:apply-templates />
      </xsl:call-template>

  </xsl:template>

Thanks in advance

Roopesh
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Eliot Kimber

Eliot Kimber

unread,
Feb 21, 2018, 10:21:42 AM2/21/18
to Roopesh Navath, DITA-OT Users
You have to keep following the chain of templates until you find the place that an element is being emitted. The fact that there's already three levels of template between where an element might be emitted and the code generating the attribute is pretty suspect--makes it almost impossible to predict what the output context will be when that attribute is generated.

Cheers,

E.

To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Eliot Kimber
Reply all
Reply to author
Forward
0 new messages