Click here to Skip to main content
15,890,973 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hi,
I am trying to use to add nil="true" in my destination instance but it returns with
"Object reference not set to an instance of object" error.
Thanks in advance,
Brian

Update from OP:
The XSLT being used is of form:
XML
<xsl:template name="SetNilValue" xmlns:xsl="#unknown">
       <xsl:param name="IsNil">
               <xsl:choose>
                   <xsl:when test="$IsNil = true">
                        <xsl:attribute name="xsi:nil">true</xsl:attribute>
                   </xsl:when>
               </xsl:choose>
</xsl:param></xsl:template>
Posted
Updated 31-Mar-11 6:58am
v2
Comments
Monjurul Habib 30-Mar-11 15:06pm    
provide samples with proper explanation.
Sandeep Mewara 31-Mar-11 12:59pm    
And why was yhis downvoted? :doh:
Countered.

Well, the error simple means you are trying to use a property of an object that is null.

Since you have not shared the code, difficult to specify it where exactly but a simple use of VS DEBUGGER can point you to correct place and you can handle the same.
 
Share this answer
 
Comments
CannonD 31-Mar-11 9:03am    
Sandeep,
Thanks for your reply, I tested with other simple schema and it works but when I tried with real schema for my project it returns that error. But unfortunately I can not share my schema here. I will look into more.

Thanks,
Sandeep Mewara 31-Mar-11 9:50am    
Ok.

What you need is to look at the line from where the error is thrown. (Stack Trace must be showing it). Just put a DEBUGGER there and then look at the objects. Surely one of them would be null and you must be trying to get any property of that null object.
CannonD 31-Mar-11 12:54pm    
Sandeep,
I am trying different approach to have my own script functoid to add xsi:nil=ture based on input.
so I have this code but it seems not working. I do not see the element at all.
I am using Inline XSLT Call Template with one input, if the input element has xsi:nil="ture" then I will add this attribute in the destination element.

*Refer the XSLT in question. (Moved there)

Thanks,
CannonD 31-Mar-11 12:59pm    
Sandeep,
I copid my code but it removed all tags, is there easier way to copy code here?
Thanks,
Sandeep Mewara 31-Mar-11 13:02pm    
I just edited your question with your code that you tried to put here.

In case needed, edit your question and update it with some snppets that you can share across.
BTW, based on what you say, sounds like an issue in XSL?
Its difficult to pinpoint since I am not seeing your solution. Anyway, Check Application section on the event viewer of your Biztalk Admin Console. The error is usually labeled with the word Biztalk or XLANG. From there, you will be able to determine which orchestration has errored.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900