![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - RE: Debug help >Thread Next - Re: Debug help RE: Debug helpTo: NULL Date: 8/1/2008 1:49:00 PM Update. Again through trial and error I was able to determine that this "wrapper" in the xsl seems to be the culprit. public bool MerchandisedProduct(string connectionString, XPathNavigator nav) { SqlFunctions mySqlFunctions = new SqlFunctions(connectionString, nav); return mySqlFunctions.MerchandisedProduct(); } It seems that if I use this wrapper with an XPathNavigator that points to more than one node it fails. The reason that I know that it is the wrapper in the XSL and not my function is that I changed the return so that it always returned 'false' so the call was not made to my custom code. Any idea on how I can change the wrapper so that it handles multiple nodes as return by an XPath statement like: bsi:MerchandisedProduct($CatalogConnectionString,Relationship/Relation/SKU) ? Thank you. Kevin "Kevin Burton" wrote: > Through trial and error I think I have narrowed down the problem to the > following: > > Not Merchandised Errors - <xsl:value-of > select="count(/Envelope/Message[(MessageID = $MessageTestList/root/list/item) > and > (bsi:MerchandisedProduct($CatalogConnectionString,Relationship/Relation/SKU))])"/> > > May assumption is that > > Relationship/Relation/SKU > > in the context about is passed to my custom XSL function as a single node. > Perhaps that assumption is in error. So now this is a query question. The > format of the XML document looks like: > > <Envelope> > <Message> > <MessageId>1234</MessageId> > <Relationship> > <Relation> > <SKU>5678</SKU> > </Relation> > </Relationship> > </Message> > </Envelope> > > I want to make sure that the MessageID is in the first list (that is an > XPath expression). Now I want to make sure that each SKU that is a sub set of > the nodes that match the first XPath to be passed to the custom function. > > Is that confusing enough? > > Kevin > "Kevin Burton" wrote: > > > I have a transform that works on a large number of files. Every once and a > > while I get the following exception thrown: > > > > A first chance exception of type 'System.Xml.Xsl.XslTransformException' > > occurred in System.Data.SqlXml.dll > > System.Xml.Xsl.XslTransformException: Cannot convert a node-set which > > contains zero nodes or more than one node to a single node. > > at System.Xml.Xsl.Runtime.XsltConvert.ToNode(IList`1 listItems) > > at <xsl:template match="/">(XmlQueryRuntime > > {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator > > {urn:schemas-microsoft-com:xslt-debug}current) > > at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) > > at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) > > at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, > > XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter > > results) > > at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, > > XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, > > Boolean closeWriter) > > at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, > > XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results) > > at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, > > XmlResolver dataSources, XsltArgumentList argumentList, Stream results) > > at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, > > XsltArgumentList arguments, Stream results) > > > > > > Any hints on how I might be able to isolate the input that is causing the > > problem and maybe the line(s) in the stylesheet that are involved? > > > > Thank you. > > > > Kevin > > | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||
|
