Duplicate id issue during transformation.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Duplicate id issue during transformation.

Lingesh_Palanivelu

Hi Team,

 

I’m currently facing an issue after generating the content for an accordion using xsl.

 

Requirement:

1. Based on the response from the web service. We need to generate the accordions(created using JavaScript) dynamically .

2. Also based on the response the contents of the accordions should be generated.

 

We have created all the contents and accordions using the oxf:xslt processor. While seeing the xml output I’m getting the proper result but after including the output to the xhtml file using xi:include becomes the problem.

 

Can anybody help me out in this?

 

 

This error is related to id of the particular case inside xforms:switch.

<xsl:for-each select="EmailServices/Mail">

                <xsl:variable name="pos" select="position()"/>

                <xsl:variable name="successpath" select="concat('.[//email',$pos,'/showsuccess=',&quot;'&quot;,'true',&quot;'&quot;,']')"/>

                <xsl:variable name="formpath" select="concat('.[//email',$pos,'/showform=',&quot;'&quot;,'true',&quot;'&quot;,']')"/>

                <xsl:variable name="errorpath" select="concat('.[//email',$pos,'/showerror=',&quot;'&quot;,'true',&quot;'&quot;,']')"/>

                <xsl:variable name="actualpasswordinstance" select="concat('instance(',&quot;'&quot;,'email_instance',&quot;'&quot;,')//email',$pos,'/actualpassword')"/>

 

                <xsl:variable name="oldpasswordinstance" select="concat('instance(',&quot;'&quot;,'email_instance',&quot;'&quot;,')//email',$pos,'/oldpassword')"/>

 

                <xsl:variable name="newpasswordinstance" select="concat('instance(',&quot;'&quot;,'email_instance',&quot;'&quot;,')//email',$pos,'/newpassword')"/>

 

                <xsl:variable name="confirmpasswordinstance" select="concat('instance(',&quot;'&quot;,'email_instance',&quot;'&quot;,')//email',$pos,'/confirmpassword')"/>

 

                <xsl:element name="form{$pos}">

 

 

                                <xsl:element name="xforms:group">

                                                <xsl:attribute name="ref"><xsl:value-of select="$successpath"/></xsl:attribute>

                                                                <xhtml:div class="succes-block" >

                                                                                <h3>Wachtwoord wijzigen gelukt</h3>

                                                                                <p>Lorem ipsum dolor sit amet consecteur adipiscing elit. Lorem ipsum dolor sit amet consecteur adipiscing elit.</p>

                                                                </xhtml:div>                                     

                                               

                                </xsl:element>

 

                                <xsl:element name="xforms:group">

                                                <xsl:attribute name="ref"><xsl:value-of select="$formpath"/></xsl:attribute>

                                                <xforms:switch>

                                                                <xsl:element name="xforms:case">

                                                                                <xsl:attribute name="id"><xsl:value-of select="concat('showbar',$pos)"/></xsl:attribute>

                                                                                <div class="linewrapper">

                                                                                                <span class="labelwrapper align-left">

                                                                                                                <span class="label">Wachtwoord</span>

                                                                                                </span>

                                                                                                <span class="controlwrapper">

                                                                                                                <span class="control decorated">

                                                                                                                                <xforms:trigger appearance="minimal">

                                                                                                                                                <xforms:label>Wijzigen</xforms:label>

                                                                                                                                                <xsl:element name="xforms:toggle">

                                                                                                                                                                <xsl:attribute name="case"><xsl:value-of select="concat('showform',$pos)"/></xsl:attribute>

                                                                                                                                                                <xsl:attribute name="ev:event"><xsl:value-of select="'DOMActivate'"/></xsl:attribute>

                                                                                                                                                </xsl:element>

                                                                                                                                </xforms:trigger>

                                                                                                                                <span class="tooltipwrapper">

                                                                                                                                                <span class="icon-questiongrey floatRight">?</span>

                                                                                                                                                <span class="fallback">Lorem ipsum dolor sit amet consecteur adipiscing elit.</span>

                                                                                                                                </span>

                                                                                                                </span>

                                                                                                </span>

                                                                                </div>

                                                                </xsl:element>

                                                                <xsl:element name="xforms:case">

                                                                                <xsl:attribute name="id"><xsl:value-of select="concat('showform',$pos)"/></xsl:attribute>

                                                                                <xhtml:fieldset class="alternative">

                                                                                                <xhtml:h3>Wachtwoord<span class="icon-questiongrey floatRight kpn-bh-richtooltip">?</span></xhtml:h3>

                                                                                <xhtml:p>Loerm ipsum dolor sit amet, consectetur adipiscing elit. Nam iementum vestibulum. Aenean interdum risus n.</xhtml:p>

                                                                                                <xsl:if test="$pos = 1">

                                                                                                                <xsl:element name="xforms:secret">

                                                                                                                                <xsl:attribute name="ref"><xsl:value-of select="$actualpasswordinstance"/></xsl:attribute>

                                                                                                                                <xsl:attribute name="id"><xsl:value-of select="concat('actualpassword',$pos)"/></xsl:attribute>

                                                                                                                                <xsl:attribute name="class"><xsl:value-of select="'width-164'"/></xsl:attribute>

                                                                                                                                <xsl:attribute name="style"><xsl:value-of select="'visibility:hidden; display:none;'"/></xsl:attribute>

                                                                                                                </xsl:element>

                                                                                                                <xhtml:div class="linewrapper controlwrapper control">

                                                                                                                                <xsl:element name="xforms:secret">

                                                                                                                                                <xsl:attribute name="ref"><xsl:value-of select="$oldpasswordinstance"/></xsl:attribute>

                                                                                                                                                <xsl:attribute name="id"><xsl:value-of select="concat('oldpassword',$pos)"/></xsl:attribute>

                                                                                                                                                <xsl:attribute name="xxforms:maxlength"><xsl:value-of select="'16'"/></xsl:attribute>

                                                                                                                                                <xforms:label class="labelwrapper">huidig wachtwoord*</xforms:label>

                                                                                                                                </xsl:element>

                                                                                                                                <span class="callout">

                                                                                                                                </span>              

                                                                                                                </xhtml:div>

                                                                                                </xsl:if>

                                                                                                <xhtml:div class="linewrapper controlwrapper control">

                                                                                                                <xsl:element name="xforms:secret">

                                                                                                                                <xsl:attribute name="ref"><xsl:value-of select="$newpasswordinstance"/></xsl:attribute>

                                                                                                                                <xsl:attribute name="id"><xsl:value-of select="concat('newpassword',$pos)"/></xsl:attribute>

                                                                                                                                <xsl:attribute name="xxforms:maxlength"><xsl:value-of select="'16'"/></xsl:attribute>

                                                                                                                                <xforms:label class="labelwrapper">Nieuw wachtwoord*</xforms:label>

                                                                                                                </xsl:element>

                                                                                                                <span class="moreinfo">Minimaal 8 en maximaal 16 tekens!</span>

                                                                                                                <span class="callout">

                                                                                                                </span>              

                                                                                                </xhtml:div>

                                                                                                <xhtml:div class="linewrapper controlwrapper control">

                                                                                                                <xsl:element name="xforms:secret">

                                                                                                                                <xsl:attribute name="ref"><xsl:value-of select="$confirmpasswordinstance"/></xsl:attribute>

                                                                                                                                <xsl:attribute name="id"><xsl:value-of select="concat('confirmpassword',$pos)"/></xsl:attribute>

                                                                                                                                <xsl:attribute name="xxforms:maxlength"><xsl:value-of select="'16'"/></xsl:attribute>

                                                                                                                                <xforms:label class="labelwrapper">Herhaal wachtwoord*</xforms:label>

                                                                                                                </xsl:element>

                                                                                                                <span class="callout">

                                                                                                                </span>              

                                                                                                </xhtml:div>

                                                                                                <xhtml:div class="buttonwrapper">

                                                                                                                <xhtml:p>Lorem ipsum dolor sit amet, consecteur adipiscing elit. Nam mollis elemntum vertibulum. Lorem ipsum dolor sit amet, consecteur adipiscing elit. Nam mollis elemntum vertibulum. Lorem ipsum dolor sit amet, consecteur adipiscing elit. Nam mollis elemntum vertibulum.</xhtml:p>

                                                                                                </xhtml:div>

                                                                                                <xhtml:div class="buttonwrapper" >

                                                                                                                <xsl:element name="span">

                                                                                                                                <xsl:attribute name="class"><xsl:value-of select="'button-blue'"/></xsl:attribute>

                                                                                                                                <xsl:attribute name="id"><xsl:value-of select="concat('opslaanclass',$pos)"/></xsl:attribute>

                                                                                                                                <xsl:element name="xforms:trigger">

                                                                                                                                                <xsl:attribute name="id"><xsl:value-of select="concat('opslaanbutton',$pos)"/></xsl:attribute>

                                                                                                                                                <xforms:label>opslaan</xforms:label>

                                                                                                                                                <xsl:element name="xforms:send">

                                                                                                                                                                <xsl:attribute name="ev:event"><xsl:value-of select="'DOMActivate'"/></xsl:attribute>

                                                                                                                                                                <xsl:attribute name="submission"><xsl:value-of select="concat('next-submission',$pos)"/></xsl:attribute>

                                                                                                                                                </xsl:element>

                                                                                                                                </xsl:element>

                                                                                                                </xsl:element>

                                                                                                                <xsl:element name="span">

                                                                                                                                <xsl:attribute name="class"><xsl:value-of select="'button-grey'"/></xsl:attribute>

                                                                                                                                <xsl:element name="xforms:trigger">

                                                                                                                                                <xforms:label>annuleren</xforms:label>

                                                                                                                                                <xsl:element name="xforms:toggle">

                                                                                                                                                                <xsl:attribute name="case"><xsl:value-of select="concat('showbar',$pos)"/></xsl:attribute>

                                                                                                                                                                                <xsl:attribute name="ev:event"><xsl:value-of select="'DOMActivate'"/></xsl:attribute>

                                                                                                                                                </xsl:element>

                                                                                                                                </xsl:element>

                                                                                                                </xsl:element>

                                                                                                               

                                                                                                               

                                                                                                               

                                                                                                </xhtml:div>

                                                                                </xhtml:fieldset>

                                                                </xsl:element>

                                                                <xsl:element name="xforms:case">

                                                                                <xsl:attribute name="id"><xsl:value-of select="concat('showspinner',$pos)"/></xsl:attribute>

                                                                                <xhtml:div class="error-block">               

                                                                                                <xhtml:img src="/apps/kpnstatic/images/css/ajax-loader.gif"/>

                                                                                                <xhtml:p>Wachtwoord wordt opgeslagen. Een moment aub...</xhtml:p>

                                                                                </xhtml:div>

                                                                </xsl:element>

                                                </xforms:switch>

                                </xsl:element>

 

                                <xsl:element name="xforms:group">

                                                <xsl:attribute name="ref"><xsl:value-of select="$errorpath"/></xsl:attribute>

                                                                <div class="error-block">

                                                                                <p class="iconbig-caution">Opslaan van het wachtwoord is niet gelukt. Probeer het nog eens...</p>

                                                                                <span class="button-blue" id="opslaanclass">

                                                                                                <xsl:element name="xforms:trigger">

                                                                                                                <xforms:label>opslaan</xforms:label>

                                                                                                                <xsl:element name="xforms:send">

                                                                                                                                <xsl:attribute name="ev:event"><xsl:value-of select="'DOMActivate'"/></xsl:attribute>

                                                                                                                                <xsl:attribute name="submission"><xsl:value-of select="concat('back-submission',$pos)"/></xsl:attribute>

                                                                                                                </xsl:element>

                                                                                                                <xsl:element name="xforms:toggle">

                                                                                                                                <xsl:attribute name="case"><xsl:value-of select="concat('showform',$pos)"/></xsl:attribute>

                                                                                                                                <xsl:attribute name="ev:event"><xsl:value-of select="'DOMActivate'"/></xsl:attribute>

                                                                                                                </xsl:element>

                                                                                                </xsl:element>

                                                                                </span>

                                                                </div>

                                </xsl:element>

                </xsl:element>

