Custom .NET Class for Business Rule Fact
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server General > Custom .NET Class for Business Rule Fact




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Custom .NET Class for Business Rule Fact  
NickH2472


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-28-04 10:52 PM

I am looking to write a custom .NET class to provide a mechanism of returnin
g
the number of characters in an XML element.

I have created a simple method named Length(), with one parameter 'sString'
of type string. However, when I attempt to use an element in my XML document
I receive the following error:

"The definition <XPath to element name> is not compatible with the argument
type (String)"

However If I pass an attribute to the method everything works as expected.
Can anyone advise what parameter type I should be using in my method? Note:
The element in question has a base datatype of 'xs:string', Content Type of
'SimpleContent' and a Derived By value of 'Extension'.

An example of my XML document structure is below.

Regards, Nick


Example:
<order>
<orderLines>
<line>
<ProductCode error="This is some error text">HL1450</ProductCode>
</line>
</orderLines>
</order>

/order/orderLines/line/ProductCode <-- Will not work as an input to the meth
od
/order/orderLines/line/ProductCode/@error <-- Will work as an input to the
method








[ Post a follow-up to this message ]



    Re: Custom .NET Class for Business Rule Fact  
Matt Milner


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-29-04 08:06 AM

Try TypedXmlDocument, this should allow you to get at the node pretty easily
and work with it in the DOM to get the inner text of the node.

matt


"NickH2472" <NickH2472@discussions.microsoft.com> wrote in message
news:B218AB49-9E52-427F-8182-0CFD29C4F68E@microsoft.com...
>I am looking to write a custom .NET class to provide a mechanism of
>returning
> the number of characters in an XML element.
>
> I have created a simple method named Length(), with one parameter
> 'sString'
> of type string. However, when I attempt to use an element in my XML
> document
> I receive the following error:
>
> "The definition <XPath to element name> is not compatible with the
> argument
> type (String)"
>
> However If I pass an attribute to the method everything works as expected.
> Can anyone advise what parameter type I should be using in my method?
> Note:
> The element in question has a base datatype of 'xs:string', Content Type
> of
> 'SimpleContent' and a Derived By value of 'Extension'.
>
> An example of my XML document structure is below.
>
> Regards, Nick
>
>
> Example:
> <order>
>    <orderLines>
>        <line>
>            <ProductCode error="This is some error
> text">HL1450</ProductCode>
>        </line>
>    </orderLines>
> </order>
>
> /order/orderLines/line/ProductCode <-- Will not work as an input to the
> method
> /order/orderLines/line/ProductCode/@error <-- Will work as an input to the
> method
>
>
>







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:09 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register