</xsl:for-each>

 

Thanks and Regards,

Lingesh P

 



DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Duplicate id issue during transformation.

Alessandro  Vernet
Administrator
Hi Lingesh,

What are you xincluding and where? Are you sure that it doesn't get included more than once in the same form, which would explain why you end up with two showbar1 ids?

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

RE: Re: Duplicate id issue during transformation.

Lingesh_Palanivelu

Hi Alex,

I'm including it in the body of the xhtml file.

The output will contains xforms:switch control and each case of the switch will do certain functionalities.I have checked the transformed output and there is only one id called showbar1.

Is it a problem since the same case id value is used in the case of the xforms:toggle?


Regards,
Lingesh P.
Developer,
Mahindra Satyam.





-----Original Message-----
From: Alessandro Vernet [mailto:[hidden email]]
Sent: Friday, July 08, 2011 9:13 AM
To: [hidden email]
Subject: [ops-users] Re: Duplicate id issue during transformation.

Hi Lingesh,

What are you xincluding and where? Are you sure that it doesn't get included more than once in the same form, which would explain why you end up with two
showbar1 ids?

Alex

--
View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Duplicate-id-issue-during-transformation-tp3650758p3653148.html
Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.

DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: RE: Re: Duplicate id issue during transformation.

Erik Bruchez
Administrator
Lingesh,

Ids must be unique per XBL scope (here you are not using XBL so they
must be unique).

So if you generate more than one case with the same id, you will get an error.

-Erik

On Thu, Jul 7, 2011 at 9:45 PM, Lingesh_Palanivelu
<[hidden email]> wrote:

>
> Hi Alex,
>
> I'm including it in the body of the xhtml file.
>
> The output will contains xforms:switch control and each case of the switch will do certain functionalities.I have checked the transformed output and there is only one id called showbar1.
>
> Is it a problem since the same case id value is used in the case of the xforms:toggle?
>
>
> Regards,
> Lingesh P.
> Developer,
> Mahindra Satyam.
>
>
>
>
>
> -----Original Message-----
> From: Alessandro Vernet [mailto:[hidden email]]
> Sent: Friday, July 08, 2011 9:13 AM
> To: [hidden email]
> Subject: [ops-users] Re: Duplicate id issue during transformation.
>
> Hi Lingesh,
>
> What are you xincluding and where? Are you sure that it doesn't get included more than once in the same form, which would explain why you end up with two
> showbar1 ids?
>
> Alex
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Duplicate-id-issue-during-transformation-tp3650758p3653148.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
> DISCLAIMER:
> This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws